From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH] x86/PCI: Intercept Dom0 MMCFG from dom0s in HVM containers Date: Thu, 17 Dec 2015 08:55:15 -0500 Message-ID: <5672BEC3.4020208@oracle.com> References: <1450213365-3490-1-git-send-email-boris.ostrovsky@oracle.com> <5671374602000078000C0079@prv-mh.provo.novell.com> <5671BCB0.9040908@oracle.com> <5672927D02000078000C08D7@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5672927D02000078000C08D7@prv-mh.provo.novell.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: Jan Beulich Cc: andrew.cooper3@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 12/17/2015 04:46 AM, Jan Beulich wrote: >>>> On 16.12.15 at 20:34, wrote: >> On 12/16/2015 04:04 AM, Jan Beulich wrote: >>>> --- a/xen/arch/x86/hvm/hvm.c >>>> +++ b/xen/arch/x86/hvm/hvm.c >>>> @@ -3116,6 +3116,21 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla, >>>> goto out_put_gfn; >>>> } >>>> >>>> + if ( (p2mt == p2m_mmio_direct) && is_hardware_domain(currd) ) >>> The PV condition includes a PFEC_page_present check, and I think >>> an equivalent should be added here too. >> Hmm.. So how would I determine that? I can see how this is available in >> SVM (although it is not reflected in npfec) but in VMX I don't see >> direct indication of whether the page was present. > That's what bits 3..5 of the exit qualification can be used for. Really > you could leverage the more fine grained reporting by EPT to make > the condition here "bit 1 must be set" (i.e. npfec.write_access) and > "bit 3 must be set" (readable, which implies present) and "bit 4 must > be clear" (and we might even demand bit 5 to be clear too). OK, but these bits are not mapped into npfec structure so we'd need to expand it. (And then SVM does not provide this much information so we may need to get creative there). -boris