Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4794714ooa; Tue, 14 Aug 2018 10:38:44 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzMLnw09J8dbrqIoL32j3BA/ouzY1gyZ7U8PGwYGxo/EUzMgLt38hhWsNEHili5FeQfGEZF X-Received: by 2002:a63:7b1b:: with SMTP id w27-v6mr21140069pgc.199.1534268324341; Tue, 14 Aug 2018 10:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534268324; cv=none; d=google.com; s=arc-20160816; b=IOFJYikccMTpcfqsIDEVnFPX9lNYYUkvfyylyA6oCk5nI3E7i8THeboaGd4kEYtFny jcPbv/KB6JeICZMz6g5xi6R0YIrtINNjxZrYilNv42+detyhgVQ8yCADc8p+KgdnEdcN 0Q7CSI0t8fe6PDT4GibSghR/O3YxbHd7XttPkk/X2tosbXOzoVp3otkibSNP3/i2fxfh vogSr6m+gE2hBitcyqSNfWmkv64X2Zb/nIt/22vConAWZm4XGxbOznfTXTZX2jeeT4CK B5j4UIUkVzeLjR9QtYTvQhDktgBhoFx7RFkzgsOqBIS4v7aaF18bC6WAAtfZRpJ7qjjU L00A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=1VfV9kfwH9JqXBtlPm27pSPInLFy6HS4uSuIDoQFwkk=; b=Dar/FM7utLe1y+jgEQeVuTmZ4XZkMRcNKmV+/PXnerTW4BZbwN8Kl9k18Z2XnghJbI 3r8r7tmcXHMWlraaHKV1SW+0f3v+VaS0Prv+FbZJhVU63Y0E8nIWAaURgci002yDujkn kAoXChD8p0k5g7HU2RE8eTcQJ//OsF9b7OxxR+zkN3B3R3eSpIBMzI6HEdo2LqOVFHRI vLeDnVq1dUaIdBUZrbbe+blu1fA7XG34qlXYuNJknwU3zj03BwLmtlk5hqk/xKSQvelx vrzakbW+FbH048wEMdWqvZgP4RYIhsUdxLxVwMm0l/vQZWLnNeylzGWiqM7xz9rpyWb8 w2Lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f62-v6si23810210pfb.218.2018.08.14.10.38.29; Tue, 14 Aug 2018 10:38:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729940AbeHNUXr (ORCPT + 99 others); Tue, 14 Aug 2018 16:23:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57308 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729893AbeHNUXr (ORCPT ); Tue, 14 Aug 2018 16:23:47 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1A42EDDE; Tue, 14 Aug 2018 17:35:37 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , Ingo Molnar Subject: [PATCH 4.14 047/104] x86/cpu/AMD: Evaluate smp_num_siblings early Date: Tue, 14 Aug 2018 19:17:01 +0200 Message-Id: <20180814171518.389138668@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180814171515.270692185@linuxfoundation.org> References: <20180814171515.270692185@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Gleixner commit 1e1d7e25fd759eddf96d8ab39d0a90a1979b2d8c upstream To support force disabling of SMT it's required to know the number of thread siblings early. amd_get_topology() cannot be called before the APIC driver is selected, so split out the part which initializes smp_num_siblings and invoke it from amd_early_init(). Signed-off-by: Thomas Gleixner Acked-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/amd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -315,6 +315,17 @@ static void legacy_fixup_core_id(struct c->cpu_core_id %= cus_per_node; } + +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; + } +} + /* * Fixup core topology information for * (1) AMD multi-node processors @@ -668,6 +679,8 @@ static void early_init_amd(struct cpuinf clear_cpu_cap(c, X86_FEATURE_SME); } } + + amd_get_topology_early(c); } static void init_amd_k8(struct cpuinfo_x86 *c)