From patchwork Wed Aug 2 10:21:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 129766 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp371461vqx; Wed, 2 Aug 2023 04:06:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlEed7DDrflFp+yKEvlCPGuTF5Gn7cFYlpuHolCiP29UVx1lwobo3K44uG0C/mvlzhpdnTbA X-Received: by 2002:a17:907:75ed:b0:98c:eef2:d0bc with SMTP id jz13-20020a17090775ed00b0098ceef2d0bcmr4718923ejc.12.1690974369770; Wed, 02 Aug 2023 04:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690974369; cv=none; d=google.com; s=arc-20160816; b=vpK3r/UBeizcrbd6Inrmk/UTdkyeX2O5qwc7dLP/2RMQxC2AxsdipA0uQTch0kMzO2 sg1LmdhznbZGu0NyuKvSe3nWyMZfxQEY9nTSV5VEp4RvBkU/3JobU9ICqsYCJqT15QBy bOIQ4tyrUIGc0MWfnsE2//BIl5zlTfmvUdwHvgQjlTGvE9O3P1t3fkfPIewKpSIiVtdl jddB8cT0Ma1z1jPl+m/fbpwLFqOIqV+gb59QSlw8+GnVVgTjZjsQ5fqFmN23Wb6KSPGQ AHbclv7D5nwWb3e3+Tw/3RDgvlSCK1vq1AvBAbb5HO2LfIgo7EzOgxBOOEZfvcWH5wYs nesQ== 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=FP9+8UUFC+luO8OcXcamwcORXtn0BV1u0AzA92zNiiM=; fh=O9JPtEgoXN20WvvffwC9vht4C9mlV4cjm0SKbEbqoG0=; b=nfWG4tOWGcbuhv6bfn9GUXa4+vpruI3v0dHQAzuUgVgoQSelFFRDz0V66nrdCcwLd6 UmChvmFouRHCYvic54byXmJ8sbbwrRgPwK+OTY2p6S+TboMygttZXVKegsI9LAdgEkYI 9iI+n6CRjZIoh0NNbEPRG7RlPnWlV3qvClccR2kUSJ1x570l+tYu42Hxt28AnpJlZsIT oZaouHZhEyvrIgk+4Drm3O29CD16Km6sIbr2oJiBimNNp7Q4MCyForKZZC5amsWKoLHb 62j2BNOkxp5Y712VNp+HXOrsBsSBdeRwVgYVo382hZrjj3oqrzsd1/7svmpP2sr+CZBC Kn5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UDCJRsY7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=LaJQ2tpY; 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 z13-20020a170906240d00b0098e1bbc3db1si1686559eja.791.2023.08.02.04.05.35; Wed, 02 Aug 2023 04:06:09 -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=UDCJRsY7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=LaJQ2tpY; 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 S233242AbjHBKXN (ORCPT + 99 others); Wed, 2 Aug 2023 06:23:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233853AbjHBKWN (ORCPT ); Wed, 2 Aug 2023 06:22:13 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 822423AAC for ; Wed, 2 Aug 2023 03:21:30 -0700 (PDT) Message-ID: <20230802101933.795537847@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690971688; 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=FP9+8UUFC+luO8OcXcamwcORXtn0BV1u0AzA92zNiiM=; b=UDCJRsY7xOVZbTBSPNlunJ//MLMPSDlgWamRSnfet3Ux04wyTu5jssrf8jdkHWYVOgW+rC s2xNNGbbhtGb56yaN5uAu3AfRN6ho5xbtHNRqgbqs7HkSqpuSvmUuE7BuU5QQ4RsXIe+GJ 5arFZ75TVbvINPEo95LUQTOeZ+mxoDKrmY0eKxw6jsW3EOwGrxz+xDl3elvG9YzN2HkSkp IYaLtPdrNBACqRsfLIYoxeGaT1Nb2YCw24yjBI8721mVBFymCfbWnspU3AHhn1VVgYE+Pm j+eKHDpalWZrUMZOnsBQskSgf+94NashZJOLemgzmsXDAJfMIZpkaBNNsSq9/Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690971688; 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=FP9+8UUFC+luO8OcXcamwcORXtn0BV1u0AzA92zNiiM=; b=LaJQ2tpYz3IyuBmlFAxSP60yNvYYwbJ9ZgyaRBkkTvTOBCG0Cpk2sBYchDjtCkUITl8+Rc fJ6z2KYt30ISm+CQ== 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 19/40] x86/apic: Use u32 for wakeup_secondary_cpu[_64]() References: <20230802101635.459108805@linutronix.de> MIME-Version: 1.0 Date: Wed, 2 Aug 2023 12:21:27 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773115140286055474 X-GMAIL-MSGID: 1773115140286055474 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 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;