From patchwork Tue Feb 13 21:05:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 200628 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp812102dyb; Tue, 13 Feb 2024 13:14:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWfeqZnq2Cq2FH1945XR8SiVkFsnGvABLhWV6tE0xDXHeE8bz968pDTecH6+ZTkJdu8m24MjS7JIOveua5mYsv1vqrJPQ== X-Google-Smtp-Source: AGHT+IGpWDQcTzjqnLf2YfeZR/ljgX8msb9hPyaEoPQNW7WBfKIOzflzjoVbHdrKKqwqB9vfFwfH X-Received: by 2002:ac2:521a:0:b0:511:8748:c3b with SMTP id a26-20020ac2521a000000b0051187480c3bmr461359lfl.2.1707858873262; Tue, 13 Feb 2024 13:14:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707858873; cv=pass; d=google.com; s=arc-20160816; b=itRnv2K7mtU0sGcOUtUMpidAgWjvVJsNh2BaWXbAiGd1alh58S18uDoVpMUoIQsKlu CbszwUgSfQZ+oaSSWcsfSNTVO13rDHtuirrcogEbORrCRpGJhzCeEhypiU8fT1vMICaP z0f+Nbn8H0dR+VvlqRdHEANQSTAOJhEVqxOYc51QeU/LYM0UqH3jchsZjsMC0vateAZP ANAKHEl83xB0TKNX0cCuV51guTlK5EaEx2EBBvH4bGUCZlS858UrP5ITV0JIxQ9dzfzs 9T+k6glcoz198FVQ9W8UOrTDRaSYqO4ob/EtdDv8ckCiaVJEDg34IGBJ/6E/cdknQJuV IQ8Q== 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=LlwjbTUKZDaDXOeEu1A/4l2ILD7qxyCuJhH/mK8lvCs=; fh=MZwCfLLHr3CQghavkNW/IXuBrNBcuUmXaojxzIoJe8A=; b=SE6ySrCHUN3F4t2dBzDCPlmPsZ7ZEngllyAuwt9Zry/CLU0PQGSQpIivLGZrDTRoMp 7TEpxEyZ22y+w1t/TjrCUuiWHoGCEwZJChz5ESdDcpzW7Q+J6MotQ7+QQnGHyuN/KbsC Kkagr0l0f7ZCSuweCJ9MDNT3JHYyXS9PbjqxjMvO6dTMO0W3iUrUkmbxDY1+/3/7B/le Q1NIra4LfvXhM66QooffMpGBILpglCJ+XsMJZiETUPby9pGjWKIgqoUiV1cebfkk8KiV ow9S5vpfhNq6FtRMayPghLqy7K27nJVAcGU19WBNz1W6mcqzMv51GA1b9suC5HgJXc6g i/Sg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=HvZnpc2A; 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-64283-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64283-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCVR21WUa9wSBRZzfl4IxI8FRqT4dnIPGZakHmkjLpELlhZ9rOLfvbtxNCKeGI4WnD9cUn3mErMxjH+EX7WHtQp4TPB5UA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q6-20020a1709060e4600b00a38406cc422si1593036eji.20.2024.02.13.13.14.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:14:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64283-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=HvZnpc2A; 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-64283-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64283-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D594E1F28341 for ; Tue, 13 Feb 2024 21:14:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC17E79DBE; Tue, 13 Feb 2024 21:05:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="HvZnpc2A"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2uJXnAEO" 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 73843627E9 for ; Tue, 13 Feb 2024 21:05:22 +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=1707858324; cv=none; b=o2T3X9ieHMGdF8WlZSCu3/P6EVsh2wjsb2txD6vdc73zIRzwMFPhkcjTj7KhO5E6yCGwn/vdcR6qG5tNH67nOGzeICuA+BkzSl2yW2YQK69wBoMmtv2Pjpu6a4/8a0A0Gl8U79UiW2vdIL+uWUbX1sgHuniIuVzGL69Iw/uWGEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707858324; c=relaxed/simple; bh=iwNdGOeSVe6o7r5mvqVEJ7poQ3L/f+oh3Rm2SkBIMDE=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=rmFXN2f6LfGTFULLFhmYtEhD0fahFzVgCIx0kpZ90qMp/K4jZaNzkjz6kxoIqlqLAHCkFqhYurh4wF+8+Gu8lyNWF9Wu29AI3Ig+ti7m3Lb1zEkhvguJOQe/grAbcXAQNyUeP1SpbBgGq3TF7xz1WwuGC4eOdoejjepx4u+llQI= 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=HvZnpc2A; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2uJXnAEO; 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.116510935@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707858320; 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=LlwjbTUKZDaDXOeEu1A/4l2ILD7qxyCuJhH/mK8lvCs=; b=HvZnpc2Ax8YC1GFOZi3XHewVo1wWonyQCozbRS2McNVtZEekxh9WfF7do8HQ2Z0DtAUfzE soCzCzmp9l0d4ZaKaFij1y6O1+8+nOOKWsOEhNuotcoymdP0V7dnTWT9+ClNO8wLIPU46K DDXB/ZuXAIB+qYWmrtPAEuTuUxg/AQ96BDME5Nd6gXWSSm9e8HS0RaiiOeH2Lwb2I4/wm8 3xwUgtHcoIONYECKYanTW7WtwQLquRzu7y48HxZWZdWrA4a0pJZMXvzzb5tKc+Ld5vTF8o EI82w59yYGaCMxJHwes9S9PXuF54UZzVty6gTLz/hio8K9HrUkf4pxMqTGathQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707858320; 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=LlwjbTUKZDaDXOeEu1A/4l2ILD7qxyCuJhH/mK8lvCs=; b=2uJXnAEOy9woif+kAVFrMbP4V7oics0Cf9f/WtYw5iIzWNWNP8Tz5uu0NHAfkm5SX/9NxC Ei8CFfh1QFjQoQDw== 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 21/22] x86/apic: Remove yet another dubious callback 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 Date: Tue, 13 Feb 2024 22:05:20 +0100 (CET) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790819825963522740 X-GMAIL-MSGID: 1790819825963522740 From: Thomas Gleixner Paranoia is not wrong, but having an APIC callback which is in most implementations a complete NOOP and in one actually looking whether the APICID of an upcoming CPU has been registered. The same APICID which was used to bring the CPU out of wait for startup. That's paranoia for the paranoia sake. Remove the voodoo. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/apic.h | 1 - arch/x86/kernel/apic/apic.c | 3 --- arch/x86/kernel/apic/apic_common.c | 5 ----- arch/x86/kernel/apic/apic_flat_64.c | 2 -- arch/x86/kernel/apic/local.h | 2 -- arch/x86/kernel/apic/probe_32.c | 1 - 6 files changed, 14 deletions(-) --- --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -288,7 +288,6 @@ struct apic { /* Probe, setup and smpboot functions */ int (*probe)(void); int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id); - bool (*apic_id_registered)(void); void (*init_apic_ldr)(void); u32 (*cpu_present_to_apicid)(int mps_cpu); --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -1538,9 +1538,6 @@ static void setup_local_APIC(void) apic_write(APIC_ESR, 0); } #endif - /* Validate that the APIC is registered if required */ - BUG_ON(apic->apic_id_registered && !apic->apic_id_registered()); - /* * Intel recommends to set DFR, LDR and TPR before enabling * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel --- a/arch/x86/kernel/apic/apic_common.c +++ b/arch/x86/kernel/apic/apic_common.c @@ -27,11 +27,6 @@ u32 default_cpu_present_to_apicid(int mp } EXPORT_SYMBOL_GPL(default_cpu_present_to_apicid); -bool default_apic_id_registered(void) -{ - return test_bit(read_apic_id(), phys_cpu_present_map); -} - /* * Set up the logical destination ID when the APIC operates in logical * destination mode. --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c @@ -70,7 +70,6 @@ static struct apic apic_flat __ro_after_ .name = "flat", .probe = flat_probe, .acpi_madt_oem_check = flat_acpi_madt_oem_check, - .apic_id_registered = default_apic_id_registered, .dest_mode_logical = true, @@ -139,7 +138,6 @@ static struct apic apic_physflat __ro_af .name = "physical flat", .probe = physflat_probe, .acpi_madt_oem_check = physflat_acpi_madt_oem_check, - .apic_id_registered = default_apic_id_registered, .dest_mode_logical = false, --- a/arch/x86/kernel/apic/local.h +++ b/arch/x86/kernel/apic/local.h @@ -61,8 +61,6 @@ void default_send_IPI_allbutself(int vec void default_send_IPI_all(int vector); void default_send_IPI_self(int vector); -bool default_apic_id_registered(void); - #ifdef CONFIG_X86_32 void default_send_IPI_mask_sequence_logical(const struct cpumask *mask, int vector); void default_send_IPI_mask_allbutself_logical(const struct cpumask *mask, int vector); --- a/arch/x86/kernel/apic/probe_32.c +++ b/arch/x86/kernel/apic/probe_32.c @@ -38,7 +38,6 @@ static struct apic apic_default __ro_aft .name = "default", .probe = probe_default, - .apic_id_registered = default_apic_id_registered, .dest_mode_logical = true,