From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chen, Tiejun" Subject: Re: [v11][PATCH 11/16] tools/libxl: detect and avoid conflicts with RDM Date: Wed, 22 Jul 2015 23:09:27 +0800 Message-ID: <55AFB227.5080906@intel.com> References: <1437528607-19315-1-git-send-email-tiejun.chen@intel.com> <1437528607-19315-12-git-send-email-tiejun.chen@intel.com> <21935.39327.738755.273206@mariner.uk.xensource.com> <55AF9BC6.4030200@intel.com> <21935.41699.296723.745804@mariner.uk.xensource.com> <55AFB003.6020804@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55AFB003.6020804@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: xen-devel@lists.xen.org, Wei Liu , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org OOPS! Please refer to this version: (One miss changing flag to flags in patch #11 although we can compile successfully.) #1. To patch #8 diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index 2991333..9c5ef8b 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -1316,7 +1316,7 @@ int xc_get_machine_memory_map(xc_interface *xch, uint32_t max_entries); int xc_reserved_device_memory_map(xc_interface *xch, - uint32_t flag, + uint32_t flags, uint16_t seg, uint8_t bus, uint8_t devfn, diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index 298b3b5..1b074b7 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -686,7 +686,7 @@ int xc_domain_set_memory_map(xc_interface *xch, } int xc_reserved_device_memory_map(xc_interface *xch, - uint32_t flag, + uint32_t flags, uint16_t seg, uint8_t bus, uint8_t devfn, @@ -695,11 +695,11 @@ int xc_reserved_device_memory_map(xc_interface *xch, { int rc; struct xen_reserved_device_memory_map xrdmmap = { - .flag = flag, - .seg = seg, - .bus = bus, - .devfn = devfn, - .nr_entries = *max_entries + .flags = flags, + .nr_entries = *max_entries, + .dev.pci.seg = seg, + .dev.pci.bus = bus, + .dev.pci.devfn = devfn, }; DECLARE_HYPERCALL_BOUNCE(entries, sizeof(struct xen_reserved_device_memory) * #2. To patch #11 diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 29476fc..8d103c3 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -94,7 +94,7 @@ const char *libxl__domain_device_model(libxl__gc *gc, static int libxl__xc_device_get_rdm(libxl__gc *gc, - uint32_t flag, + uint32_t flags, uint16_t seg, uint8_t bus, uint8_t devfn, @@ -107,7 +107,7 @@ libxl__xc_device_get_rdm(libxl__gc *gc, * We really can't presume how many entries we can get in advance. */ *nr_entries = 0; - r = xc_reserved_device_memory_map(CTX->xch, flag, seg, bus, devfn, + r = xc_reserved_device_memory_map(CTX->xch, flags, seg, bus, devfn, NULL, nr_entries); assert(r <= 0); /* "0" means we have no any rdm entry. */ @@ -119,7 +119,7 @@ libxl__xc_device_get_rdm(libxl__gc *gc, } GCNEW_ARRAY(*xrdm, *nr_entries); - r = xc_reserved_device_memory_map(CTX->xch, flag, seg, bus, devfn, + r = xc_reserved_device_memory_map(CTX->xch, flags, seg, bus, devfn, *xrdm, nr_entries); if (r) rc = ERROR_FAIL; @@ -212,7 +212,7 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc, unsigned int nr_entries; /* Collect all rdm info if exist. */ - rc = libxl__xc_device_get_rdm(gc, PCI_DEV_RDM_ALL, + rc = libxl__xc_device_get_rdm(gc, XENMEM_RDM_ALL, 0, 0, 0, &nr_entries, &xrdm); if (rc) goto out; @@ -240,7 +240,7 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc, devfn = PCI_DEVFN(d_config->pcidevs[i].dev, d_config->pcidevs[i].func); nr_entries = 0; - rc = libxl__xc_device_get_rdm(gc, ~PCI_DEV_RDM_ALL, + rc = libxl__xc_device_get_rdm(gc, 0, seg, bus, devfn, &nr_entries, &xrdm); if (rc) goto out; Thanks Tiejun