Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp177360rdh; Tue, 13 Feb 2024 13:13:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWLrEtf0DDCxXtgo243U7FJyWRv15KWghiLWzbxJQl3C1ClTL0PXieFqdcMQfStBL86xjs35APMl8hyzV/MwUoaNTICpDtKGNtz11ggCA== X-Google-Smtp-Source: AGHT+IG5N0hppudtwHHoUfj0kZPnOsdeE7OqWOaBWRU9VQjoy7IPQIyzd39yiAjJHX2wqrH33Ldn X-Received: by 2002:a17:90b:23c5:b0:296:8409:aa07 with SMTP id md5-20020a17090b23c500b002968409aa07mr660693pjb.3.1707858835279; Tue, 13 Feb 2024 13:13:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707858835; cv=pass; d=google.com; s=arc-20160816; b=auM3WeuQbhpl8DC9q8y8dfxtDwgNVUDNUQfqt03cuptKkSmw6ei2qijAcVuWYKxb+M vZAxAlCKabBYz+ipfSMlWIaK0c4BXXonbXUFbre4KhavzopwMsYdjNYpehOWAWzsS9K6 EzhuREEU7KfwpMhA0C3fcnwelJFgJCNTeZR7pso1l6JCaSezns3cSgpkStXBCmv4NTHZ ldwAGr9ILozs8PP2yuACIYfE8dj/DQVYX7GwIhJOSBYZsIoudSvtDZqBx0U1++NDNUok X/E7d56ihbj6GBBqrqb9uzpPuP2Ta3m+BYTB/g7J+qDsrG80Y8tnkAB1s2KvnwDojMid DjJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:subject:cc:to:from:dkim-signature :dkim-signature:message-id; bh=LY3WDn1yRn+VOWANrg3tW/qdrTAhNWr4j7SV+r49wU0=; fh=Kgto4EUd01O+fav1GdQEH825xOUmv0K6/MhErhUo1AU=; b=Yow/xb2jlBEQM3Abk0eZfTkQ+y64QJdJa/hAVlPXv6NlXVC+qVmcJvb3lJ3n1/NDsH 8c8invk644Z83caMuKuAZRRWaCTm+qXKA53LIQDIJ6zwkIAX+Nqd1p256IPAKTW/xIvd 0xR26kiAzKg0T93yba2r79RpD+GXm+/AGVSRctCulL1ZUik0DBoi7r3V3WFcwpDoXawT kNS2rgGaSU97zJVhTtf2p9anrnqflFPLPyGJqbLcPi3pSHgFgZ7GxRmBxfXmGFFtdCOC HSrdEZbyCOfCJjECjq3auV3/cHIEQWAM1t2uwof0tHk7FCZ/A8kDXl0olFE09FGREN3w zRcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Dzcab0ZV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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-64282-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64282-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCXTi9+GKf21aOow+2rzyclI1BPjWVRkUl64Cwz8+yOSi0mD2dzTCzhVazXsFZjvPLjJLWfPZu7fvZh1j2XbJRj6Wh5Laka9efACRlU81A== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id r13-20020a17090ad40d00b002966db7cb9esi2563681pju.74.2024.02.13.13.13.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:13:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64282-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Dzcab0ZV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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-64282-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64282-linux.lists.archive=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 E8FA7281B65 for ; Tue, 13 Feb 2024 21:13:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 30D8678B5D; Tue, 13 Feb 2024 21:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Dzcab0ZV"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nPW0buQY" 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 53CB377F3D for ; Tue, 13 Feb 2024 21:05:20 +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=1707858323; cv=none; b=oWPhdcvbM43rxslubXXWZzuatZxetMHs8SywV3bGZHxarn2bqcGWUC+jnDprfHIReTGqk34RNrn3bN0iKbLjmV9jkPr6gngYfkfaksro/EJQcnZAx63T7qyQ5bYOm+9CWV4WQvHP1k1Bi/QlK6IJ8gwE0prppRzw2qEMhnzGmOI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707858323; c=relaxed/simple; bh=wojDhwNXRQHJtESUuIWPxfFwIlWHB6nlfberX4p+eeU=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=lOtp8sMa1rHzVllm1yQHrLXQkBz+IZ8KPdOT1BY/g+PQ5w95/iz/zINhJUfy9QOpQccoaqHqIqxelZnussjLdTcFoJR5yT+6Mjhki9UZVtPkGUtnELReG9EG0Y9Kck3wL5SJqVIWHWsl4C2vAk6Nhv/BQIoeqdHZTOo0F74iCcU= 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=Dzcab0ZV; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=nPW0buQY; 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 Message-ID: <20240212154640.055288922@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707858319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=LY3WDn1yRn+VOWANrg3tW/qdrTAhNWr4j7SV+r49wU0=; b=Dzcab0ZVax0B8p1OTxEvWKDNQBsIheWA8M2uVspmysru4KeHwYopZu6g1xHyMKwMdM2akj Hh/y0NU8MHzdmXV8ZSmuWEWwwCNcz/tp/+1cqWjzKBnukPqzXfQirmeEsUqpORfX5vl5BI gKApr87CmyJzjPUey9VT+gFDcB/V5aGleAzeX63M///1JXt2UvZRIunXqG+yLffPRo4Et0 szx5T1g2++wsu0XX+DILfDXRloa20DMjfaRMHFWANm7laD4LEAWiPKWfT8DKcZazqHMeMx FrOtj3ZZ2AYyCtaMDORCrLrsXgScGW2XqdTxmzfOnITW7p1nFO26OCXg7Bsjiw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707858319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=LY3WDn1yRn+VOWANrg3tW/qdrTAhNWr4j7SV+r49wU0=; b=nPW0buQYxPPfXEarMHWfF9UPpo7MiwhwwUhWB6hSuNMtE9CYt8fnCM5UX+2HjzpJ5Fmo+l X2Gw5kZlEhme9dBg== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Tom Lendacky , Andrew Cooper , Arjan van de Ven , Huang Rui , Juergen Gross , Dimitri Sivanich , Sohil Mehta , K Prateek Nayak , Kan Liang , Zhang Rui , "Paul E. McKenney" , Feng Tang , Andy Shevchenko , Michael Kelley , "Peter Zijlstra (Intel)" , Andy Shevchenko , Wei Liu Subject: [patch V3 20/22] x86/apic: Remove the pointless writeback of boot_cpu_physical_apicid References: <20240212154529.402604963@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Tue, 13 Feb 2024 22:05:19 +0100 (CET) From: Thomas Gleixner 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 --- 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(-) --- --- 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); --- 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); } --- 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_ .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_af .max_apic_id = 0xFE, .get_apic_id = flat_get_apic_id, - .set_apic_id = set_apic_id, .calc_dest_apicid = apic_default_calc_apicid, --- 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 .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 .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, --- 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_afte .max_apic_id = 0xFE, .get_apic_id = bigsmp_get_apic_id, - .set_apic_id = NULL, .calc_dest_apicid = apic_default_calc_apicid, --- 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); --- 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 _ .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, --- 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 .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, --- 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 .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, --- a/arch/x86/xen/apic.c +++ b/arch/x86/xen/apic.c @@ -33,12 +33,6 @@ static unsigned int xen_io_apic_read(uns 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_afte .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,