From: Karen White Subject: x86_64/page.h L1_DISALLOW_MASK, etc Date: Mon, 28 Mar 2005 18:15:08 -0600 Message-ID: <1112055308.21025.21.camel@kwdevel.austin.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-SpsXsbG6Vp7NpjDOD3Td" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-SpsXsbG6Vp7NpjDOD3Td Content-Type: text/plain Content-Transfer-Encoding: 7bit In xen/include/asm-x86/x86_64/page.h, it appears the #defines for L1_DISALLOW_MASK, L2_DISALLOW_MASK, etc. have the assignment backwards in the conditional test. The current code appears to be setting the NX bit if the cpu does not have the NX feature, as opposed to if it does. I have attached a patch of how I would change it to see if others agree. Also, what exactly is being set when setting the 3 bits for the L2_DISALLOW_MASK, L3_DISALLOW_MASK, and L4_DISALLOW_MASK definitions? Karen --=-SpsXsbG6Vp7NpjDOD3Td Content-Disposition: attachment; filename=page.disallow.patch Content-Type: text/x-patch; name=page.disallow.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit --- xen.orig/include/asm-x86/x86_64/page.h 2005-03-23 17:43:41.000000000 -0600 +++ xen/include/asm-x86/x86_64/page.h 2005-03-28 17:52:40.446429192 -0600 @@ -93,10 +93,11 @@ typedef l4_pgentry_t root_pgentry_t; #define _PAGE_NX (cpu_has_nx ? (1UL<<63) : 0UL) -#define L1_DISALLOW_MASK ((cpu_has_nx?0:(1UL<<63)) | (3UL << 7)) -#define L2_DISALLOW_MASK ((cpu_has_nx?0:(1UL<<63)) | (7UL << 7)) -#define L3_DISALLOW_MASK ((cpu_has_nx?0:(1UL<<63)) | (7UL << 7)) -#define L4_DISALLOW_MASK ((cpu_has_nx?0:(1UL<<63)) | (7UL << 7)) +#define L1_DISALLOW_MASK ((cpu_has_nx?(1UL<<63):0) | (3UL << 7)) +#define L2_DISALLOW_MASK ((cpu_has_nx?(1UL<<63):0) | (7UL << 7)) +#define L3_DISALLOW_MASK ((cpu_has_nx?(1UL<<63):0) | (7UL << 7)) +#define L4_DISALLOW_MASK ((cpu_has_nx?(1UL<<63):0) | (7UL << 7)) + #endif /* __X86_64_PAGE_H__ */ --=-SpsXsbG6Vp7NpjDOD3Td 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.xensource.com http://lists.xensource.com/xen-devel --=-SpsXsbG6Vp7NpjDOD3Td--