Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp774325rwo; Wed, 2 Aug 2023 04:08:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlFFpTf2ouLijPmhamlGWzA2CDU5CrZIh9Trme5/bGEBZeBNL922n2qnPg0ZcdqnjGyKhjyl X-Received: by 2002:a05:6a00:2481:b0:682:5a68:983c with SMTP id c1-20020a056a00248100b006825a68983cmr17287794pfv.34.1690974483913; Wed, 02 Aug 2023 04:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690974483; cv=none; d=google.com; s=arc-20160816; b=tkJiBPpNS+rnT+2ljpJIXfMio5h20X1R2nYFk13/r3aIkQtzCGEZzPl2TnAfYVqPoh FTuDOyavVEYnGcPUN4eSil5YwE78PGrHDtJXkuzT5W43ZaDcO1QyivYMf02vPDxmj0/L 5eGCIiP5Yddhke0QXLstHNVZjq9ETPdXr0lla8slsYNf8HKQKIxCdZXr3riPmknow8NJ w7MsSDZHVzp+BRlALt/WZJDkgHWEIfp2u3DpVTQH65yI510HdA8ODFJY3dDr/bK/+zpv VcA8lzfAS/cRLIY++YLeupaso2oQvf5THfL2L2lqsWx/2gAA+tBhi4ND7eMQFzGxhM6u Fv2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=YhEanMRg+4kFvHEfTCEvq8URBlfBDUjAuPyT44iGPEI=; fh=O9JPtEgoXN20WvvffwC9vht4C9mlV4cjm0SKbEbqoG0=; b=hjAf4m/cVLgGJ2xOqainkdaKfFkQqwK0tOrnGdK0dDYndgbsuJEXPp/oMyBE5tC6O5 tPekGHHaDOYUP6BtaatKNcp4gjG+/HdkRX7cKkwLEZfdOvUhNPnJxn008Kps/FE0thnf hk5Ro6WN+gX5AOFs+8o0urFIbSn9okLOTf87awPQMwSXaUrQ8R+kJB9+fUHRDuGfKSw8 9bDVGQ1+HAgej0M2xiU/AaS52q/9tDLCVuJ0mgn/HVKemJjeQVxXCKN0D7CExxrX1Hxw vcUgGe0/p6NeG5o7ybDRARBQPYg+E2ysZQGohlMgSJ5lvnx6DP3Idn9sN+YkwLYl9VJN hx6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1WjrgSoX; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a056a0015ce00b006872be161c1si6127708pfu.159.2023.08.02.04.07.52; Wed, 02 Aug 2023 04:08:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=1WjrgSoX; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233920AbjHBKWc (ORCPT + 99 others); Wed, 2 Aug 2023 06:22:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233950AbjHBKWG (ORCPT ); Wed, 2 Aug 2023 06:22:06 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2FDA30FD for ; Wed, 2 Aug 2023 03:21:23 -0700 (PDT) Message-ID: <20230802101933.567908704@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690971682; 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=YhEanMRg+4kFvHEfTCEvq8URBlfBDUjAuPyT44iGPEI=; b=1WjrgSoXxYRSbq4yzDqY7yGnGhKXyFxecpWRjEqZ9Pia+Q2fcnkX/3Q+LVo+zddNXK1ZBQ GdbgxTfgfQsHbm+3hZBB1AeEGKTAHz2FQd/3Xse1+4KFLicPpZv5EPpAcqqGLg3CV0o1cq /niMEJ6xnvQsbgc3sHwKRDUY8fRApZzEa9eB3K88Q4STWqf8iNOSRO2Fpmpt3iH6cRiVtN 5b/QU+pHSJ1NVTo7ev6SSaqFeaz4JPyLOPKeYraFtxgnKWgiMDyM5YBJb8k+s85xkj9Ezl gZduL8AvGX9hx70BVL7UYjijVL0RcKUU+I57W0QfqOWy48CNFcwvIZN7JuDW5g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690971682; 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=YhEanMRg+4kFvHEfTCEvq8URBlfBDUjAuPyT44iGPEI=; b=mstaGafil/UFKsuu/zTLUcuPfS/mRd+SRP9FG2hwiJehcFjrJMbc3aaYhdftEkHPXc2U3u 71zasdQ4n+9TD8DA== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Tom Lendacky , Andrew Cooper , Arjan van de Ven , Huang Rui , Juergen Gross , Dimitri Sivanich , Michael Kelley , Wei Liu Subject: [patch V3 15/40] x86/apic: Use u32 for check_apicid_used() References: <20230802101635.459108805@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Wed, 2 Aug 2023 12:21:21 +0200 (CEST) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Arjan van de Ven --- 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(-) --- 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 api 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); --- 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 c 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); } --- 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_af .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, --- 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) { } --- 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(unsig 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; } --- 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);