Skip to contentSkip to conversation

xc_cpuid_x86.c: Remove the condition for masking NX in vendor specific functions

PATCH New Zhuo Song 1 participant 1 message Sep 5, 2014

lore
Share & tools
lore

Zhuo Song

author
#0 lore raw

PATCH 1/1 xc_cpuid_x86.c: Remove the condition for masking NX in vendor specific functions

Since the architectural logic has help cover it, amd_xc_cpuid_policy and intel_xc_cpuid_policy are unnecessary to do it redundantly.

---
 tools/libxc/xc_cpuid_x86.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/libxc/xc_cpuid_x86.c +2 -2
index 6b81641..9add109 100644
@@ -116,7 +116,7 @@ static void amd_xc_cpuid_policy(
                     bitmaskof(X86_FEATURE_TBM) |
                     bitmaskof(X86_FEATURE_DBEXT));
         regs[3] &= (0x0183f3ff | /* features shared with 0x00000001:EDX */
-                    (is_pae ? bitmaskof(X86_FEATURE_NX) : 0) |
+                    bitmaskof(X86_FEATURE_NX) |
                     (is_64bit ? bitmaskof(X86_FEATURE_LM) : 0) |
                     bitmaskof(X86_FEATURE_SYSCALL) |
                     bitmaskof(X86_FEATURE_MP) |
@@ -201,7 +201,7 @@ static void intel_xc_cpuid_policy(
         regs[2] &= (is_64bit ? bitmaskof(X86_FEATURE_LAHF_LM) : 0) |
                                bitmaskof(X86_FEATURE_3DNOWPREFETCH) |
                                bitmaskof(X86_FEATURE_ABM);
-        regs[3] &= ((is_pae ? bitmaskof(X86_FEATURE_NX) : 0) |
+        regs[3] &= (bitmaskof(X86_FEATURE_NX) |
                     (is_64bit ? bitmaskof(X86_FEATURE_LM) : 0) |
                     (is_64bit ? bitmaskof(X86_FEATURE_SYSCALL) : 0) |
                     (is_64bit ? bitmaskof(X86_FEATURE_RDTSCP) : 0));
Signature · 1 line
1.8.5.2 (Apple Git-48)