Merge branch 'x86/urgent' into x86/cpu, to resolve conflict
authorIngo Molnar <mingo@kernel.org>
Thu, 11 Apr 2024 12:46:05 +0000 (14:46 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 12 Apr 2024 10:11:45 +0000 (12:11 +0200)
There's a new conflict between this commit pending in x86/cpu:

  63edbaa48a57 x86/cpu/topology: Add support for the AMD 0x80000026 leaf

And these fixes in x86/urgent:

  c064b536a8f9 x86/cpu/amd: Make the NODEID_MSR union actually work
  1b3108f6898e x86/cpu/amd: Make the CPUID 0x80000008 parser correct

Resolve them.

 Conflicts:
arch/x86/kernel/cpu/topology_amd.c

Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
arch/x86/kernel/cpu/amd.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/topology_amd.c

Simple merge
Simple merge
index 6bc44ab32dc4289be0dfb17b1bfd5974ee9579b8,a7aa6eff4ae5ba26206208479f7530721eebda2d..c3a3e9225c46d14b07ad2f6ec41bb87cbfa4085e
@@@ -73,12 -83,14 +83,14 @@@ static bool parse_8000_001e(struct topo
        tscan->c->topo.initial_apicid = leaf.ext_apic_id;
  
        /*
-        * If leaf 0xb is available, then SMT shift is set already. If not
-        * take it from ecx.threads_per_core and use topo_update_dom() -
-        * topology_set_dom() would propagate and overwrite the already
-        * propagated CORE level.
+        * If leaf 0xb is available, then the domain shifts are set
+        * already and nothing to do here.
         */
 -      if (!has_0xb) {
 +      if (!has_topoext) {
+               /*
+                * Leaf 0x80000008 set the CORE domain shift already.
+                * Update the SMT domain, but do not propagate it.
+                */
                unsigned int nthreads = leaf.core_nthreads + 1;
  
                topology_update_dom(tscan, TOPO_SMT_DOMAIN, get_count_order(nthreads), nthreads);
@@@ -135,9 -147,29 +147,29 @@@ static void legacy_set_llc(struct topo_
        tscan->c->topo.llc_id = apicid >> tscan->dom_shifts[TOPO_CORE_DOMAIN];
  }
  
+ static void topoext_fixup(struct topo_scan *tscan)
+ {
+       struct cpuinfo_x86 *c = tscan->c;
+       u64 msrval;
+       /* Try to re-enable TopologyExtensions if switched off by BIOS */
+       if (cpu_has(c, X86_FEATURE_TOPOEXT) || c->x86_vendor != X86_VENDOR_AMD ||
+           c->x86 != 0x15 || c->x86_model < 0x10 || c->x86_model > 0x6f)
+               return;
+       if (msr_set_bit(0xc0011005, 54) <= 0)
+               return;
+       rdmsrl(0xc0011005, msrval);
+       if (msrval & BIT_64(54)) {
+               set_cpu_cap(c, X86_FEATURE_TOPOEXT);
+               pr_info_once(FW_INFO "CPU: Re-enabling disabled Topology Extensions Support.\n");
+       }
+ }
  static void parse_topology_amd(struct topo_scan *tscan)
  {
 -      bool has_0xb = false;
 +      bool has_topoext = false;
  
        /*
         * If the extended topology leaf 0x8000_001e is available