- Update to 3.2-rc6.
[linux-flexiantxendom0-3.2.10.git] / arch / x86 / kernel / cpu / amd.c
index 0bab2b1..d36887e 100644 (file)
@@ -335,7 +335,7 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
 int amd_get_nb_id(int cpu)
 {
        int id = 0;
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && !defined(CONFIG_XEN)
        id = per_cpu(cpu_llc_id, cpu);
 #endif
        return id;
@@ -462,7 +462,7 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
                    (c->x86_model == 8 && c->x86_mask >= 8))
                        set_cpu_cap(c, X86_FEATURE_K6_MTRR);
 #endif
-#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI)
+#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI) && !defined(CONFIG_XEN)
        /* check CPU config space for extended APIC ID */
        if (cpu_has_apic && c->x86 >= 0xf) {
                unsigned int val;
@@ -520,18 +520,26 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
                        u64 val;
 
                        clear_cpu_cap(c, X86_FEATURE_LAHF_LM);
+#ifndef CONFIG_XEN
                        if (!rdmsrl_amd_safe(0xc001100d, &val)) {
                                val &= ~(1ULL << 32);
                                wrmsrl_amd_safe(0xc001100d, val);
                        }
+#else
+                       pr_warning("Long-mode LAHF feature wrongly enabled -"
+                                  "hypervisor update needed\n");
+                       (void)&val;
+#endif
                }
 
        }
        if (c->x86 >= 0x10)
                set_cpu_cap(c, X86_FEATURE_REP_GOOD);
 
+#ifndef CONFIG_XEN
        /* get apicid instead of initial apic id from cpuid */
        c->apicid = hard_smp_processor_id();
+#endif
 #else
 
        /*
@@ -607,6 +615,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
                fam10h_check_enable_mmcfg();
        }
 
+#ifndef CONFIG_XEN
        if (c == &boot_cpu_data && c->x86 >= 0xf) {
                unsigned long long tseg;
 
@@ -626,6 +635,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
                }
        }
 #endif
+#endif
 
        /*
         * Family 0x12 and above processors have APIC timer