Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp836798rdg; Fri, 13 Oct 2023 02:38:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IET6GQcKSeHhNwjokeX4k41lQ0LS4OAIkdJFYtnif4Mss+9mHqUuIq86lPS8QL0q/DdHLiB X-Received: by 2002:a05:6a00:2e8f:b0:690:d4f5:c664 with SMTP id fd15-20020a056a002e8f00b00690d4f5c664mr28725409pfb.11.1697189930081; Fri, 13 Oct 2023 02:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697189930; cv=none; d=google.com; s=arc-20160816; b=L/sZGpgHjFRQrhjJKzpIu5KuZxUVp9aGywwz2q9bGkAHendxVXPBvpaUrSS3ufgBo7 G2gSzLvlcNj/vRzZ5os7Ps0VJ0RRNrsIoNrLg+xE8pdYpzcyv7iKqG+YsujOO//+4Tsw 14iU3345jETrjNmaHWSZglH049yNQq4S/j3CJqz7ZvopVsfye+UBgF/JccLi5EO6sLPj jNXGFEagcwzh70W56WnUdP0Lixb8EJ04YPDRCv9sUZZmpNNjvxsJs1vvs2bKb+JCdHu6 eh/RwvmuCBJrLjG7K2f22uty0VMHR1fl3tV/b2l289+JLvIikAQgGHIAGD1rXv3vKVNM xi+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=8OpENGFnxAaYj7M8fE6cKf/8eE2Iu8UMtWVNtT2iVz0=; fh=9Et1xDJOjLzpfljkBv6WL6N9yJ3F7a92x/mCc58zBBw=; b=JPHFJ0z+qmhaX9nvFjc14kqKjC3pKWjYYeQslRZGqPDVl9Nx07Y08aBXx8XbmJJfeD x6eWokZli1gTnN8YiHkS4rOpd176T+WEN7dSur0AGRtGkVTsZVpj7txJRYHkMp5jJgav J8CLNV9xQVvyoqSO80sPJXIQdgCOInor+alj6NcSHsFJQii/TTeMbpEEuRkYnNevfyhc JeI2Ba6UxU8BFRzJjTukVMha239mBlIMHWD8rYcbW3P5axCoWNth/mtDMtyG3Gadf159 axo3lKzYOyVUBKoEzPWqSRgn2PTuCa07Vf7orM3Mk370pg7SihglB2wjYuc83vGccH5R kGYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yoeWq9p2; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id x6-20020a056a00188600b00690f8063627si16882426pfh.38.2023.10.13.02.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 02:38:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yoeWq9p2; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5EF878383CC5; Fri, 13 Oct 2023 02:38:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231368AbjJMJiY (ORCPT + 99 others); Fri, 13 Oct 2023 05:38:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231210AbjJMJiK (ORCPT ); Fri, 13 Oct 2023 05:38:10 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CEF3CE; Fri, 13 Oct 2023 02:38:09 -0700 (PDT) Date: Fri, 13 Oct 2023 09:38:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697189887; 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=8OpENGFnxAaYj7M8fE6cKf/8eE2Iu8UMtWVNtT2iVz0=; b=yoeWq9p2InyIMquxtDF7i8qBK/m0CcHMoZsxmQ6+QMb4fFffshiQWxNyOS6bvxauJZ+uw4 Ec8uQsLzXoBPqbUYvqSmO0CXrji5wCuVHV6NVIBpHX+k9hkgLYJ4g1e/zwHsz/kzS7FWzg AhEEyKIUx9iowJ1msmhVnPEspEUP/xsMNs4E2Skb64Rq5aApJqGbFpo8FeGFzfw4VBNTRN iZWu+DX10s40/d77C25wSSJK+fXmEABkTRetBYofjV7TGGtzGLXR3tcP5AdCT6X4C+hwyO pVBm74QqK8dCNxOsBV3IVsbFNVaemg18Zb3RIzr3Gi9+HZxdBdJb1irgiH0fyg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697189887; 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=8OpENGFnxAaYj7M8fE6cKf/8eE2Iu8UMtWVNtT2iVz0=; b=Cxq2aRwKhCEI/Ury96a1CxlDfRvewV0ySg6E0XN4vEZk1OwSNQ4yLXzGui1wW5+NIdHoWt 2lr1KcTd1gBgulDA== 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/core] x86/apic: Use BAD_APICID consistently Cc: Thomas Gleixner , Juergen Gross , Sohil Mehta , Michael Kelley , "Peter Zijlstra (Intel)" , Zhang Rui , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230814085112.862835121@linutronix.de> References: <20230814085112.862835121@linutronix.de> MIME-Version: 1.0 Message-ID: <169718988727.3135.6720592549471092966.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 13 Oct 2023 02:38:45 -0700 (PDT) The following commit has been merged into the x86/core branch of tip: Commit-ID: 9ff4275bc8fd7bd5ac4677e2724397f8db3209bf Gitweb: https://git.kernel.org/tip/9ff4275bc8fd7bd5ac4677e2724397f8db3209bf Author: Thomas Gleixner AuthorDate: Mon, 14 Aug 2023 10:18:39 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 10 Oct 2023 14:38:18 +02:00 x86/apic: Use BAD_APICID consistently APIC ID checks compare with BAD_APICID all over the place, but some initializers and some code which fiddles with global data structure use -1[U] instead. That simply cannot work at all. Fix it up and use BAD_APICID consistently all over the place. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.862835121@linutronix.de --- arch/x86/kernel/acpi/boot.c | 2 +- arch/x86/kernel/apic/apic.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 2a0ea38..f3e4d35 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -856,7 +856,7 @@ int acpi_unmap_cpu(int cpu) set_apicid_to_node(per_cpu(x86_cpu_to_apicid, cpu), NUMA_NO_NODE); #endif - per_cpu(x86_cpu_to_apicid, cpu) = -1; + per_cpu(x86_cpu_to_apicid, cpu) = BAD_APICID; set_cpu_present(cpu, false); num_processors--; diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 3cdf484..d2b1d60 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -72,7 +72,7 @@ unsigned int num_processors; unsigned disabled_cpus; /* Processor that is doing the boot up */ -unsigned int boot_cpu_physical_apicid __ro_after_init = -1U; +unsigned int boot_cpu_physical_apicid __ro_after_init = BAD_APICID; EXPORT_SYMBOL_GPL(boot_cpu_physical_apicid); u8 boot_cpu_apic_version __ro_after_init; @@ -2318,9 +2318,7 @@ static int nr_logical_cpuids = 1; /* * Used to store mapping between logical CPU IDs and APIC IDs. */ -int cpuid_to_apicid[] = { - [0 ... NR_CPUS - 1] = -1, -}; +int cpuid_to_apicid[] = { [0 ... NR_CPUS - 1] = BAD_APICID, }; bool arch_match_cpu_phys_id(int cpu, u64 phys_id) {