From patchwork Wed Nov 13 15:25:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 290967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 80A5A2C009D for ; Thu, 14 Nov 2013 02:26:00 +1100 (EST) Received: from localhost ([::1]:49244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgcKM-00073S-K7 for incoming@patchwork.ozlabs.org; Wed, 13 Nov 2013 10:25:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgcJu-00073A-91 for qemu-devel@nongnu.org; Wed, 13 Nov 2013 10:25:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgcJp-0006pK-5P for qemu-devel@nongnu.org; Wed, 13 Nov 2013 10:25:30 -0500 Received: from smtp.citrix.com ([66.165.176.89]:16142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgcJp-0006oy-0U for qemu-devel@nongnu.org; Wed, 13 Nov 2013 10:25:25 -0500 X-IronPort-AV: E=Sophos;i="4.93,693,1378857600"; d="scan'208";a="74063658" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 13 Nov 2013 15:25:15 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.2.342.4; Wed, 13 Nov 2013 10:25:15 -0500 Received: from cosworth.uk.xensource.com ([10.80.16.52] helo=cosworth.uk.xensource.com. ident=pauldu) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1VgcJe-0001uU-Bv; Wed, 13 Nov 2013 15:25:14 +0000 From: Paul Durrant To: , Date: Wed, 13 Nov 2013 15:25:07 +0000 Message-ID: <1384356307-16446-1-git-send-email-paul.durrant@citrix.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-DLP: MIA2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Cc: Paul Durrant Subject: [Qemu-devel] [PATCH] xen-pvdevice: make device-id property compulsory X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The intention of the Xen PV device is that it is used as a parent device for PV drivers in Xen HVM guests and the set of PV drivers that bind to the device is determined by its device ID (and possibly vendor ID and revision). As such, the device should not have a default device ID, it should always be supplied by the Xen toolstack. Signed-off-by: Paul Durrant --- hw/xen/xen_pvdevice.c | 6 +++++- include/hw/pci/pci_ids.h | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/xen/xen_pvdevice.c b/hw/xen/xen_pvdevice.c index 1132c89..c218947 100644 --- a/hw/xen/xen_pvdevice.c +++ b/hw/xen/xen_pvdevice.c @@ -74,6 +74,10 @@ static int xen_pv_init(PCIDevice *pci_dev) XenPVDevice *d = XEN_PV_DEVICE(pci_dev); uint8_t *pci_conf; + /* device-id property must always be supplied */ + if (d->device_id == 0xffff) + return -1; + pci_conf = pci_dev->config; pci_set_word(pci_conf + PCI_VENDOR_ID, d->vendor_id); @@ -99,7 +103,7 @@ static int xen_pv_init(PCIDevice *pci_dev) static Property xen_pv_props[] = { DEFINE_PROP_UINT16("vendor-id", XenPVDevice, vendor_id, PCI_VENDOR_ID_XEN), - DEFINE_PROP_UINT16("device-id", XenPVDevice, device_id, PCI_DEVICE_ID_XEN_PVDEVICE), + DEFINE_PROP_UINT16("device-id", XenPVDevice, device_id, 0xffff), DEFINE_PROP_UINT8("revision", XenPVDevice, revision, 0x01), DEFINE_PROP_UINT32("size", XenPVDevice, size, 0x400000), DEFINE_PROP_END_OF_LIST() diff --git a/include/hw/pci/pci_ids.h b/include/hw/pci/pci_ids.h index 4c0002b..e597070 100644 --- a/include/hw/pci/pci_ids.h +++ b/include/hw/pci/pci_ids.h @@ -146,7 +146,6 @@ #define PCI_VENDOR_ID_XEN 0x5853 #define PCI_DEVICE_ID_XEN_PLATFORM 0x0001 -#define PCI_DEVICE_ID_XEN_PVDEVICE 0x0002 #define PCI_VENDOR_ID_NEC 0x1033 #define PCI_DEVICE_ID_NEC_UPD720200 0x0194