From patchwork Fri Oct 13 09:38:06 2023 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: 152455 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1768786vqb; Fri, 13 Oct 2023 02:39:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHylzIk63XD74POEcF8J20sp2qlm4o+zD3bRQn5PQhRWSEpieF2vEbWsepMXE2pfcbg6Wwn X-Received: by 2002:a05:6a20:a10c:b0:171:737:df97 with SMTP id q12-20020a056a20a10c00b001710737df97mr12175543pzk.2.1697189960361; Fri, 13 Oct 2023 02:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697189960; cv=none; d=google.com; s=arc-20160816; b=jh0RJuDzgeupfXZh+YBJ/4Zb2KdyUgpt6ICjfnwCm8beTzDAR/9c2VxTVDYKVGtYiC ezbUN9N74CD6EWnRDBwQciVMNQk8ZC3jt22KZqpjeDMBPROmUDkGHcW7EyAfabz747x7 JiOXUMkN9Ro0bBzwCua2QIS3SBIit4WuqFucKsY7aqNW/vphLrK+dMG5WVi9dUxbqHVF 9VaIWSTQ9RpZnvcJWnVhfetxicuOaBbOg2tDyhRPo98s9z0P3Im5Sck1vn6j1dFbk98+ IzkUSamjVwXVB8Cp0C1Ix4w+KRhDswF5KeW8oR/KihmFvZOsD1YT9b5MhTevL7/WpGfj jtBg== 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=oQKwGQtwqztvMgre7XLgIBQlyLqqnaOHhB81jRJR8/8=; fh=0+UPLPNzUC2ByrAHKUZuTVx5U+vPcsu9FF72jvWmJM8=; b=0PpCcp7enXcst1EJI3k7jktEORILfb+qELb0pOijk2aGQOMYjHm/iUeAI+hKvvWiJV qs7QuEhWcl0ebZanlVc6VwftzFowlWmKWciarQ4vLkG4eZzcXEcRKQKONYyVhMNCGqyn XLgVNki5JQai52laKWX0R4sb/ebcRVQ4U4+9iA2m9Cw4mdZJw+cgDRUI8Uh5+wPCQrEK GHXfNUpTya2cwSGQ7AP2nXToC8/TWHxs25gFeHBP7ijYacFeEBaYCaNejgmCQnnLDhLI Cfm7JgJJPVnpg+Agisxwlxua/iyQmgdG/kPL+q/FiZWjSwZEs9aSVp6hyOT3NsY+PzJQ cvCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=O7tJ2n9d; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id j22-20020a17090ae61600b0027ce7a59589si4128621pjy.142.2023.10.13.02.39.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 02:39:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=O7tJ2n9d; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 26B7482CEFFA; Fri, 13 Oct 2023 02:39:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231381AbjJMJi1 (ORCPT + 19 others); Fri, 13 Oct 2023 05:38:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231208AbjJMJiK (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 87C24BE; Fri, 13 Oct 2023 02:38:08 -0700 (PDT) Date: Fri, 13 Oct 2023 09:38:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697189886; 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=oQKwGQtwqztvMgre7XLgIBQlyLqqnaOHhB81jRJR8/8=; b=O7tJ2n9dK7uFjv5G8/yc69SUsyb8s4Mvk31qKRWkgxJ9vzCbI/pCrDdacgaGMrgEe2MEfI uoJgnTemtyzPPTY6z0xfaWAWUCf4GaFzz6l+9H40W1JZAeQQLUgVZVIwqbU8+ZAHfgA96i /Xzk/aDMFCSJugZKVK4bngodddyxH6sI5GUdhqQPaSTeeq0dk2ZslMNMOzjDG1PWvnpt/Z BsQSErAGRHr+UaH+oiI9/NNIrUUTBrGCg5A68RzpbHkLJxVj/scoNPDWdzZLotHBPFodC0 BsfTm9VCqQcBfX3rv6L2iTC/me+E/JVSGYmVRNrLw4UvkNysSgiS0r9jVsm/yw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697189886; 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=oQKwGQtwqztvMgre7XLgIBQlyLqqnaOHhB81jRJR8/8=; b=Xfc9uj6oTOep2IPq/65F41+2acvcn9F3yDEpxRl8FU43wmX835BK98ctZ+xHaV7CiPc+qw Go3ARHELRbhx4eAQ== 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 u32 for check_apicid_used() Cc: Thomas Gleixner , Juergen Gross , Sohil Mehta , Michael Kelley , "Peter Zijlstra (Intel)" , Zhang Rui , Arjan van de Ven , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230814085112.981956102@linutronix.de> References: <20230814085112.981956102@linutronix.de> MIME-Version: 1.0 Message-ID: <169718988617.3135.18121783861517995652.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 13 Oct 2023 02:39:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774199442303488120 X-GMAIL-MSGID: 1779632660185060241 The following commit has been merged into the x86/core branch of tip: Commit-ID: 5d376b8fb165eca33ea166ee43a637c8e912abd4 Gitweb: https://git.kernel.org/tip/5d376b8fb165eca33ea166ee43a637c8e912abd4 Author: Thomas Gleixner AuthorDate: Mon, 14 Aug 2023 10:18:41 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 10 Oct 2023 14:38:18 +02:00 x86/apic: Use u32 for check_apicid_used() APIC IDs are used with random data types u16, u32, int, unsigned int, unsigned long. Make it all consistently use u32 because that reflects the hardware register width and move the default implementation to local.h as there are no users outside the apic directory. 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 Reviewed-by: Arjan van de Ven Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.981956102@linutronix.de --- arch/x86/include/asm/apic.h | 3 +-- arch/x86/kernel/apic/apic_common.c | 2 +- arch/x86/kernel/apic/apic_flat_64.c | 2 -- arch/x86/kernel/apic/apic_noop.c | 2 ++ arch/x86/kernel/apic/bigsmp_32.c | 2 +- arch/x86/kernel/apic/local.h | 1 + 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index a7ac05c..e970697 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -292,7 +292,7 @@ struct apic { int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id); bool (*apic_id_registered)(void); - bool (*check_apicid_used)(physid_mask_t *map, int apicid); + bool (*check_apicid_used)(physid_mask_t *map, u32 apicid); void (*init_apic_ldr)(void); void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap); int (*cpu_present_to_apicid)(int mps_cpu); @@ -538,7 +538,6 @@ extern int default_apic_id_valid(u32 apicid); extern u32 apic_default_calc_apicid(unsigned int cpu); extern u32 apic_flat_calc_apicid(unsigned int cpu); -extern bool default_check_apicid_used(physid_mask_t *map, int apicid); extern void default_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap); extern int default_cpu_present_to_apicid(int mps_cpu); diff --git a/arch/x86/kernel/apic/apic_common.c b/arch/x86/kernel/apic/apic_common.c index 7bc5d9b..ca73c3a 100644 --- a/arch/x86/kernel/apic/apic_common.c +++ b/arch/x86/kernel/apic/apic_common.c @@ -18,7 +18,7 @@ u32 apic_flat_calc_apicid(unsigned int cpu) return 1U << cpu; } -bool default_check_apicid_used(physid_mask_t *map, int apicid) +bool default_check_apicid_used(physid_mask_t *map, u32 apicid) { return physid_isset(apicid, *map); } diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index 032a84e..a5364a4 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c @@ -158,8 +158,6 @@ static struct apic apic_physflat __ro_after_init = { .disable_esr = 0, - .check_apicid_used = NULL, - .ioapic_phys_id_map = NULL, .cpu_present_to_apicid = default_cpu_present_to_apicid, .phys_pkg_id = flat_phys_pkg_id, diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c index 966d7cf..f834a20 100644 --- a/arch/x86/kernel/apic/apic_noop.c +++ b/arch/x86/kernel/apic/apic_noop.c @@ -18,6 +18,8 @@ #include +#include "local.h" + static void noop_send_IPI(int cpu, int vector) { } static void noop_send_IPI_mask(const struct cpumask *cpumask, int vector) { } static void noop_send_IPI_mask_allbutself(const struct cpumask *cpumask, int vector) { } diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c index 0e5535a..52ac447 100644 --- a/arch/x86/kernel/apic/bigsmp_32.c +++ b/arch/x86/kernel/apic/bigsmp_32.c @@ -18,7 +18,7 @@ static unsigned bigsmp_get_apic_id(unsigned long x) return (x >> 24) & 0xFF; } -static bool bigsmp_check_apicid_used(physid_mask_t *map, int apicid) +static bool bigsmp_check_apicid_used(physid_mask_t *map, u32 apicid) { return false; } diff --git a/arch/x86/kernel/apic/local.h b/arch/x86/kernel/apic/local.h index ec219c6..860d90b 100644 --- a/arch/x86/kernel/apic/local.h +++ b/arch/x86/kernel/apic/local.h @@ -64,6 +64,7 @@ void default_send_IPI_all(int vector); void default_send_IPI_self(int vector); bool default_apic_id_registered(void); +bool default_check_apicid_used(physid_mask_t *map, u32 apicid); #ifdef CONFIG_X86_32 void default_send_IPI_mask_sequence_logical(const struct cpumask *mask, int vector);