Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 15 Jun 2018 19:03:17 -0000 Received: from mx2.suse.de ([195.135.220.15]) by Galois.linutronix.de with esmtps (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1fTtzM-0005Zf-9G for speck@linutronix.de; Fri, 15 Jun 2018 21:02:26 +0200 Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D266BAEF2 for ; Fri, 15 Jun 2018 19:02:18 +0000 (UTC) Date: Fri, 15 Jun 2018 21:02:14 +0200 From: Borislav Petkov Subject: [MODERATED] Re: Re: [patch V3 11/12] x86/cpu/AMD: Evaluate smp_num_siblings early Message-ID: <20180615190213.GC15584@zn.tnic> References: <20180615162801.748896789@linutronix.de> <20180615162948.360372614@linutronix.de> <5a9c93a5-a9dd-6b19-f719-49a343898845@citrix.com> <20180615174727.GB15584@zn.tnic> MIME-Version: 1.0 In-Reply-To: <20180615174727.GB15584@zn.tnic> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: speck@linutronix.de List-ID: On Fri, Jun 15, 2018 at 07:47:27PM +0200, Borislav Petkov wrote: > On Fri, Jun 15, 2018 at 07:30:49PM +0200, speck for Thomas Gleixner wrote: > > Duh, That's what you get for blind copy and paste. That obviously want's = to > > be fixed in the existing code first. Boris? >=20 > There's an innacuracy in the docs, lemme clarify that first and will get > back to you. So I *think* that you can access leaf 0x8000001e when X86_FEATURE_TOPOEXT is present but lemme confirm that first. Also, we can do the following (I'd need to audit it again and test it but from staring at it so far, this is old remnant where it used to read out CPUID_Fn80000008_ECX[NC] and those functions don't do that now - early_init_amd_mc() does.) --- From: Borislav Petkov Date: Fri, 15 Jun 2018 20:48:39 +0200 Subject: [PATCH] x86/CPU/AMD: Do not check CPUID max ext level before parsing SMP info Old code used to check whether CPUID ext max level is >=3D 0x80000008 because that last leaf contains the number of cores of the physical CPU. The three functions called there now do not depend on that leaf anymore so the check can go. Signed-off-by: Borislav Petkov --- arch/x86/kernel/cpu/amd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 082d7875cef8..9493e865588a 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -848,12 +848,9 @@ static void init_amd(struct cpuinfo_x86 *c) =20 cpu_detect_cache_sizes(c); =20 - /* Multi core CPU? */ - if (c->extended_cpuid_level >=3D 0x80000008) { - amd_detect_cmp(c); - amd_get_topology(c); - srat_detect_node(c); - } + amd_detect_cmp(c); + amd_get_topology(c); + srat_detect_node(c); =20 #ifdef CONFIG_X86_32 detect_ht(c); --=20 2.17.0.582.gccdcbd54c SUSE Linux GmbH, GF: Felix Imend=C3=B6rffer, Jane Smithard, Graham Norton, HR= B 21284 (AG N=C3=BCrnberg) --=20