Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16127009rwd; Mon, 26 Jun 2023 06:11:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ595QQD2xdZWU5n9vFDnXd9ec2Kyxe7m0Yvs8B8P0LdEYXCFoIvY7gGZANeYkQrkCo34Fmc X-Received: by 2002:a17:907:da9:b0:989:7e02:2929 with SMTP id go41-20020a1709070da900b009897e022929mr14994532ejc.70.1687785080013; Mon, 26 Jun 2023 06:11:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687785079; cv=none; d=google.com; s=arc-20160816; b=FyfEg0F2h1uTCXYp9Wuoy4nx1idTrewSEu8jvQgNYv2A5t9KHEf69SDdyZ3lfrW3+e I051juw7fklbBislKk69cjvOhooyHJ2zQiigLJjHn324pcv/dBpDbCoeexzAhX+gMavo 7HknsDjkxWJSIhDsorbPxzwLSCHDLhJjEFB7Wq4VNoeZlQDQW2V4thc80Xe1iHae70mH BTDAqTZ6f0SgSLYhJ1EviS8ClpScyIeF6oC0PmQzQJ8mwp77cnRWDbwY2g2xzJHZ7/xY f3xnnKshaLDi2ZT3CrjGrB0WRAYV58n2fM+4gNIjcIQ69+ZCc+Cm9RWI7VIll7/Ugjor 7e3A== 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=9ot9Wyd9gsig12Dx11HNAHFpuCHisx7syVU708+IHPo=; fh=AkYHatYdsrQmWpYGajz3nSXlbuU6ZLB+8LXV+HIJOGs=; b=CbGjjMqUtPHB4tj2P/3flAjHxKBNEvKwvM2kKrAZ+6OTErNrkzA/LW+gTZAutLRMHT RKAvtWy2WW9x9UdPLGxXikMNDqzw5PjVYdMb4bcGevWmRz2dL7tPt6XNszbMV6CuBa14 JUybSFWgLSU2464NL14wGPYI1xOC9hdRaXGP/dpMBJnk2kO0kEVC66h4bEIlTU/XJMhJ lUcOTZIck+IHxbXE3/7uyjCG1q3B20FfCVkJA6hud0ODxPbgnZ0h7fApOc3pkkds7Cbv FwfwjK2APDJ0GMHohe4Bigs2qSlmncHSijkEC99X3A5Qe55+p5AOPEg24bdZWVpQmQYY INMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=V6KvnhdV; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dv5-20020a170906b80500b0098d73b25019si2585983ejb.724.2023.06.26.06.10.54; Mon, 26 Jun 2023 06:11:19 -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=@microchip.com header.s=mchp header.b=V6KvnhdV; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229835AbjFZNHy (ORCPT + 99 others); Mon, 26 Jun 2023 09:07:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230303AbjFZNHu (ORCPT ); Mon, 26 Jun 2023 09:07:50 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17F5198 for ; Mon, 26 Jun 2023 06:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1687784866; x=1719320866; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=72rXoisws5aoVjq6A8u6xAy4hwxZtdurVUlSFvLS0h0=; b=V6KvnhdVvvIo7Rs+yq4h+feZiY2kUC0SYzaPPlTxSugh7xv4wNDyvGRG ovHtH4WKzQOiQK9kBfMpMPFXuyGn+C3sXTEGckwBnllDTspN3Swx/JIsH tIYxLsYfms22PqALsR/KLGnUGhPIE9oYc/QRYSPb2p5tN6wTa8D1nSVH5 82ENukxMafpxmVPL2bm824IBBoIo0LBiSQ+gbOmHzI7BcLvQN1sCDpTWL HHvGoWKCrWFiWEEJRRpoqrEoTEIav6DEE5eJ65ggPVZYleilUxl7L/Guc DqKhp0KduKGwicM8jqaMYDrthAlBaN5BJFdgLS6V/HwUiJMR9CpjYTsLg g==; X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="asc'?scan'208";a="232202157" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 26 Jun 2023 06:07:44 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 26 Jun 2023 06:07:44 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Mon, 26 Jun 2023 06:07:41 -0700 Date: Mon, 26 Jun 2023 14:07:13 +0100 From: Conor Dooley To: Evan Green CC: Palmer Dabbelt , Simon Hosie , Albert Ou , Andrew Jones , Anup Patel , Greentime Hu , Guo Ren , Heiko Stuebner , Jisheng Zhang , Ley Foon Tan , Palmer Dabbelt , Paul Walmsley , Randy Dunlap , Samuel Holland , Sunil V L , , Subject: Re: [PATCH 2/2] RISC-V: alternative: Remove feature_probe_func Message-ID: <20230626-hardcopy-upchuck-7c37f1a6ef7b@wendy> References: <20230623222016.3742145-1-evan@rivosinc.com> <20230623222016.3742145-3-evan@rivosinc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dm2SjiLkQREWuB17" Content-Disposition: inline In-Reply-To: <20230623222016.3742145-3-evan@rivosinc.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 --dm2SjiLkQREWuB17 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Evan, On Fri, Jun 23, 2023 at 03:20:16PM -0700, Evan Green wrote: > Now that we're testing unaligned memory copy and making that > determination generically, there are no more users of the vendor > feature_probe_func(). While I think it's probably going to need to come > back, there are no users right now, so let's remove it until it's > needed. How come this is done as a separate patch, rather than delete the dead code as part of the probe addition? Ease of review? Change itself seems fine to me though, so Reviewed-by: Conor Dooley Cheers, Conor. >=20 > Signed-off-by: Evan Green >=20 > --- >=20 > arch/riscv/errata/thead/errata.c | 8 -------- > arch/riscv/include/asm/alternative.h | 5 ----- > arch/riscv/kernel/alternative.c | 19 ------------------- > arch/riscv/kernel/smpboot.c | 1 - > 4 files changed, 33 deletions(-) >=20 > diff --git a/arch/riscv/errata/thead/errata.c b/arch/riscv/errata/thead/e= rrata.c > index c259dc925ec1..bf42857c977f 100644 > --- a/arch/riscv/errata/thead/errata.c > +++ b/arch/riscv/errata/thead/errata.c > @@ -117,11 +117,3 @@ void thead_errata_patch_func(struct alt_entry *begin= , struct alt_entry *end, > if (stage =3D=3D RISCV_ALTERNATIVES_EARLY_BOOT) > local_flush_icache_all(); > } > - > -void thead_feature_probe_func(unsigned int cpu, > - unsigned long archid, > - unsigned long impid) > -{ > - if ((archid =3D=3D 0) && (impid =3D=3D 0)) > - per_cpu(misaligned_access_speed, cpu) =3D RISCV_HWPROBE_MISALIGNED_FAS= T; > -} > diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/as= m/alternative.h > index 6a41537826a7..58ccd2f8cab7 100644 > --- a/arch/riscv/include/asm/alternative.h > +++ b/arch/riscv/include/asm/alternative.h > @@ -30,7 +30,6 @@ > #define ALT_OLD_PTR(a) __ALT_PTR(a, old_offset) > #define ALT_ALT_PTR(a) __ALT_PTR(a, alt_offset) > =20 > -void probe_vendor_features(unsigned int cpu); > void __init apply_boot_alternatives(void); > void __init apply_early_boot_alternatives(void); > void apply_module_alternatives(void *start, size_t length); > @@ -53,15 +52,11 @@ void thead_errata_patch_func(struct alt_entry *begin,= struct alt_entry *end, > unsigned long archid, unsigned long impid, > unsigned int stage); > =20 > -void thead_feature_probe_func(unsigned int cpu, unsigned long archid, > - unsigned long impid); > - > void riscv_cpufeature_patch_func(struct alt_entry *begin, struct alt_ent= ry *end, > unsigned int stage); > =20 > #else /* CONFIG_RISCV_ALTERNATIVE */ > =20 > -static inline void probe_vendor_features(unsigned int cpu) { } > static inline void apply_boot_alternatives(void) { } > static inline void apply_early_boot_alternatives(void) { } > static inline void apply_module_alternatives(void *start, size_t length)= { } > diff --git a/arch/riscv/kernel/alternative.c b/arch/riscv/kernel/alternat= ive.c > index 6b75788c18e6..85056153fa23 100644 > --- a/arch/riscv/kernel/alternative.c > +++ b/arch/riscv/kernel/alternative.c > @@ -27,8 +27,6 @@ struct cpu_manufacturer_info_t { > void (*patch_func)(struct alt_entry *begin, struct alt_entry *end, > unsigned long archid, unsigned long impid, > unsigned int stage); > - void (*feature_probe_func)(unsigned int cpu, unsigned long archid, > - unsigned long impid); > }; > =20 > static void riscv_fill_cpu_mfr_info(struct cpu_manufacturer_info_t *cpu_= mfr_info) > @@ -43,7 +41,6 @@ static void riscv_fill_cpu_mfr_info(struct cpu_manufact= urer_info_t *cpu_mfr_info > cpu_mfr_info->imp_id =3D sbi_get_mimpid(); > #endif > =20 > - cpu_mfr_info->feature_probe_func =3D NULL; > switch (cpu_mfr_info->vendor_id) { > #ifdef CONFIG_ERRATA_SIFIVE > case SIFIVE_VENDOR_ID: > @@ -53,7 +50,6 @@ static void riscv_fill_cpu_mfr_info(struct cpu_manufact= urer_info_t *cpu_mfr_info > #ifdef CONFIG_ERRATA_THEAD > case THEAD_VENDOR_ID: > cpu_mfr_info->patch_func =3D thead_errata_patch_func; > - cpu_mfr_info->feature_probe_func =3D thead_feature_probe_func; > break; > #endif > default: > @@ -143,20 +139,6 @@ void riscv_alternative_fix_offsets(void *alt_ptr, un= signed int len, > } > } > =20 > -/* Called on each CPU as it starts */ > -void probe_vendor_features(unsigned int cpu) > -{ > - struct cpu_manufacturer_info_t cpu_mfr_info; > - > - riscv_fill_cpu_mfr_info(&cpu_mfr_info); > - if (!cpu_mfr_info.feature_probe_func) > - return; > - > - cpu_mfr_info.feature_probe_func(cpu, > - cpu_mfr_info.arch_id, > - cpu_mfr_info.imp_id); > -} > - > /* > * This is called very early in the boot process (directly after we run > * a feature detect on the boot CPU). No need to worry about other CPUs > @@ -211,7 +193,6 @@ void __init apply_boot_alternatives(void) > /* If called on non-boot cpu things could go wrong */ > WARN_ON(smp_processor_id() !=3D 0); > =20 > - probe_vendor_features(0); > _apply_alternatives((struct alt_entry *)__alt_start, > (struct alt_entry *)__alt_end, > RISCV_ALTERNATIVES_BOOT); > diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c > index e34a71b4786b..054f2d4474d0 100644 > --- a/arch/riscv/kernel/smpboot.c > +++ b/arch/riscv/kernel/smpboot.c > @@ -246,7 +246,6 @@ asmlinkage __visible void smp_callin(void) > numa_add_cpu(curr_cpuid); > set_cpu_online(curr_cpuid, 1); > check_misaligned_access(curr_cpuid); > - probe_vendor_features(curr_cpuid); > =20 > if (has_vector()) { > if (riscv_v_setup_vsize()) > --=20 > 2.34.1 >=20 --dm2SjiLkQREWuB17 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZJmNgQAKCRB4tDGHoIJi 0uZ1AQCaXD/7qRSevo8gVSDWW1BMzamB/j0Byc20k2xUgtD4WQD+J9sfr3d7bckd U0eAHnNUuxiYihEdPeHVoeLUk0n8qQ4= =4xip -----END PGP SIGNATURE----- --dm2SjiLkQREWuB17--