]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
x86: query for paddr_bits in early_cpu_detect()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 3 Nov 2015 17:15:58 +0000 (18:15 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 3 Nov 2015 17:15:58 +0000 (18:15 +0100)
It is __read_mostly, so repeatedly writing to it is suboptiomal.  As the
MTRRs have already been set up, nothing good will come from its value
changing across CPUs.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/arch/x86/cpu/common.c

index 02f25046fd1e2a4d2cb39b59307a2da54532fff8..ac8a2582fd61af73627be743bba5166c939714eb 100644 (file)
@@ -207,6 +207,9 @@ static void __init early_cpu_detect(void)
        /* Leaf 0x1 capabilities filled in early for Xen. */
        c->x86_capability[cpufeat_word(X86_FEATURE_FPU)] = cap0;
        c->x86_capability[cpufeat_word(X86_FEATURE_XMM3)] = cap4;
+
+       if ( cpuid_eax(0x80000000) >= 0x80000008 )
+               paddr_bits = cpuid_eax(0x80000008) & 0xff;
 }
 
 static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
@@ -254,8 +257,6 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
                }
                if ( c->extended_cpuid_level >= 0x80000004 )
                        get_model_name(c); /* Default name */
-               if ( c->extended_cpuid_level >= 0x80000008 )
-                       paddr_bits = cpuid_eax(0x80000008) & 0xff;
        }
 
        /* Might lift BIOS max_leaf=3 limit. */