* [PATCH] xen: honor _PAGE_NX_BIT
@ 2012-07-13 14:12 Christoph Egger
2012-07-19 10:12 ` Tim Deegan
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Egger @ 2012-07-13 14:12 UTC (permalink / raw)
To: xen-devel; +Cc: Tim Deegan
[-- Attachment #1: Type: text/plain, Size: 467 bytes --]
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>
CC: Tim Deegan <tim@xen.org>
--
---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
[-- Attachment #2: xen_p2m_nx.diff --]
[-- Type: text/plain, Size: 1138 bytes --]
diff -r c69ef56d8afc xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c Tue Jul 03 11:44:28 2012 +0200
+++ b/xen/arch/x86/mm/p2m-pt.c Fri Jul 13 15:33:58 2012 +0200
@@ -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;
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] xen: honor _PAGE_NX_BIT
2012-07-13 14:12 [PATCH] xen: honor _PAGE_NX_BIT Christoph Egger
@ 2012-07-19 10:12 ` Tim Deegan
0 siblings, 0 replies; 2+ messages in thread
From: Tim Deegan @ 2012-07-19 10:12 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel
At 16:12 +0200 on 13 Jul (1342195923), Christoph Egger wrote:
>
> 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>
> CC: Tim Deegan <tim@xen.org>
Applied, thanks.
Tim.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-19 10:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-13 14:12 [PATCH] xen: honor _PAGE_NX_BIT Christoph Egger
2012-07-19 10:12 ` Tim Deegan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.