Skip to contentSkip to conversation

libxc: Turn on the pdpe1gb cpuid flag by default

PATCH In review Li Liang 2 participants 2 messages Nov 13, 2014

lore
Share & tools
lore

Li Liang

author
#0 lore raw

PATCH 1/1 libxc: Turn on the pdpe1gb cpuid flag by default

Now it's no need to set the "cpuid= " option in the config file to expose the 1GB hugepage feature to guest.

---
 tools/libxc/xc_cpuid_x86.c | 1 +
 1 file changed, 1 insertion(+)
tools/libxc/xc_cpuid_x86.c +1 -0
index a18b1ff..561c5b5 100644
@@ -192,6 +192,7 @@ static void intel_xc_cpuid_policy(
                     bitmaskof(X86_FEATURE_ABM));
         regs[3] &= (bitmaskof(X86_FEATURE_NX) |
                     bitmaskof(X86_FEATURE_LM) |
+                    bitmaskof(X86_FEATURE_PAGE1GB) |
                     bitmaskof(X86_FEATURE_SYSCALL) |
                     bitmaskof(X86_FEATURE_RDTSCP));
         break;
Signature · 1 line
1.9.1
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line · On 13.11.14 at 06:31, <[email protected]> wrote:

Apart from the subject being kind of wrong (you're not turning it on by default, but only expose it if the hardware supports it), ...

tools/libxc/xc_cpuid_x86.c static void intel_xc_cpuid_policy( · line 198

Quoted 10 lines
tools/libxc/xc_cpuid_x86.c +1 -0
@@ -192,6 +192,7 @@ static void intel_xc_cpuid_policy(
                     bitmaskof(X86_FEATURE_ABM));
         regs[3] &= (bitmaskof(X86_FEATURE_NX) |
                     bitmaskof(X86_FEATURE_LM) |
+                    bitmaskof(X86_FEATURE_PAGE1GB) |
                     bitmaskof(X86_FEATURE_SYSCALL) |
                     bitmaskof(X86_FEATURE_RDTSCP));
         break;

... this is incomplete: The AMD function would seem to need the same change, and the !PAE special casing in xc_cpuid_hvm_policy() should imo disable the flag.

Jan