From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcbkL-0004P2-Gs for qemu-devel@nongnu.org; Fri, 10 Oct 2014 11:04:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcbkH-0004XU-U2 for qemu-devel@nongnu.org; Fri, 10 Oct 2014 11:04:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcbkH-0004XH-Ng for qemu-devel@nongnu.org; Fri, 10 Oct 2014 11:04:41 -0400 Message-ID: <5437F570.8070106@redhat.com> Date: Fri, 10 Oct 2014 17:04:16 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1412949407-16779-1-git-send-email-paul.durrant@citrix.com> <9AAE0902D5BC7E449B7C8E4E778ABCD0110FD875@AMSPEX01CL01.citrite.net> In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD0110FD875@AMSPEX01CL01.citrite.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Xen: Use the ioreq-server API when available List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Durrant , Stefano Stabellini Cc: Peter Maydell , Peter Crosthwaite , Thomas Huth , "Michael S. Tsirkin" , Alexey Kardashevskiy , Stefan Weil , Michael Tokarev , "qemu-devel@nongnu.org" , Alexander Graf , Gerd Hoffmann , Stefan Hajnoczi , "xen-devel@lists.xenproject.org" , "Andreas Faerber\"" , Eduardo Habkost Il 10/10/2014 16:52, Paul Durrant ha scritto: >> -----Original Message----- >> From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com] >> Sent: 10 October 2014 15:40 >> To: Paul Durrant >> Cc: qemu-devel@nongnu.org; xen-devel@lists.xenproject.org; Michael S. >> Tsirkin; Stefano Stabellini; Peter Maydell; Paolo Bonzini; Michael Tokarev; >> Stefan Hajnoczi; Stefan Weil; Andreas Faerber"; Thomas Huth; Peter >> Crosthwaite; Eduardo Habkost; Gerd Hoffmann; Alexey Kardashevskiy; >> Alexander Graf >> Subject: Re: [PATCH] Xen: Use the ioreq-server API when available >> >> On Fri, 10 Oct 2014, Paul Durrant wrote: >>> The ioreq-server API added to Xen 4.5 offers better security than >>> the existing Xen/QEMU interface because the shared pages that are >>> used to pass emulation request/results back and forth are removed >>> from the guest's memory space before any requests are serviced. >>> This prevents the guest from mapping these pages (they are in a >>> well known location) and attempting to attack QEMU by synthesizing >>> its own request structures. Hence, this patch modifies configure >>> to detect whether the API is available, and adds the necessary >>> code to use the API if it is. >>> >>> The ioreq-server API does require that PCI device models explicitly >>> register with Xen for config space accesses, so to use the API the >>> code in xen-hvm.c needs to be informed as PCI devices are added or >>> removed from PCI buses. This patch therefore also adds a PCI bus >>> listener interface akin to the memory listener interface to fulfil >>> this need. >>> >>> Signed-off-by: Paul Durrant >>> Cc: Michael S. Tsirkin >>> Cc: Stefano Stabellini >>> Cc: Peter Maydell >>> Cc: Paolo Bonzini >>> Cc: Michael Tokarev >>> Cc: Stefan Hajnoczi >>> Cc: Stefan Weil >>> Cc: Andreas Faerber" >>> Cc: Thomas Huth >>> Cc: Peter Crosthwaite >>> Cc: Eduardo Habkost >>> Cc: Gerd Hoffmann >>> Cc: Alexey Kardashevskiy >>> Cc: Alexander Graf >>> --- >>> configure | 29 ++++++ >>> hw/pci/pci.c | 65 ++++++++++++ >>> include/hw/pci/pci.h | 9 ++ >>> include/qemu/typedefs.h | 1 + >>> trace-events | 8 ++ >>> xen-hvm.c | 251 >> +++++++++++++++++++++++++++++++++++++++++++---- >>> 6 files changed, 345 insertions(+), 18 deletions(-) >> >> Please split this patch into two: one to introduce the PCI listener >> stuff and another for the Xen specific changes. >> > > Originally it was, but I was uneasy about introducing an interface with no consumers. Is that generally acceptable? It is the suggested way as long as the two patches are part of the same series. Paolo