Skip to contentSkip to conversation

xen: honor _PAGE_NX_BIT

PATCH Applied Christoph Egger 2 participants 2 messages Jul 13, 2012 – Jul 19, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: honor _PAGE_NX_BIT

In p2m_type_to_flags() honor _PAGE_NX_BIT for grant type mappings. This brings this code in line with PV and EPT.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
xen/arch/x86/mm/p2m-pt.c +6 -4
diff -r c69ef56d8afc xen/arch/x86/mm/p2m-pt.c
@@ -79,8 +79,8 @@ static unsigned long p2m_type_to_flags(p
     BUG_ON(t > p2m_populate_on_demand);
 #endif
 
-    switch(t)
-    {
+    /* Apply type permissions */
+    switch (t) {
     case p2m_invalid:
     case p2m_mmio_dm:
     case p2m_populate_on_demand:
@@ -89,14 +89,16 @@ static unsigned long p2m_type_to_flags(p
     case p2m_ram_paging_in:
     default:
         return flags;
+    case p2m_grant_map_ro:
+        return flags | P2M_BASE_FLAGS | _PAGE_NX_BIT;
     case p2m_ram_ro:
-    case p2m_grant_map_ro:
     case p2m_ram_logdirty:
     case p2m_ram_shared:
         return flags | P2M_BASE_FLAGS;
     case p2m_ram_rw:
+        return flags | P2M_BASE_FLAGS | _PAGE_RW;
     case p2m_grant_map_rw:
-        return flags | P2M_BASE_FLAGS | _PAGE_RW;
+        return flags | P2M_BASE_FLAGS | _PAGE_RW | _PAGE_NX_BIT;
     case p2m_mmio_direct:
         if ( !rangeset_contains_singleton(mmio_ro_ranges, mfn_x(mfn)) )
             flags |= _PAGE_RW;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel