]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mm/p2m: use NX bit in p2m entries.
authorChristoph Egger <Christoph.Egger@amd.com>
Thu, 19 Jul 2012 10:09:39 +0000 (11:09 +0100)
committerChristoph Egger <Christoph.Egger@amd.com>
Thu, 19 Jul 2012 10:09:39 +0000 (11:09 +0100)
In p2m_type_to_flags() honor _PAGE_NX_BIT for grant type mappings.
This brings this code in line with PV and EPT.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/p2m-pt.c

index c97cac45c5a17351892ce47f82c50a51353b0513..2a4a64d51cd946fc9915ee3dc8eb427021e773b8 100644 (file)
@@ -89,14 +89,16 @@ static unsigned long p2m_type_to_flags(p2m_type_t t, mfn_t mfn)
     case p2m_ram_paging_in:
     default:
         return flags;
-    case p2m_ram_ro:
     case p2m_grant_map_ro:
+        return flags | P2M_BASE_FLAGS | _PAGE_NX_BIT;
+    case p2m_ram_ro:
     case p2m_ram_logdirty:
     case p2m_ram_shared:
         return flags | P2M_BASE_FLAGS;
     case p2m_ram_rw:
-    case p2m_grant_map_rw:
         return flags | P2M_BASE_FLAGS | _PAGE_RW;
+    case p2m_grant_map_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;