Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp475753rdb; Tue, 23 Jan 2024 05:38:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGm6m4gumYEgLlysPeoSGwiLKIVYxOnqve48MjU3RsDwF3HdZrIZY3JQJX+EYh3GkOLlagr X-Received: by 2002:a05:6a00:1401:b0:6da:e246:5c2 with SMTP id l1-20020a056a00140100b006dae24605c2mr6371803pfu.55.1706017093737; Tue, 23 Jan 2024 05:38:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706017093; cv=pass; d=google.com; s=arc-20160816; b=uGnLhFSj7ql5XWPMs9tDWo6HCN/TAasMEOHDWOWvUKna8ln/N/sfkJAD3Zy5RooESg 9jNoDhauJvNvuIvCAOHouw8j5TJYAanYNpp7D1tWqjuTpM2q2rgnCMtkxx8p8oLw3NTm k8B54W7mfB2R1p7ybQuGHl6EYcCy8KKo2T9sOZ93APyGh52biLZHIIEe5ZuPo4aNYyAM RYnedgsZ21Lkh+yRqu9V2wkpIuoN/kKQGoSR6EQxNeWQuAUOTjQTK0cbxDnchiDZnNDI EcWqJUPMzFDFmHKHZiEf5w0i00uZbkpi4ttgbTGwtCMZpGVylK3CsiHBaKuqp/NaMUE7 br/A== 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=xSMyMDhOOAbYsok2gC1QscNssWoM6sZikBlB/DuMwl0=; fh=FCQyBsGyK8ELfIRvcrNSjETg/eJNjzUYemIkEO1t5RA=; b=o9E40ree0AVG+sGIOZWDtGHFpZzdmmPw8CIjrpB+rMBlV7UrJwjAC9nDXnw/0r07qV 79ziiXddiZ06/Zz+ztWAzYC8mEKPrYFHvLaFvcfob/lJWgbC1Mcrv4eM9kFWG1fwgyPS Upgc6TI4joHIO9Hs9dh/e21Fdk3wowE7FGmspF3PUAKj453N1HVgtRVxdI8j2GEGW+aB iVvOrg5+mRAp4C7hSHpk7Jzwf3xvXJWMk9OfwK42+8qqJ8B5NgMh8D70kAh3CIq7z4Gl Cw63vuL6sl6FVf0k0lRE51fz6uipAePXFrFXZ/IbwNTUA+h/Z/ZsGia4zpioPifoCiC4 qSnA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WSK6FtNA; 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-35340-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35340-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h14-20020a63120e000000b005cdba90861fsi9861220pgl.137.2024.01.23.05.38.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 05:38:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35340-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WSK6FtNA; 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-35340-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35340-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 60947B28BA3 for ; Tue, 23 Jan 2024 13:15:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ABCBF60EFF; Tue, 23 Jan 2024 13:10:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WSK6FtNA"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="shTrjPJ0" 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 5E79560DDE for ; Tue, 23 Jan 2024 13:10:39 +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=1706015440; cv=none; b=aVRzzIcXjm5BrnnO5Yh5fuMSH3CI4sn26rrPkfLn6uJFLCmEm0bcMThpdKD41QxUTFLK40tkJsVbsaAuIgu390v4l8pt5NQQEKeD0W/rC6c+b59qtOFuNE6p8uDY9KgqRfZSsvSuSuAJouq4bffPlV1l6EBbGKlRCKQSgqZn7CA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706015440; c=relaxed/simple; bh=EPgNKJsjv0Fvj2hFIw+msrMoAr7OoiLKu49+yMak/Rk=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=iD/IhIxRuVp8UqhGqko/f7ykYSd4DcU7RpwDnJS37yiSKXZ3ky7nmyN+jauiJbF7+EbjviuNZizkCCcwk27cAZ5v1HKhyYuPmBWcxtsR/FLvezJksa/IMJBgk0inW32C+wnE1Srh3/iYzClnb6cgayiizkpptny6JfQB2ENTR9M= 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=WSK6FtNA; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=shTrjPJ0; 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: <20240117124903.688820635@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706015437; 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=xSMyMDhOOAbYsok2gC1QscNssWoM6sZikBlB/DuMwl0=; b=WSK6FtNAQqTIiCpO+wruRfAJkEevseyTp3nP74Njzj9hIMa+iu9saJ+kT7YvLVBP46LrBn oqKLL/gxsRhtp0FGjYgE7pSTxHqzSri4L+znndUR/ie8gwyYUgUJkjm4At5g4YtfFW21yH T0ZB6QMdeWOPprFG8nO6jDVpxzFhrcNsHxL2cWPYZNiur/pVfJXq0NkrlAaFmjHBzzpg7k 0HyRoHw7/V9lxlJMa4es8+olq9+epPjaGk7oavlfMRYoEMA4PBZ4kIuXoODg01XCwxriRE q5KiAm+c7lyAUvwtLVdz8t+0vVRBJbr7yHh3cEEOy9B3+k/ZSbx871YWE8MnyQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706015437; 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=xSMyMDhOOAbYsok2gC1QscNssWoM6sZikBlB/DuMwl0=; b=shTrjPJ05i1hLSyN02PjJKye/hLpIvIDIaOSwSQHPH3wrCEe4xJ5h9NPYb2KH7pKqkrnbG MXBtLHqKt/vjJyAQ== 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 V2 21/22] x86/apic: Remove yet another dubious callback References: <20240117124704.044462658@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, 23 Jan 2024 14:10:36 +0100 (CET) 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,