Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6539430ybx; Mon, 11 Nov 2019 10:36:50 -0800 (PST) X-Google-Smtp-Source: APXvYqwPFTSi55A25iCy+ry9YEsu+ZJslemvq5zJY6ounSOS8nb6d1S6iwhxr5dzuU2F4WoGyFNL X-Received: by 2002:a17:906:2552:: with SMTP id j18mr24703697ejb.244.1573497410000; Mon, 11 Nov 2019 10:36:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573497409; cv=none; d=google.com; s=arc-20160816; b=cjk8wDEfenUqNL2mTsHoB24wP08sBrs1jwrnSLOCZIhE1k/UrrgbGRcEW+Llhp5p5v nQ2ENlfFAzCde5upBgULCrhQ5q7bmQAwFHZSSoar3piIFTxUg/C2D0lJ6JQyZEum3u9b n1qeszjBEz7BkiRT5XZkBIe3vgSlhif5w+S0AE4wJ+r1yNLtB43FV8tL/8ajHcl3p44E F35zIG2CjlV/s8BqLBsSXSOv8uioPTqptaWiL30eTNlCWNwL1iPu3SNQroblLEoPMOap 4vcKOSE2Ty1lNjFBKPxjYHK1yo+pinqVIIEiIQRKZ5nSVvtd/rAXIhtA0uZosLfS/bPl z3Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XhlUcm7x7a+z833UOMdrY5rcaiUzvNuUx5DfBcFrF9g=; b=o13q/XsVIlplfqQ4cLWRUozDb6ZM0kkiuN4cfnk3P4mDiksbiOgZWw2FLnA8kglu0B 2SHnBvf9wAcWG+RKTeyV2w+bwdNo5KItsWcMwOU6SuOrmsyn1P77+hkTOdjTlloDCJND G3aQoD0ikd0lJhp8AmTnnQdxpBcb6u4+AW8xd6/ogAldkjExKtlqQZW0durm0crcdCYl LPqU0z7H5Tq+Ty2pm7lPAmMbrGPHncG56vHFSl9MoPPHM8+LepQyVh6Th1fXWOx8Dzya W6Qy943tzEfwsSZz8Qv9iVy4lj/Yq0LR2bRRSI3Qc555W9ruuKhLeNktqNZDx4HXWQ9t nILA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=StMnC53P; 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 t22si8981754ejx.194.2019.11.11.10.36.25; Mon, 11 Nov 2019 10:36:49 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=StMnC53P; 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 S1728342AbfKKSe3 (ORCPT + 99 others); Mon, 11 Nov 2019 13:34:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:52118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728329AbfKKSe1 (ORCPT ); Mon, 11 Nov 2019 13:34:27 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6A51620656; Mon, 11 Nov 2019 18:34:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497266; bh=uY80i+jlOZsBokQ1P1ssPAkqmmX60ZRlhuntTa2253g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=StMnC53PISJ3FwfqZxvEfDrKI/YG1E58KyjdjVY9esYvZXIwj6CuAsdA2T+SjNJIb dI1TzrgIV/o6Xndz/+tH3xZ50Cb9GPVoZKMlgr7LCrFZ0DdjX/oaVU4uzlbTmWGLZY SVnHbU8Fpr14dX+vHeGY0ylMrEV2zzx8Cexd72hY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dou Liyang , Thomas Gleixner , andy.shevchenko@gmail.com, bhe@redhat.com, ebiederm@xmission.com, Sasha Levin Subject: [PATCH 4.9 61/65] x86/apic: Drop logical_smp_processor_id() inline Date: Mon, 11 Nov 2019 19:29:01 +0100 Message-Id: <20191111181355.808660229@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181331.917659011@linuxfoundation.org> References: <20191111181331.917659011@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dou Liyang [ Upstream commit 8f1561680f42a5491b371b513f1ab8197f31fd62 ] The logical_smp_processor_id() inline which is only called in setup_local_APIC() on x86_32 systems has no real value. Drop it and directly use GET_APIC_LOGICAL_ID() at the call site and use a more suitable variable name for readability Signed-off-by: Dou Liyang Signed-off-by: Thomas Gleixner Cc: andy.shevchenko@gmail.com Cc: bhe@redhat.com Cc: ebiederm@xmission.com Link: https://lkml.kernel.org/r/20180301055930.2396-4-douly.fnst@cn.fujitsu.com Signed-off-by: Sasha Levin --- arch/x86/include/asm/smp.h | 10 ---------- arch/x86/kernel/apic/apic.c | 10 +++++----- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index d25fb6beb2f0c..dcaf7100b69c2 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h @@ -177,16 +177,6 @@ extern int safe_smp_processor_id(void); #endif #ifdef CONFIG_X86_LOCAL_APIC - -#ifndef CONFIG_X86_64 -static inline int logical_smp_processor_id(void) -{ - /* we don't want to mark this access volatile - bad code generation */ - return GET_APIC_LOGICAL_ID(apic_read(APIC_LDR)); -} - -#endif - extern int hard_smp_processor_id(void); #else /* CONFIG_X86_LOCAL_APIC */ diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 264daf1f49915..ad2a220a4a7f7 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1342,7 +1342,7 @@ void setup_local_APIC(void) int cpu = smp_processor_id(); unsigned int value; #ifdef CONFIG_X86_32 - int i; + int logical_apicid, ldr_apicid; #endif @@ -1389,11 +1389,11 @@ void setup_local_APIC(void) * initialized during get_smp_config(), make sure it matches the * actual value. */ - i = early_per_cpu(x86_cpu_to_logical_apicid, cpu); - WARN_ON(i != BAD_APICID && i != logical_smp_processor_id()); + logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu); + ldr_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR)); + WARN_ON(logical_apicid != BAD_APICID && logical_apicid != ldr_apicid); /* always use the value from LDR */ - early_per_cpu(x86_cpu_to_logical_apicid, cpu) = - logical_smp_processor_id(); + early_per_cpu(x86_cpu_to_logical_apicid, cpu) = ldr_apicid; #endif /* -- 2.20.1