[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH RFC] x86/shadow: adjust cachability flags handling



For one, including _PAGE_PAT in the pass-through flags is valid only
for L1 entries (otherwise _PAGE_PSE_PAT would need looking at). Looking
around I _think_ that for page directories we'd always get a valid MFN
passed in here, and hence I _think_ the assertion is correct.

And second we need to avoid or-ing guest PAT/PCD/PWT with ones coming
from pat_type_2_pte_flags()/get_pat_flags(). An alternative to the
pass_thru_flags check might be to use mfn_valid(target_mfn).

--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -580,7 +580,10 @@ _sh_propagate(struct vcpu *v, 
     if ( guest_supports_nx(v) )
         pass_thru_flags |= _PAGE_NX_BIT;
     if ( !shadow_mode_refcounts(d) && !mfn_valid(target_mfn) )
+    {
+        ASSERT(level == 1);
         pass_thru_flags |= _PAGE_PAT | _PAGE_PCD | _PAGE_PWT;
+    }
     sflags = gflags & pass_thru_flags;
 
     /*
@@ -588,6 +591,7 @@ _sh_propagate(struct vcpu *v, 
      * caching attributes in the shadows to match what was asked for.
      */
     if ( (level == 1) && is_hvm_domain(d) &&
+         !(pass_thru_flags & (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT)) &&
          !is_xen_heap_mfn(mfn_x(target_mfn)) )
     {
         unsigned int type;



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.