From patchwork Fri Feb 16 15:17:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 202176 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp586959dyb; Fri, 16 Feb 2024 07:24:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWxNd61SVuu+9KGLDylsPSQ6bjbE44DrDF4MUu9o4lYN+z6tcrocFaNLeAQ6Ru+dw9TkmitJSSyI4CtenQGCYBVz7et1w== X-Google-Smtp-Source: AGHT+IEErYDW6H791nPWJLQwEMX+jKZNyqp+qZ57lTy0le3XxHnWPw8gIrbf2rJxJE1twANoXC3b X-Received: by 2002:a17:90a:cb87:b0:298:dde2:cce with SMTP id a7-20020a17090acb8700b00298dde20ccemr4755556pju.40.1708097042044; Fri, 16 Feb 2024 07:24:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708097042; cv=pass; d=google.com; s=arc-20160816; b=TsuzELotlXJlzIE3Ih/jNuXkeCX53e6FD911YBldufOkf2/UoEVwOZXqicCHZxMGPc TzsxsOsl7ehipH0pOvljREtNEh/Lm6BBwu+zr0tB7lthe4VmmEYSQX8tjzRBzRCnGgvI 3XjKB6olHRnIZs3gAfBs3tcI3P1be/xhkVcJEbHpwG+cOJrPfaUXn423rJWw7lB2VU/T quvLU+z3zoG/qsudNI2eaUSsq5QSZzdNgV4HEjvKXYohRGp1/SulcHNUCOi1n+pCI/ns Tci5hYG7C895Ilp+6r9UOArBrpBJyey9zNAkjdTBWSXFvxooHYPuQHMshMtPxMzOxRqT LJNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=Dvip3UNsyz5614co79jTNwLUOGvG2mP7TOXQ4IpY+U8=; fh=HfXWoIhgCc+vt39DMIJv/Ec0aAKnw0eFA8QxuIQTUoQ=; b=UvLfA5aAwxxOkMReVhDzIxl4xpK7sJJL0gvRMYc/7j7q0hLnf5dMl95HCo2qL7Df2s CQQ9A1ccUvmwqA8rbCsvSWTgVZoNHAqL+sFgnrfMsulbMqjmnR7NVr/Pzd5k33O++ge8 ixbmzi2iwYtjXDsal6oWHocqPocgTf8Ir5TLXZ02U3m0w6FxBXaoTB75UoarVENWricX prPaCSgK+mZQaOUQm/wDpfBZglOMW6MaRN/LLeCii6kri13oOnUaaC2vnfRBgeuPVqZD UVFv9FfGb3Du4YYYflJYVISu1CrfwyHVUlbKRuP/7Q+MXyUJ47wkTm0LxoQYSmpRZxMS v50A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ub4Q9Ypx; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=xkQ6j5gu; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-68822-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68822-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id na15-20020a17090b4c0f00b002992279bb11si109562pjb.10.2024.02.16.07.24.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 07:24:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68822-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ub4Q9Ypx; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=xkQ6j5gu; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-68822-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68822-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6547B282A58 for ; Fri, 16 Feb 2024 15:23:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 439DE14830C; Fri, 16 Feb 2024 15:17:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ub4Q9Ypx"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xkQ6j5gu" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5C0013DB92; Fri, 16 Feb 2024 15:17:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096635; cv=none; b=G/Y7iZBo8PbUydGxq1IUEcYhv7dTep7cQ9Gpkn5+N+vz67xN2BbhJ0UCEPZkjzd8sOh/p+RHnhEzWmfd8ih+5yuuoPtXEZFtlFD2vqUCa7qcgaRpjvYSf8iwBFKAuQ9A3KFMlsQwr6I8osJ8swoy0OfdCQVPcAey6YH/4vCXoII= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096635; c=relaxed/simple; bh=nDlE4X0ng9q7iOe7i+g9avJ6X54ZJIGug0xn+B6kq7w=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=g+nEQYaLNZHns/l4nNFEZFqEg3SYH9VfHif86PL46IE5pxz7tCegHx4t5pUtl7GAviWieZzAr+lfil7mQcNjBOoFiS8iYGCD1YAqt+QiGxMx9KqJfO95xUnqRZYXM8YfUbv5b/J1z2dJeZsTXD1bc4anri+mgh445947GZ3Il3s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ub4Q9Ypx; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=xkQ6j5gu; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Fri, 16 Feb 2024 15:17:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708096632; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dvip3UNsyz5614co79jTNwLUOGvG2mP7TOXQ4IpY+U8=; b=ub4Q9YpxQ/Unljcl7ElrCNw4aZf7FCkqaDs3zVLZ5m8MuRp2VB3tvDcRe9ZmIEyUhEIWaO yYC9uN7Lxg0l8nWbqu+9iA9p+qWmcK7qfcgbE/Klm7isR83Y8c3hBypqzO0Ho/saKdzYnh pDK0bRtrqmszadE+gALL5oxxzEQm19PCCa12QSOSr2IpeiGOTMoE/C4MVdHS33t5X6cyTg LS1VXFchTs/GQYBakU/N8DjzKvhc0ZTM5N2z3LoRqyw0N2Wv6pYzBHbSPMwlSS/kHW0/k5 8/KtL/Sm/VwZ9o9sUTRUUupLHBJV9Asy43d8sW1Hg+l1/A2ct1gUa4pU1+sffA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708096632; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dvip3UNsyz5614co79jTNwLUOGvG2mP7TOXQ4IpY+U8=; b=xkQ6j5guakMEyO39NQsksI4lrHFlcz0Q9H3XFwQ798bsTPofXfTmMJvNgg87t2ykm/X8tg hHp4oh6SEhuY9ZDg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/apic] x86/apic: Remove the pointless writeback of boot_cpu_physical_apicid Cc: Thomas Gleixner , Michael Kelley , Sohil Mehta , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240212154640.055288922@linutronix.de> References: <20240212154640.055288922@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170809663172.398.2589362385322757454.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790819959973144656 X-GMAIL-MSGID: 1791069564152539518 The following commit has been merged into the x86/apic branch of tip: Commit-ID: 58d16928358f91d48421838a7484321b3149130d Gitweb: https://git.kernel.org/tip/58d16928358f91d48421838a7484321b3149130d Author: Thomas Gleixner AuthorDate: Tue, 13 Feb 2024 22:05:19 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 15 Feb 2024 22:07:41 +01:00 x86/apic: Remove the pointless writeback of boot_cpu_physical_apicid There is absolutely no point to write the APIC ID which was read from the local APIC earlier, back into the local APIC for the 64-bit UP case. Remove that along with the apic callback which is solely there for this pointless exercise. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Sohil Mehta Link: https://lore.kernel.org/r/20240212154640.055288922@linutronix.de --- arch/x86/include/asm/apic.h | 1 - arch/x86/kernel/apic/apic.c | 3 --- arch/x86/kernel/apic/apic_flat_64.c | 7 ------- arch/x86/kernel/apic/apic_numachip.c | 12 ------------ arch/x86/kernel/apic/bigsmp_32.c | 1 - arch/x86/kernel/apic/local.h | 1 - arch/x86/kernel/apic/x2apic_cluster.c | 1 - arch/x86/kernel/apic/x2apic_phys.c | 6 ------ arch/x86/kernel/apic/x2apic_uv_x.c | 6 ------ arch/x86/xen/apic.c | 7 ------- 10 files changed, 45 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 16e5e00..89eae0c 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -294,7 +294,6 @@ struct apic { u32 (*cpu_present_to_apicid)(int mps_cpu); u32 (*get_apic_id)(u32 id); - u32 (*set_apic_id)(u32 apicid); /* wakeup_secondary_cpu */ int (*wakeup_secondary_cpu)(u32 apicid, unsigned long start_eip); diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index ce6d31b..e3cebd4 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2485,9 +2485,6 @@ EXPORT_SYMBOL_GPL(x86_msi_msg_get_destid); static void __init apic_bsp_up_setup(void) { -#ifdef CONFIG_X86_64 - apic_write(APIC_ID, apic->set_apic_id(boot_cpu_physical_apicid)); -#endif reset_phys_cpu_present_map(boot_cpu_physical_apicid); } diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index fe9b728..f6ef121 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c @@ -61,11 +61,6 @@ static u32 flat_get_apic_id(u32 x) return (x >> 24) & 0xFF; } -static u32 set_apic_id(u32 id) -{ - return (id & 0xFF) << 24; -} - static int flat_probe(void) { return 1; @@ -86,7 +81,6 @@ static struct apic apic_flat __ro_after_init = { .max_apic_id = 0xFE, .get_apic_id = flat_get_apic_id, - .set_apic_id = set_apic_id, .calc_dest_apicid = apic_flat_calc_apicid, @@ -155,7 +149,6 @@ static struct apic apic_physflat __ro_after_init = { .max_apic_id = 0xFE, .get_apic_id = flat_get_apic_id, - .set_apic_id = set_apic_id, .calc_dest_apicid = apic_default_calc_apicid, diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c index f7591dc..16410f0 100644 --- a/arch/x86/kernel/apic/apic_numachip.c +++ b/arch/x86/kernel/apic/apic_numachip.c @@ -38,11 +38,6 @@ static u32 numachip1_get_apic_id(u32 x) return id; } -static u32 numachip1_set_apic_id(u32 id) -{ - return (id & 0xff) << 24; -} - static u32 numachip2_get_apic_id(u32 x) { u64 mcfg; @@ -51,11 +46,6 @@ static u32 numachip2_get_apic_id(u32 x) return ((mcfg >> (28 - 8)) & 0xfff00) | (x >> 24); } -static u32 numachip2_set_apic_id(u32 id) -{ - return id << 24; -} - static void numachip1_apic_icr_write(int apicid, unsigned int val) { write_lcsr(CSR_G3_EXT_IRQ_GEN, (apicid << 16) | val); @@ -225,7 +215,6 @@ static const struct apic apic_numachip1 __refconst = { .max_apic_id = UINT_MAX, .get_apic_id = numachip1_get_apic_id, - .set_apic_id = numachip1_set_apic_id, .calc_dest_apicid = apic_default_calc_apicid, @@ -260,7 +249,6 @@ static const struct apic apic_numachip2 __refconst = { .max_apic_id = UINT_MAX, .get_apic_id = numachip2_get_apic_id, - .set_apic_id = numachip2_set_apic_id, .calc_dest_apicid = apic_default_calc_apicid, diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c index 29f354a..9285d50 100644 --- a/arch/x86/kernel/apic/bigsmp_32.c +++ b/arch/x86/kernel/apic/bigsmp_32.c @@ -72,7 +72,6 @@ static struct apic apic_bigsmp __ro_after_init = { .max_apic_id = 0xFE, .get_apic_id = bigsmp_get_apic_id, - .set_apic_id = NULL, .calc_dest_apicid = apic_default_calc_apicid, diff --git a/arch/x86/kernel/apic/local.h b/arch/x86/kernel/apic/local.h index a77c23e..f8a87f9 100644 --- a/arch/x86/kernel/apic/local.h +++ b/arch/x86/kernel/apic/local.h @@ -16,7 +16,6 @@ /* X2APIC */ void __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest); u32 x2apic_get_apic_id(u32 id); -u32 x2apic_set_apic_id(u32 id); void x2apic_send_IPI_all(int vector); void x2apic_send_IPI_allbutself(int vector); diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index 4926b12..567dbd2 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c @@ -237,7 +237,6 @@ static struct apic apic_x2apic_cluster __ro_after_init = { .max_apic_id = UINT_MAX, .x2apic_set_max_apicid = true, .get_apic_id = x2apic_get_apic_id, - .set_apic_id = x2apic_set_apic_id, .calc_dest_apicid = x2apic_calc_apicid, diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c index 8f1c39f..12d4c35 100644 --- a/arch/x86/kernel/apic/x2apic_phys.c +++ b/arch/x86/kernel/apic/x2apic_phys.c @@ -129,11 +129,6 @@ u32 x2apic_get_apic_id(u32 id) return id; } -u32 x2apic_set_apic_id(u32 id) -{ - return id; -} - static struct apic apic_x2apic_phys __ro_after_init = { .name = "physical x2apic", @@ -149,7 +144,6 @@ static struct apic apic_x2apic_phys __ro_after_init = { .max_apic_id = UINT_MAX, .x2apic_set_max_apicid = true, .get_apic_id = x2apic_get_apic_id, - .set_apic_id = x2apic_set_apic_id, .calc_dest_apicid = apic_default_calc_apicid, diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 3ae696f..7fef504 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -745,11 +745,6 @@ static void uv_send_IPI_all(int vector) uv_send_IPI_mask(cpu_online_mask, vector); } -static u32 set_apic_id(u32 id) -{ - return id; -} - static int uv_probe(void) { return apic == &apic_x2apic_uv_x; @@ -769,7 +764,6 @@ static struct apic apic_x2apic_uv_x __ro_after_init = { .max_apic_id = UINT_MAX, .get_apic_id = x2apic_get_apic_id, - .set_apic_id = set_apic_id, .calc_dest_apicid = apic_default_calc_apicid, diff --git a/arch/x86/xen/apic.c b/arch/x86/xen/apic.c index d475238..8835d1c 100644 --- a/arch/x86/xen/apic.c +++ b/arch/x86/xen/apic.c @@ -33,12 +33,6 @@ static unsigned int xen_io_apic_read(unsigned apic, unsigned reg) return 0xfd; } -static u32 xen_set_apic_id(u32 x) -{ - WARN_ON(1); - return x; -} - static u32 xen_get_apic_id(u32 x) { return ((x)>>24) & 0xFFu; @@ -131,7 +125,6 @@ static struct apic xen_pv_apic __ro_after_init = { .max_apic_id = UINT_MAX, .get_apic_id = xen_get_apic_id, - .set_apic_id = xen_set_apic_id, .calc_dest_apicid = apic_flat_calc_apicid,