Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2544030imm; Sat, 12 May 2018 14:13:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr0uFVjzF6M8YT1fqBIobHIndLiGBBQTYRfLhcbzwmXJ2O4K3YJvXjQ2luFYwzptpWxRrt9 X-Received: by 2002:a63:6f46:: with SMTP id k67-v6mr3649322pgc.303.1526159594111; Sat, 12 May 2018 14:13:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526159594; cv=none; d=google.com; s=arc-20160816; b=AY9MuwCtYmFBfS1RahV1pYLS8X0dckALQoCmi9SvnetZmXXpnRP+cM+orUK7lqSK55 JO9vt4sb/U0NcRLqVBbw5CORgLpFKkmBQH0yT0dixgeMsKpW21pKuIHHvWDH2OrpPbKy GJgBC2D76f1OBuS+mBO/CS+99gaMKKwvUXS7U2G4E1lQtk32MYKttrqsbL8Rr4P3nCJ6 0U2H0F4L1742hLKIqSizgH/nko+2F1USShKG9136coGUKNLCkAy+1Y0kBgoziX/KsuWu 6g7uOz7EEcpTVfOxr4PF6Al/4WLxfidbsdkmacDtRyNbJjSXR/AIxCSTYLzDDEkPTk5W show== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=iREBZzoOsD5DZtWaOX9/dZNyLATRT9D9auZ6vSAt/iU=; b=gQb85/DOQnosEg98fBB1jIe5c3nEquD2bTZx1hNHftWkEKOGzJMCVPkCNHX0NVqlHl SI5FwuIXnCKa3OVbSbwotBuHQ1cZXNw4BAi5X2q2Ca/qWAlsHvxKf2g5o9jJJTu1wgpk JU2WZxHAvtfgHPYxKAdoksqamy4gwi+ksIbedWZ9Algiwx7IMxR959nSHjc2XK7kqbgN dJQukp6twJzdHAh4X4KCVx/jDudvGiVS7wxXToiUj5sUg5g/VaNslFUuU3ICq67Ad8An 20NLzztFBXUsHP2pYsQEfAHul8FWIf1O4eRTDyEIgvtEdN+JfplfH0jlFmhwvdKs5VBC Eheg== 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 o12-v6si5043116pgc.515.2018.05.12.14.12.59; Sat, 12 May 2018 14:13:14 -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 S1752046AbeELVMD (ORCPT + 99 others); Sat, 12 May 2018 17:12:03 -0400 Received: from terminus.zytor.com ([198.137.202.136]:49797 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751806AbeELVMC (ORCPT ); Sat, 12 May 2018 17:12:02 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w4CLBsOm096179 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 12 May 2018 14:11:54 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w4CLBsti096176; Sat, 12 May 2018 14:11:54 -0700 Date: Sat, 12 May 2018 14:11:54 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Suravee Suthikulpanit Message-ID: Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, suravee.suthikulpanit@amd.com, mingo@kernel.org, tglx@linutronix.de, bp@suse.de Reply-To: bp@suse.de, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, suravee.suthikulpanit@amd.com In-Reply-To: <1524865681-112110-2-git-send-email-suravee.suthikulpanit@amd.com> References: <1524865681-112110-2-git-send-email-suravee.suthikulpanit@amd.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cpu] x86/CPU: Modify detect_extended_topology() to return result Git-Commit-ID: 6c4f5abaf3566dbf5b26e7b14f4392be400f12e3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 6c4f5abaf3566dbf5b26e7b14f4392be400f12e3 Gitweb: https://git.kernel.org/tip/6c4f5abaf3566dbf5b26e7b14f4392be400f12e3 Author: Suravee Suthikulpanit AuthorDate: Fri, 27 Apr 2018 16:48:00 -0500 Committer: Thomas Gleixner CommitDate: Sun, 6 May 2018 12:49:16 +0200 x86/CPU: Modify detect_extended_topology() to return result Current implementation does not communicate whether it can successfully detect CPUID function 0xB information. Therefore, modify the function to return success or error codes. This will be used by subsequent patches. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Reviewed-by: Borislav Petkov Link: http://lkml.kernel.org/r/1524865681-112110-2-git-send-email-suravee.suthikulpanit@amd.com --- arch/x86/include/asm/processor.h | 2 +- arch/x86/kernel/cpu/topology.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 4fa4206029e3..7aa2caa82b2d 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -193,7 +193,7 @@ extern u32 get_scattered_cpuid_leaf(unsigned int level, extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); extern void init_amd_cacheinfo(struct cpuinfo_x86 *c); -extern void detect_extended_topology(struct cpuinfo_x86 *c); +extern int detect_extended_topology(struct cpuinfo_x86 *c); extern void detect_ht(struct cpuinfo_x86 *c); #ifdef CONFIG_X86_32 diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c index b099024d339c..81c0afb39d0a 100644 --- a/arch/x86/kernel/cpu/topology.c +++ b/arch/x86/kernel/cpu/topology.c @@ -27,7 +27,7 @@ * exists, use it for populating initial_apicid and cpu topology * detection. */ -void detect_extended_topology(struct cpuinfo_x86 *c) +int detect_extended_topology(struct cpuinfo_x86 *c) { #ifdef CONFIG_SMP unsigned int eax, ebx, ecx, edx, sub_index; @@ -36,7 +36,7 @@ void detect_extended_topology(struct cpuinfo_x86 *c) static bool printed; if (c->cpuid_level < 0xb) - return; + return -1; cpuid_count(0xb, SMT_LEVEL, &eax, &ebx, &ecx, &edx); @@ -44,7 +44,7 @@ void detect_extended_topology(struct cpuinfo_x86 *c) * check if the cpuid leaf 0xb is actually implemented. */ if (ebx == 0 || (LEAFB_SUBTYPE(ecx) != SMT_TYPE)) - return; + return -1; set_cpu_cap(c, X86_FEATURE_XTOPOLOGY); @@ -95,6 +95,6 @@ void detect_extended_topology(struct cpuinfo_x86 *c) c->cpu_core_id); printed = 1; } - return; #endif + return 0; }