From: "Jan Beulich" Subject: Re: [PATCH RFC v12 07/21] pvh: Disable unneeded features of HVM containers Date: Wed, 18 Sep 2013 15:47:25 +0100 Message-ID: <5239D91D02000078000F46E1@nat28.tlf.novell.com> References: <1379089521-25720-1-git-send-email-george.dunlap@eu.citrix.com> <1379089521-25720-8-git-send-email-george.dunlap@eu.citrix.com> <5239D24102000078000F4688@nat28.tlf.novell.com> <5239BC20.30309@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VMJ2R-0002CE-97 for xen-devel@lists.xenproject.org; Wed, 18 Sep 2013 14:47:31 +0000 In-Reply-To: <5239BC20.30309@eu.citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: xen-devel , Keir Fraser , Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> On 18.09.13 at 16:43, George Dunlap wrote: > On 18/09/13 15:18, Jan Beulich wrote: >>>>> On 13.09.13 at 18:25, George Dunlap wrote: >>> --- a/xen/arch/x86/hvm/io.c >>> +++ b/xen/arch/x86/hvm/io.c >>> @@ -175,6 +175,10 @@ int handle_mmio(void) >>> struct hvm_vcpu_io *vio = &curr->arch.hvm_vcpu.hvm_io; >>> int rc; >>> >>> + /* No MMIO for PVH vcpus */ >>> + if ( is_pvh_vcpu(curr) ) >>> + return 0; >>> + >> So why does hvm_pio() not get adjusted similarly? > > At the moment I don't think hvm_pio() will be called for PVH guests. IO > instructions for PVH domains are handled by the PV io emulation engine. > The check here is to make sure that Xen doesn't try to do MMIO for PVH > domains on an EPT violation. Mukesh had an "if(!is_pvh_domain)" in the > EPT handler before calling hvm_hap_nested_page_fault(), which not only > filtered out MMIO, but also any other reason the fault may have happened > (e.g., paging or a mem event). > > I put the check in handle_mmio() instead of hvm_hap_nested_page_fault() > just in case there was another path to that function. I suppose the > same logic applies to hvm_pio(). We could put either an ASSERT or just a > check that returns failure. (I would lean toward an ASSERT.) Yes, an ASSERT() would be fine, restoring consistency. Jan