From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: [PATCH] xen: honor _PAGE_NX_BIT Date: Fri, 13 Jul 2012 16:12:03 +0200 Message-ID: <50002CB3.3060704@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060304090603080100050407" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "xen-devel@lists.xen.org" Cc: Tim Deegan List-Id: xen-devel@lists.xenproject.org --------------060304090603080100050407 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit 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 CC: Tim Deegan -- ---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 --------------060304090603080100050407 Content-Type: text/plain; charset="us-ascii"; name="xen_p2m_nx.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_p2m_nx.diff" Content-Description: xen_p2m_nx.diff 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; --------------060304090603080100050407 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --------------060304090603080100050407--