From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH] tools: libxl: allow permissive qemu-upstream pci passthrough. Date: Tue, 6 Oct 2015 09:36:37 +0100 Message-ID: <1444120597.5302.42.camel@citrix.com> References: <1433260042.15036.332.camel@citrix.com> <1435934969.9447.147.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1435934969.9447.147.camel@citrix.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: Stefano Stabellini , Ian Jackson Cc: Anthony PERARD , xen-devel@lists.xensource.com, Wei Liu , JBeulich@suse.com List-Id: xen-devel@lists.xenproject.org Ian, Can you backport this to 4.5 and earlier please. On Fri, 2015-07-03 at 15:49 +0100, Ian Campbell wrote: > On Tue, 2015-06-02 at 16:47 +0100, Ian Campbell wrote: > > Anyone fancy (n)acking this followup to XSA-131? I think we probably > want this for 4.6. > > > From c395657b03a1e2b7616d987e7078694874981979 Mon Sep 17 00:00:00 2001 > > From: Ian Campbell > > Date: Mon, 1 Jun 2015 11:32:23 +0100 > > Subject: [PATCH] tools: libxl: allow permissive qemu-upstream pci > > passthrough. > > > > EMBARGOED UNTIL 2015-06-02 12:00 (WITH XSA-131 ET AL) > > > > Since XSA-131 qemu-xen now restricts access to PCI cfg by default. In > > order to allow local configuration of the existing libxl_device_pci > > "permissive" flag needs to be plumbed through via the new QMP property > > added by the XSA-131 patches. > > > > Versions of QEMU prior to XSA-131 did not support this permissive > > property, so we only pass it if it is true. Older versions only > > supported permissive mode. > > > > qemu-xen-traditional already supports the permissive mode setting via > > xenstore. > > > > Signed-off-by: Ian Campbell > > Cc: Stefano Stabellini > > Cc: Anthony PERARD > > --- > > v2: Only set argument if permissive==true. > > --- > > tools/libxl/libxl_qmp.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c > > index 9aa7e2e..6484f5e 100644 > > --- a/tools/libxl/libxl_qmp.c > > +++ b/tools/libxl/libxl_qmp.c > > @@ -849,6 +849,18 @@ int libxl__qmp_pci_add(libxl__gc *gc, int domid, > > libxl_device_pci *pcidev) > > QMP_PARAMETERS_SPRINTF(&args, "addr", "%x.%x", > > PCI_SLOT(pcidev->vdevfn), > > PCI_FUNC(pcidev->vdevfn)); > > } > > + /* > > + * Version of QEMU prior to the XSA-131 fix did not support this > > + * property and were effectively always in permissive mode. The > > + * fix for XSA-131 switched the default to be restricted by > > + * default and added the permissive property. > > + * > > + * Therefore in order to support both old and new QEMU we only set > > + * the permissive flag if it is true. Users of older QEMU have no > > + * reason to set the flag so this is ok. > > + */ > > + if (pcidev->permissive) > > + qmp_parameters_add_bool(gc, &args, "permissive", true); > > > > rc = qmp_synchronous_send(qmp, "device_add", args, > > NULL, NULL, qmp->timeout); > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel