[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86: query for paddr_bits in early_cpu_detect()



commit 32b31c17da1ba0da970cd182a8865ac20fabd0fa
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Tue Nov 3 18:15:58 2015 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Nov 3 18:15:58 2015 +0100

    x86: query for paddr_bits in early_cpu_detect()
    
    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@xxxxxxxxxx>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 xen/arch/x86/cpu/common.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 02f2504..ac8a258 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -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. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.