From patchwork Mon Aug 14 08:54:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 135290 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2629944vqi; Mon, 14 Aug 2023 02:47:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFfIiwgx3MroNuU5mhKpHXsm7C3lUkHOlEidlulj+ds+iPbL7I23/73gTHNhagoxOzJg8Wl X-Received: by 2002:a05:6a20:3d0a:b0:13f:13cb:bc50 with SMTP id y10-20020a056a203d0a00b0013f13cbbc50mr12918385pzi.25.1692006471820; Mon, 14 Aug 2023 02:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692006471; cv=none; d=google.com; s=arc-20160816; b=w4VEi2wBXXuj0puNCl2wT0a2Q0xBKtzRZp9gyeejcdhnSlMSqdx0LGGC9wRLMcHS1I tEIuZRrnvIhm8ihT4O56hG2/WPPopMsa4O9/P6sr/ubNQpuwGVycsa4EKzgms9jpcmiY S05h9K3VLRv+B/JcgmTmzIjhXZr/MYPiHL9JReGvGJwDogUiqhuIRiVduyx0tDXvavKl o2h3lEPYq1GW4ie0AMNqGfqVf0XUsReP7j7F/egg4KEYFpf1cVt7f3p8Mjm9OvlzIIEH fbBPUg2JZpE/Z/XBl6v+Z4PGUlIDSGBrQoiAxPA5he0MmmpHKlp6RT1M2XhzpjS8N7/g tZrw== 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=4Bp/IeizQpE2MMDElY3iKzSaIkRxvlWX5qBXFslYX0g=; fh=vmKIJtcbtoHWhyuxI4oEq8r1SWZ2V9Rrbp1Orw2DxqA=; b=ha2Ew/8DCajMibmeI6y6SpRLZiEDsJbUeyFjhUG/DVl3nvd3xLtKTfCirPvY6j74wj yb01LuD9cBBNLZ0CjcRCVSEkVEOu2EElWcxDwSOdyy35htCP6otbBu4Fg87t3ema5eaw t4ISKoj79cfgQdC/0u+5bnWbnKdn2chs664Rx+/UFzdV4G+Aop2pRp/ej8Kz6W9IfVAR VVpv8uLLWD+5iZ5bhfxiBbDirC4HdFnc2vnIF9jwJJcD/OdLcC80WgMm4vnQNJnvaypA ZNP0BC+8/Cc5B0nUPS0kVGl7Cx4LD0OjaKs5T49vOVWY73KuOBK2vA9LZu79TycuMTm3 V/JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=pLnB0w7h; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=D2u6A8eu; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l18-20020a056a00141200b00686ef19c4d2si7821428pfu.325.2023.08.14.02.47.39; Mon, 14 Aug 2023 02:47:51 -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=pLnB0w7h; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=D2u6A8eu; 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 S235152AbjHNIzK (ORCPT + 99 others); Mon, 14 Aug 2023 04:55:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234979AbjHNIyI (ORCPT ); Mon, 14 Aug 2023 04:54:08 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46FCB91 for ; Mon, 14 Aug 2023 01:54:07 -0700 (PDT) Message-ID: <20230814085113.233274223@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1692003246; 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=4Bp/IeizQpE2MMDElY3iKzSaIkRxvlWX5qBXFslYX0g=; b=pLnB0w7hIAHpTt5BKMcid51krlX77rpXcKGPWF56p+ShmIcmnFX1WSqpD26NcONLvirOpK GGHKs6TgIpQrpc9cYtGT2ETwba+fhWYbwCU52KhTLAmkGyE2imabTkm0Z/U8c7dcPgdz/z j1DY6imFujMuc9mBTdEICOICgH5EpObBcpOstMiYIWK34GmHT9KQKagW1lRS0sRBxpG5JE uYq0aOI3XWMYgfBRLl6qt7gDuMerxG+Xq1quaXpM5pvzF4JbNm700lSyaE36MisDGevimk My66cLPEo1NCXQFlpYnVrsKheJCSwij/juGeoM1yXOUWL9Ijtxg2t79sFglwCA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1692003246; 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=4Bp/IeizQpE2MMDElY3iKzSaIkRxvlWX5qBXFslYX0g=; b=D2u6A8euewKsV+MJQFzP370jp0itRSNxVuk9wH6ZqvTpr2MRX/umOkRiA1M/mMZzsC6DNG ZBw+CAS+xUpe/fAA== 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 , Pu Wen , Qiuxu Zhuo , Sohil Mehta Subject: [patch V4 20/41] x86/apic: Use u32 for wakeup_secondary_cpu[_64]() References: <20230814085006.593997112@linutronix.de> MIME-Version: 1.0 Date: Mon, 14 Aug 2023 10:54:05 +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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774197378140393013 X-GMAIL-MSGID: 1774197378140393013 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. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Reviewed-by: Arjan van de Ven --- arch/x86/hyperv/hv_vtl.c | 2 +- arch/x86/include/asm/apic.h | 8 ++++---- arch/x86/kernel/acpi/boot.c | 2 +- arch/x86/kernel/apic/apic_noop.c | 2 +- arch/x86/kernel/apic/apic_numachip.c | 2 +- arch/x86/kernel/apic/x2apic_uv_x.c | 2 +- arch/x86/kernel/sev.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) --- a/arch/x86/hyperv/hv_vtl.c +++ b/arch/x86/hyperv/hv_vtl.c @@ -192,7 +192,7 @@ static int hv_vtl_apicid_to_vp_id(u32 ap return ret; } -static int hv_vtl_wakeup_secondary_cpu(int apicid, unsigned long start_eip) +static int hv_vtl_wakeup_secondary_cpu(u32 apicid, unsigned long start_eip) { int vp_id; --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -302,9 +302,9 @@ struct apic { u32 (*set_apic_id)(u32 apicid); /* wakeup_secondary_cpu */ - int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip); + int (*wakeup_secondary_cpu)(u32 apicid, unsigned long start_eip); /* wakeup secondary CPU using 64-bit wakeup point */ - int (*wakeup_secondary_cpu_64)(int apicid, unsigned long start_eip); + int (*wakeup_secondary_cpu_64)(u32 apicid, unsigned long start_eip); char *name; }; @@ -322,8 +322,8 @@ struct apic_override { void (*send_IPI_self)(int vector); u64 (*icr_read)(void); void (*icr_write)(u32 low, u32 high); - int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip); - int (*wakeup_secondary_cpu_64)(int apicid, unsigned long start_eip); + int (*wakeup_secondary_cpu)(u32 apicid, unsigned long start_eip); + int (*wakeup_secondary_cpu_64)(u32 apicid, unsigned long start_eip); }; /* --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -358,7 +358,7 @@ acpi_parse_lapic_nmi(union acpi_subtable } #ifdef CONFIG_X86_64 -static int acpi_wakeup_cpu(int apicid, unsigned long start_ip) +static int acpi_wakeup_cpu(u32 apicid, unsigned long start_ip) { /* * Remap mailbox memory only for the first call to acpi_wakeup_cpu(). --- a/arch/x86/kernel/apic/apic_noop.c +++ b/arch/x86/kernel/apic/apic_noop.c @@ -27,7 +27,7 @@ static void noop_send_IPI_allbutself(int static void noop_send_IPI_all(int vector) { } static void noop_send_IPI_self(int vector) { } static void noop_apic_icr_write(u32 low, u32 id) { } -static int noop_wakeup_secondary_cpu(int apicid, unsigned long start_eip) { return -1; } +static int noop_wakeup_secondary_cpu(u32 apicid, unsigned long start_eip) { return -1; } static u64 noop_apic_icr_read(void) { return 0; } static u32 noop_phys_pkg_id(u32 cpuid_apic, int index_msb) { return 0; } static u32 noop_get_apic_id(u32 apicid) { return 0; } --- a/arch/x86/kernel/apic/apic_numachip.c +++ b/arch/x86/kernel/apic/apic_numachip.c @@ -71,7 +71,7 @@ static void numachip2_apic_icr_write(int numachip2_write32_lcsr(NUMACHIP2_APIC_ICR, (apicid << 12) | val); } -static int numachip_wakeup_secondary(int phys_apicid, unsigned long start_rip) +static int numachip_wakeup_secondary(u32 phys_apicid, unsigned long start_rip) { numachip_apic_icr_write(phys_apicid, APIC_DM_INIT); numachip_apic_icr_write(phys_apicid, APIC_DM_STARTUP | --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -702,7 +702,7 @@ static __init void build_uv_gr_table(voi } } -static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip) +static int uv_wakeup_secondary(u32 phys_apicid, unsigned long start_rip) { unsigned long val; int pnode; --- a/arch/x86/kernel/sev.c +++ b/arch/x86/kernel/sev.c @@ -940,7 +940,7 @@ static void snp_cleanup_vmsa(struct sev_ free_page((unsigned long)vmsa); } -static int wakeup_cpu_via_vmgexit(int apic_id, unsigned long start_ip) +static int wakeup_cpu_via_vmgexit(u32 apic_id, unsigned long start_ip) { struct sev_es_save_area *cur_vmsa, *vmsa; struct ghcb_state state;