From patchwork Wed Jul 5 16:48:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evan Green X-Patchwork-Id: 116251 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2001764vqx; Wed, 5 Jul 2023 09:54:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7JNzrbxEz5Hk9ufVadcf8TrhV3ojs5ObQ9MIG8s0IRWS2md78aIj7NjKhOxuK6wbajOT07 X-Received: by 2002:a05:6a20:42a8:b0:117:3c00:77da with SMTP id o40-20020a056a2042a800b001173c0077damr17606251pzj.20.1688576087761; Wed, 05 Jul 2023 09:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688576087; cv=none; d=google.com; s=arc-20160816; b=0hj/H9licz+0pHiN4l60eQlM40s4lGaq4mu68ILiFDf3uD0ijijk6Q6Ne/mP3hw7QU feSkSTT9k4BqsDzxLyQBa8kfCfUfhPsnuGaQiaXPALa6oSwjJnLKq3nYs1zNeBCB8x4B q48lwZST2q9UuLAE2Hqr0EB05QryCABdKNif+f5/BAFwgAfyVL0NKAIK78ntEHxqOttH jCTUDXTAdxoNJHO1tgMa35sLuY4Kz2USYlMspXNRJFGWxOB+m+F+X5yjFDF9+fqHVT1t POREkrr4kjq5dUBqGBnNlIIK9nx2OLUKhJhm+08iViMM7kyeSdraOr2ZDiSMSL4FmjLe dNow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hDbRxqeQX7M4hcwE0tEW6t4p3GcfRTOd9CeEJa4kMJw=; fh=8QkAzRaAO7LCM6mnoSSBTx3ASwVC+VIIeZEmYpkwQlU=; b=Brw38pRvQIUD6n+itIJNVeUnxmgSdeNaBMCNeI47H3Op1gZuLgAA9r1dgzG7QgNWM9 0mjdoZm5p9clBKa24vXKSRVXQXsx16YmJkqGbknG2TIGXPvPx5KzFPsoRPOU9EvyZay5 eYAHYaNMcwT7TgzO7acutxQBYZyf9a1JPAPIfW+i5/P96kRfqoumb5XYXRR6UJ02GuHb wa3RwIUCZE0401fk6J0E32Dpb9Uu4RKn5IJbK12d/IC4AkD4P2pCQamS3ZkQMH9HHnqL Nr8/P8hvdlgXXiftRBCLk8+52ek3fdauQ2UwDgen8JZh7b6SK1iC+Wi4jbaF66yb63/Q EQ4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=L6DgCcfw; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v10-20020a63610a000000b0055bce775e67si2980076pgb.159.2023.07.05.09.54.33; Wed, 05 Jul 2023 09:54:47 -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=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=L6DgCcfw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230178AbjGEQtA (ORCPT + 99 others); Wed, 5 Jul 2023 12:49:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232424AbjGEQsv (ORCPT ); Wed, 5 Jul 2023 12:48:51 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E6A210C3 for ; Wed, 5 Jul 2023 09:48:50 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-55adfa72d3fso3360925a12.3 for ; Wed, 05 Jul 2023 09:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1688575730; x=1691167730; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hDbRxqeQX7M4hcwE0tEW6t4p3GcfRTOd9CeEJa4kMJw=; b=L6DgCcfwQAvkkZgZKpzmOOFy0RVzvBNnitf9FI5/KEiTh9tNZCFMVolsJSeV1k34aA knTQmUZj4irEsi5LGcRe0F8J+DxLsGSXNplIHFESpN3kr4UBUWvCpn5PvnEaYw5Pf3sZ pFNyVVkNHQJPXKYFqU5lAJartCkEtJU2NnFuaWYdLHbfMl9uoBEVqpfK6oIIZCDMHcA1 gABNtLjOo2UIMoaaydH/oiNCfuwGeNRIV2G+HKuwvGqD+tB0m9X2WC964V/hq19ANoIY ErGwjlI/IzV5/qmtQ0OKW7OkLGt1f1D/7eLb9clB35GYpZvdVCMSSm7qvlCNCAsKvUAl Sbbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688575730; x=1691167730; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hDbRxqeQX7M4hcwE0tEW6t4p3GcfRTOd9CeEJa4kMJw=; b=KGT3EvpSIiNuZFEJP9Drb/7KFMlFfyE/O1m8nxGZr1lGSS6QJdFMX+veWmFgTj89xr WvDv0jlmpHQ+FiHcBACEgmvMnVXt6ZR4NbzTT5VinYzJ197Gw6/j1y/LBmYBKevLoFcX jAIM6/FPStD7DPQSKydCdqI7iX2MT9L0imV+9UGtSHLkNDFenBIp7gQwt60HtRCGGPzI 39HQfmkqGxNZiXxWmNRI6uB/73HBHCqV9FmX/Szub9caZ8jLC5yXRiY8z6BFyGGKFr/c MXKw0KZgK3pW9W/8SkPy9GwkTbHBCFKLKqGzc1IfT0o4MOPqJ56QtL97s2cOJcmSgYWB fb7Q== X-Gm-Message-State: ABy/qLa3kFVh+go8qNkhyLnjRqM950q7Wuw0LpHX9f2zsYVQt9moh2cT kx6hV15E6vhqXHgJv7vxnEqXuQ== X-Received: by 2002:a17:90a:4cc6:b0:262:b6aa:8ab5 with SMTP id k64-20020a17090a4cc600b00262b6aa8ab5mr12235802pjh.41.1688575729732; Wed, 05 Jul 2023 09:48:49 -0700 (PDT) Received: from evan.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id f21-20020a17090ace1500b00263f85b6a35sm1311431pju.29.2023.07.05.09.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jul 2023 09:48:49 -0700 (PDT) From: Evan Green To: Palmer Dabbelt Cc: Simon Hosie , David Laight , Evan Green , Conor Dooley , Albert Ou , Andrew Jones , Anup Patel , Greentime Hu , Guo Ren , Heiko Stuebner , Jisheng Zhang , Ley Foon Tan , Marc Zyngier , Palmer Dabbelt , Paul Walmsley , Randy Dunlap , Samuel Holland , Sunil V L , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 2/2] RISC-V: alternative: Remove feature_probe_func Date: Wed, 5 Jul 2023 09:48:33 -0700 Message-Id: <20230705164833.995516-3-evan@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230705164833.995516-1-evan@rivosinc.com> References: <20230705164833.995516-1-evan@rivosinc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770600360099986044?= X-GMAIL-MSGID: =?utf-8?q?1770600360099986044?= 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. Signed-off-by: Evan Green Reviewed-by: Conor Dooley --- (no changes since v1) 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(-) diff --git a/arch/riscv/errata/thead/errata.c b/arch/riscv/errata/thead/errata.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 == RISCV_ALTERNATIVES_EARLY_BOOT) local_flush_icache_all(); } - -void thead_feature_probe_func(unsigned int cpu, - unsigned long archid, - unsigned long impid) -{ - if ((archid == 0) && (impid == 0)) - per_cpu(misaligned_access_speed, cpu) = RISCV_HWPROBE_MISALIGNED_FAST; -} diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/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) -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); -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_entry *end, unsigned int stage); #else /* CONFIG_RISCV_ALTERNATIVE */ -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/alternative.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); }; 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_manufacturer_info_t *cpu_mfr_info cpu_mfr_info->imp_id = sbi_get_mimpid(); #endif - cpu_mfr_info->feature_probe_func = 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_manufacturer_info_t *cpu_mfr_info #ifdef CONFIG_ERRATA_THEAD case THEAD_VENDOR_ID: cpu_mfr_info->patch_func = thead_errata_patch_func; - cpu_mfr_info->feature_probe_func = thead_feature_probe_func; break; #endif default: @@ -143,20 +139,6 @@ void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len, } } -/* 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() != 0); - 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 00ddbd2364dc..1b8da4e40a4d 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -247,7 +247,6 @@ asmlinkage __visible void smp_callin(void) numa_add_cpu(curr_cpuid); set_cpu_online(curr_cpuid, 1); check_unaligned_access(curr_cpuid); - probe_vendor_features(curr_cpuid); if (has_vector()) { if (riscv_v_setup_vsize())