Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4914351rwb; Tue, 8 Aug 2023 16:33:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0H1HB3Pbg98gfgTgRnqchk7dkg2oi3nx1PZ3QJ2DwBF0Uacae2nIEy4lpwYvl1gpz41gk X-Received: by 2002:a17:907:7817:b0:992:2f67:cd34 with SMTP id la23-20020a170907781700b009922f67cd34mr1500581ejc.22.1691537603365; Tue, 08 Aug 2023 16:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691537603; cv=none; d=google.com; s=arc-20160816; b=nM/lvaEaOJOn03oTCTO57nKJOQSwA4U+Z7sJxsxUEt/UT5sWsYp5/PdnS95JKXDm5T P9oSSh3nmBKex8bFgxJPPqw1fZj7NXts6hzhLlRCokm5bIqHwNj8gsSqWz3oXpOsDlg5 1Gxmxz5C2x1xGy3WspFqD6mmaT2LZzoe3iobTtD/2fiXKPUGER5nJqI5843O8oIDzm47 RZg24aaXpWj12SJ/acf3a6hKff4S4dt/rcbFIzL1v36Fcz9JY8zgPHHeOkwYnIFwyC1L dAG0JxLyxMXY2aRckO/ZU5IDoloyDlbGcSkxdIV5JvB3gcnyRku6bTbuVqFPMa+zQRpz I7Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9vJT8bKhEAnOfhS+ZgqFuvvCuPXRd+QjwmyH8Jc1q3g=; fh=poZkUoX83JE/4AwO8P05HQ/kd6ksrpQjha7BNtj7wqI=; b=GeHfZU6LgVo+FewOKj0e1AV9xeL7OF2g+D+5QbDIV+SGvs5dM2mTq05H/e2iCmu/hT lFDl7Ywf+2WNH1eHbZ56QPc5JArcDz6lgL7RdnVIrcwn6h8rbvgt2M3I5T8o8Qs3Wxqf 6tB/dOqXInf/ZY47d4lQJrU8juTLrnoUyzrsNNtDlYw9Wl+6u4v4NPSX9Rd1urBnMwaQ VD03lVoO+OoK21v5Az2BEsSpDOCzDs29LYZ64nAmsoVTUdB8zxoXBo0npGC3p3WHngt2 sx1KlwXDv7gRE5oA4ZDqar6f+KxrNo49AO/wW1/9b2pPAHwy52VMmh20yUVL97oNxtP+ x6uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=n7mYzI93; 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=NONE dis=NONE) header.from=hpe.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx11-20020a170906af0b00b0098718777182si8563740ejb.685.2023.08.08.16.32.56; Tue, 08 Aug 2023 16:33:23 -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=@hpe.com header.s=pps0720 header.b=n7mYzI93; 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=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233779AbjHHU67 (ORCPT + 99 others); Tue, 8 Aug 2023 16:58:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235747AbjHHUme (ORCPT ); Tue, 8 Aug 2023 16:42:34 -0400 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70FCB1258E; Tue, 8 Aug 2023 13:16:02 -0700 (PDT) Received: from pps.filterd (m0134423.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 378DSu0T015121; Tue, 8 Aug 2023 20:14:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pps0720; bh=9vJT8bKhEAnOfhS+ZgqFuvvCuPXRd+QjwmyH8Jc1q3g=; b=n7mYzI93w3IbvBYaqPT9utujnGzVbDQiEuAaCcow6nI2dWHOKFjDaoNR6MRlVAtr7D5Y +LaGUV0DIIWLZM7A1sFtzpxNG8meumV3fOheO4ubsuNI8GLfUXBlSOAGsljLULPdMtWq MTX4abNXnYkghRTncpnoXai7ivzP0hw/4UU0O0x9Nlsda9DX+gW4ZgbzVIJf32FNJxu+ 9y/gGg8nAX8ODih8a5vjlclRAhAUf7tuko/elstIxVxmrMaxLp24XWYCOhfy9HJjjYpQ 0pw/yuL9yYa57a9IZfFffwgS1L+c7kAPh0sIixgJFgrmnGInBQfRIwTmgdmQt2Nf9KKq xQ== Received: from p1lg14878.it.hpe.com ([16.230.97.204]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3sbpmfucm9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Aug 2023 20:14:55 +0000 Received: from p1lg14886.dc01.its.hpecorp.net (unknown [10.119.18.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14878.it.hpe.com (Postfix) with ESMTPS id CEFBDD2E4; Tue, 8 Aug 2023 20:14:53 +0000 (UTC) Received: from swahl-home.5wahls.com (unknown [16.231.227.36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by p1lg14886.dc01.its.hpecorp.net (Postfix) with ESMTPS id 67AF4810631; Tue, 8 Aug 2023 20:14:51 +0000 (UTC) Date: Tue, 8 Aug 2023 15:14:49 -0500 From: Steve Wahl To: Thomas Gleixner Cc: LKML , x86@kernel.org, Tom Lendacky , Andrew Cooper , Arjan van de Ven , "James E.J. Bottomley" , Dick Kennedy , James Smart , "Martin K. Petersen" , linux-scsi@vger.kernel.org, Guenter Roeck , linux-hwmon@vger.kernel.org, Jean Delvare , Huang Rui , Juergen Gross , Steve Wahl , Dimitri Sivanich , Russ Anderson Subject: Re: [patch v2 15/38] x86/apic: Use u32 for phys_pkg_id() Message-ID: References: <20230728105650.565799744@linutronix.de> <20230728120930.507111034@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230728120930.507111034@linutronix.de> X-Proofpoint-GUID: ySsGeZcIcooai50K8DVW75TnHWC7cPWo X-Proofpoint-ORIG-GUID: ySsGeZcIcooai50K8DVW75TnHWC7cPWo X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-08_18,2023-08-08_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=999 bulkscore=0 priorityscore=1501 impostorscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 malwarescore=0 clxscore=1011 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308080179 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,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 Reviewed-by: Steve Wahl On Fri, Jul 28, 2023 at 02:13:01PM +0200, Thomas Gleixner wrote: > 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 even if that callback going to be removed soonish. > > Signed-off-by: Thomas Gleixner > --- > arch/x86/include/asm/apic.h | 2 +- > arch/x86/kernel/apic/apic_flat_64.c | 2 +- > arch/x86/kernel/apic/apic_noop.c | 2 +- > arch/x86/kernel/apic/apic_numachip.c | 2 +- > arch/x86/kernel/apic/bigsmp_32.c | 2 +- > arch/x86/kernel/apic/local.h | 2 +- > arch/x86/kernel/apic/probe_32.c | 2 +- > arch/x86/kernel/apic/x2apic_phys.c | 2 +- > arch/x86/kernel/apic/x2apic_uv_x.c | 2 +- > arch/x86/kernel/vsmp_64.c | 2 +- > arch/x86/xen/apic.c | 2 +- > 11 files changed, 11 insertions(+), 11 deletions(-) > > --- a/arch/x86/include/asm/apic.h > +++ b/arch/x86/include/asm/apic.h > @@ -296,7 +296,7 @@ struct apic { > void (*init_apic_ldr)(void); > void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap); > u32 (*cpu_present_to_apicid)(int mps_cpu); > - int (*phys_pkg_id)(int cpuid_apic, int index_msb); > + u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb); > > u32 (*get_apic_id)(unsigned long x); > u32 (*set_apic_id)(unsigned int id); > --- a/arch/x86/kernel/apic/apic_flat_64.c > +++ b/arch/x86/kernel/apic/apic_flat_64.c > @@ -66,7 +66,7 @@ static u32 set_apic_id(unsigned int id) > return (id & 0xFF) << 24; > } > > -static int flat_phys_pkg_id(int initial_apic_id, int index_msb) > +static u32 flat_phys_pkg_id(u32 initial_apic_id, int index_msb) > { > return initial_apic_id >> index_msb; > } > --- a/arch/x86/kernel/apic/apic_noop.c > +++ b/arch/x86/kernel/apic/apic_noop.c > @@ -29,7 +29,7 @@ static void noop_send_IPI_self(int vecto > 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 u64 noop_apic_icr_read(void) { return 0; } > -static int noop_phys_pkg_id(int cpuid_apic, int index_msb) { return 0; } > +static u32 noop_phys_pkg_id(u32 cpuid_apic, int index_msb) { return 0; } > static unsigned int noop_get_apic_id(unsigned long x) { return 0; } > static void noop_apic_eoi(void) { } > > --- a/arch/x86/kernel/apic/apic_numachip.c > +++ b/arch/x86/kernel/apic/apic_numachip.c > @@ -56,7 +56,7 @@ static u32 numachip2_set_apic_id(unsigne > return id << 24; > } > > -static int numachip_phys_pkg_id(int initial_apic_id, int index_msb) > +static u32 numachip_phys_pkg_id(u32 initial_apic_id, int index_msb) > { > return initial_apic_id >> index_msb; > } > --- a/arch/x86/kernel/apic/bigsmp_32.c > +++ b/arch/x86/kernel/apic/bigsmp_32.c > @@ -29,7 +29,7 @@ static void bigsmp_ioapic_phys_id_map(ph > physids_promote(0xFFL, retmap); > } > > -static int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb) > +static u32 bigsmp_phys_pkg_id(u32 cpuid_apic, int index_msb) > { > return cpuid_apic >> index_msb; > } > --- a/arch/x86/kernel/apic/local.h > +++ b/arch/x86/kernel/apic/local.h > @@ -17,7 +17,7 @@ > void __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest); > unsigned int x2apic_get_apic_id(unsigned long id); > u32 x2apic_set_apic_id(unsigned int id); > -int x2apic_phys_pkg_id(int initial_apicid, int index_msb); > +u32 x2apic_phys_pkg_id(u32 initial_apicid, int index_msb); > > void x2apic_send_IPI_all(int vector); > void x2apic_send_IPI_allbutself(int vector); > --- a/arch/x86/kernel/apic/probe_32.c > +++ b/arch/x86/kernel/apic/probe_32.c > @@ -18,7 +18,7 @@ > > #include "local.h" > > -static int default_phys_pkg_id(int cpuid_apic, int index_msb) > +static u32 default_phys_pkg_id(u32 cpuid_apic, int index_msb) > { > return cpuid_apic >> index_msb; > } > --- a/arch/x86/kernel/apic/x2apic_phys.c > +++ b/arch/x86/kernel/apic/x2apic_phys.c > @@ -134,7 +134,7 @@ u32 x2apic_set_apic_id(unsigned int id) > return id; > } > > -int x2apic_phys_pkg_id(int initial_apicid, int index_msb) > +u32 x2apic_phys_pkg_id(u32 initial_apicid, int index_msb) > { > return initial_apicid >> index_msb; > } > --- a/arch/x86/kernel/apic/x2apic_uv_x.c > +++ b/arch/x86/kernel/apic/x2apic_uv_x.c > @@ -790,7 +790,7 @@ static unsigned int uv_read_apic_id(void > return x2apic_get_apic_id(apic_read(APIC_ID)); > } > > -static int uv_phys_pkg_id(int initial_apicid, int index_msb) > +static u32 uv_phys_pkg_id(u32 initial_apicid, int index_msb) > { > return uv_read_apic_id() >> index_msb; > } > --- a/arch/x86/kernel/vsmp_64.c > +++ b/arch/x86/kernel/vsmp_64.c > @@ -127,7 +127,7 @@ static void __init vsmp_cap_cpus(void) > #endif > } > > -static int apicid_phys_pkg_id(int initial_apic_id, int index_msb) > +static u32 apicid_phys_pkg_id(u32 initial_apic_id, int index_msb) > { > return read_apic_id() >> index_msb; > } > --- a/arch/x86/xen/apic.c > +++ b/arch/x86/xen/apic.c > @@ -110,7 +110,7 @@ static int xen_madt_oem_check(char *oem_ > return xen_pv_domain(); > } > > -static int xen_phys_pkg_id(int initial_apic_id, int index_msb) > +static u32 xen_phys_pkg_id(u32 initial_apic_id, int index_msb) > { > return initial_apic_id >> index_msb; > } > -- Steve Wahl, Hewlett Packard Enterprise