Li, Chengyuan
2005-Sep-12 07:05 UTC
[Xen-devel] [PATCH][VT] No DISALLOW pte bit check for VMX domain
Hi, VMX domain don''t need DISALLOW pte bit checking. Signed-off-by: Chengyuan Li <chengyuan.li@intel.com> diff -r 51fa7e0bd968 xen/arch/x86/mm.c --- a/xen/arch/x86/mm.c Sat Sep 10 03:34:52 2005 +++ b/xen/arch/x86/mm.c Mon Sep 12 13:48:10 2005 @@ -442,7 +442,7 @@ if ( !(l1e_get_flags(l1e) & _PAGE_PRESENT) ) return 1; - if ( unlikely(l1e_get_flags(l1e) & L1_DISALLOW_MASK) ) + if ( !shadow_mode_refcounts(d) && unlikely(l1e_get_flags(l1e) & L1_DISALLOW_MASK) ) { MEM_LOG("Bad L1 flags %x", l1e_get_flags(l1e) & L1_DISALLOW_MASK); return 0; Thanks, Chengyuan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Sep-12 10:06 UTC
Re: [Xen-devel] [PATCH][VT] No DISALLOW pte bit check for VMX domain
On 12 Sep 2005, at 08:05, Li, Chengyuan wrote:> Hi, > > VMX domain don''t need DISALLOW pte bit checking. > > Signed-off-by: Chengyuan Li <chengyuan.li@intel.com>I think they do need these checks. get_page_from_l1e() is only called on real pagetables, even in shadow mode (i.e., it is called for the shadow pte''s). We still want to check that the guest isn''t trying to set weird PAT values or, if it is, we need to deal with those explicitly. For now, I think the correct think to do is to apply L1_DISALLOW_MASK before calling get_page_from_l1e(). You already strip off the GLOBAL bit, but the rest should be stripped also. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Li, Chengyuan
2005-Sep-12 13:55 UTC
RE: [Xen-devel] [PATCH][VT] No DISALLOW pte bit check for VMX domain
Keir Fraser scribbled on 2005年9月12日 18:06:> On 12 Sep 2005, at 08:05, Li, Chengyuan wrote: > >> Hi, >> >> VMX domain don''t need DISALLOW pte bit checking. >> >> Signed-off-by: Chengyuan Li <chengyuan.li@intel.com> > > I think they do need these checks. get_page_from_l1e() is only called > on real pagetables, even in shadow mode (i.e., it is called for the > shadow pte''s). We still want to check that the guest isn''t trying to > set weird PAT values or, if it is, we need to deal with those > explicitly. For now, I think the correct think to do is to apply > L1_DISALLOW_MASK before calling get_page_from_l1e(). You already strip > off the GLOBAL bit, but the rest should be stripped also.Keir, You are right. For VMX guest, we need care PAT bit, though we needn''t care GLOBAL bit.> > -- KeirThanks, Chengyuan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2005-Sep-12 14:15 UTC
Re: [Xen-devel] [PATCH][VT] No DISALLOW pte bit check for VMX domain
On 12 Sep 2005, at 14:55, Li, Chengyuan wrote:> You are right. For VMX guest, we need care PAT bit, though we needn''t > care GLOBAL bit.Not sure what you mean -- maybe that the GLOBAL bit is ignored in guest VMCS, or that global entries are automatically flushed when transitioning? Well, for now I would just apply the DISALLOW_MASK before calling get_page_from_l1e. Missing the global bit cannot harm performance since we need to transition into Xen (and hence flush global entries) when the guest switches its %cr3 anyway. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel