All of lore.kernel.org
 help / color / mirror / Atom feed
* L!TF Bulletin: The state of the horrors
@ 2018-06-21 15:33 Thomas Gleixner
  2018-06-22 12:24 ` [MODERATED] " Borislav Petkov
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2018-06-21 15:33 UTC (permalink / raw)
  To: speck

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

Hi!

I've updated the repository (master branch and the 4.17/16/14.y stable
branches) with the following items:

     - The 1/6 patch from Konrad fixing the pr_fmt issue in bugs.c

     - The swap size fix from Vlastimil

     - The SMT control knob series with a few tweaks as discussed on the
       list

     - The 2/6 patch from Konrad adding the L1D_FLUSH cpu feature

Find the latest L!TF combo bundle based on 4.18-rc1 attached.

Thanks,

	tglx

[-- Attachment #2: Type: application/octet-stream, Size: 37162 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [MODERATED] Re: L!TF Bulletin: The state of the horrors
  2018-06-21 15:33 L!TF Bulletin: The state of the horrors Thomas Gleixner
@ 2018-06-22 12:24 ` Borislav Petkov
  2018-06-22 13:37   ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Borislav Petkov @ 2018-06-22 12:24 UTC (permalink / raw)
  To: speck

On Thu, Jun 21, 2018 at 05:33:28PM +0200, speck for Thomas Gleixner wrote:
> Hi!
> 
> I've updated the repository (master branch and the 4.17/16/14.y stable
> branches) with the following items:
> 
>      - The 1/6 patch from Konrad fixing the pr_fmt issue in bugs.c
> 
>      - The swap size fix from Vlastimil
> 
>      - The SMT control knob series with a few tweaks as discussed on the
>        list
> 
>      - The 2/6 patch from Konrad adding the L1D_FLUSH cpu feature
> 
> Find the latest L!TF combo bundle based on 4.18-rc1 attached.

One more ontop, as we talked on IRC:

---
From: Borislav Petkov <bp@suse.de>
Date: Fri, 22 Jun 2018 11:34:11 +0200
Subject: [PATCH] x86/CPU/AMD: Move TOPOEXT reenablement before reading smp_num_siblings

The TOPOEXT reenablement is a workaround for broken BIOSen which didn't
enable the CPUID bit. amd_get_topology_early(), however, relies on
that bit being set so that it can read out the CPUID leaf and set
smp_num_siblings properly.

Move the reenablement up to early_init_amd(). While at it, simplify
amd_get_topology_early().

Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/kernel/cpu/amd.c | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index b20dee982a53..74061e421e62 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -318,12 +318,8 @@ static void legacy_fixup_core_id(struct cpuinfo_x86 *c)
 
 static void amd_get_topology_early(struct cpuinfo_x86 *c)
 {
-	if (boot_cpu_has(X86_FEATURE_TOPOEXT)) {
-		u32 eax, ebx, ecx, edx;
-
-		cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
-		smp_num_siblings = ((ebx >> 8) & 0xff) + 1;
-	}
+	if (cpu_has(c, X86_FEATURE_TOPOEXT))
+		smp_num_siblings = ((cpuid_ebx(0x8000001e) >> 8) & 0xff) + 1;
 }
 
 /*
@@ -345,7 +341,6 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
 		cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
 
 		node_id  = ecx & 0xff;
-		smp_num_siblings = ((ebx >> 8) & 0xff) + 1;
 
 		if (c->x86 == 0x15)
 			c->cu_id = ebx & 0xff;
@@ -622,6 +617,7 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)
 
 static void early_init_amd(struct cpuinfo_x86 *c)
 {
+	u64 value;
 	u32 dummy;
 
 	early_init_amd_mc(c);
@@ -693,6 +689,20 @@ static void early_init_amd(struct cpuinfo_x86 *c)
 
 	early_detect_mem_encrypt(c);
 
+	/* Re-enable TopologyExtensions if switched off by BIOS */
+	if (c->x86 == 0x15 &&
+	    (c->x86_model >= 0x10 && c->x86_model <= 0x6f) &&
+	    !cpu_has(c, X86_FEATURE_TOPOEXT)) {
+
+		if (msr_set_bit(0xc0011005, 54) > 0) {
+			rdmsrl(0xc0011005, value);
+			if (value & BIT_64(54)) {
+				set_cpu_cap(c, X86_FEATURE_TOPOEXT);
+				pr_info_once(FW_INFO "CPU: Re-enabling disabled Topology Extensions Support.\n");
+			}
+		}
+	}
+
 	amd_get_topology_early(c);
 }
 
@@ -785,19 +795,6 @@ static void init_amd_bd(struct cpuinfo_x86 *c)
 {
 	u64 value;
 
-	/* re-enable TopologyExtensions if switched off by BIOS */
-	if ((c->x86_model >= 0x10) && (c->x86_model <= 0x6f) &&
-	    !cpu_has(c, X86_FEATURE_TOPOEXT)) {
-
-		if (msr_set_bit(0xc0011005, 54) > 0) {
-			rdmsrl(0xc0011005, value);
-			if (value & BIT_64(54)) {
-				set_cpu_cap(c, X86_FEATURE_TOPOEXT);
-				pr_info_once(FW_INFO "CPU: Re-enabling disabled Topology Extensions Support.\n");
-			}
-		}
-	}
-
 	/*
 	 * The way access filter has a performance penalty on some workloads.
 	 * Disable it on the affected CPUs.
-- 
2.17.0.582.gccdcbd54c

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: L!TF Bulletin: The state of the horrors
  2018-06-22 12:24 ` [MODERATED] " Borislav Petkov
@ 2018-06-22 13:37   ` Thomas Gleixner
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2018-06-22 13:37 UTC (permalink / raw)
  To: speck

On Fri, 22 Jun 2018, speck for Borislav Petkov wrote:
> One more ontop, as we talked on IRC:
> 
> ---
> From: Borislav Petkov <bp@suse.de>
> Date: Fri, 22 Jun 2018 11:34:11 +0200
> Subject: [PATCH] x86/CPU/AMD: Move TOPOEXT reenablement before reading smp_num_siblings
> 
> The TOPOEXT reenablement is a workaround for broken BIOSen which didn't
> enable the CPUID bit. amd_get_topology_early(), however, relies on
> that bit being set so that it can read out the CPUID leaf and set
> smp_num_siblings properly.
> 
> Move the reenablement up to early_init_amd(). While at it, simplify
> amd_get_topology_early().

Applied to all branches and pushed out.

Thanks

	tglx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-22 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-21 15:33 L!TF Bulletin: The state of the horrors Thomas Gleixner
2018-06-22 12:24 ` [MODERATED] " Borislav Petkov
2018-06-22 13:37   ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.