From nobody Thu Sep 18 20:20:44 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A707AC63717 for ; Sun, 4 Dec 2022 17:57:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230364AbiLDR5B (ORCPT ); Sun, 4 Dec 2022 12:57:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230301AbiLDR4i (ORCPT ); Sun, 4 Dec 2022 12:56:38 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1994D140CD; Sun, 4 Dec 2022 09:56:38 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A909660DEB; Sun, 4 Dec 2022 17:56:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEC64C433D6; Sun, 4 Dec 2022 17:56:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670176597; bh=3s4zw9FUbpvcvaIrDkMgw4j/arxcyKwTzaA9Yi50abg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VAlh9b2i+JZ2ERHbdxOsdG4Hn4RklDiaqzlP1NAa2p1TtwTD/T3S48w+97vzyBMnC kLuDLORO6TwtcT/igy8awF+4+wQkbvZTgdZAdSP/rolXNn3nXaXcu7gbPJjdx80j9L xQICvqBMZ9As2pe/gkhltiMEox4aXp9Sjkhw/GlgqFH4Cb4InSMUMhrLRlnVfplBa6 wXJxgLBcnJC16Azl02dsmIg/DYCrTof4qfvsbf5vsP6jSwbVm16qJyE6sgbZNMP6FZ 9iOBDh5UxwPV1ESX+U7uw4LaMSJTB4E//x4e35tiaMUKhpc5MXwu57ly28J28J0gfK EzfUGwUWKbf2Q== From: Jisheng Zhang To: Palmer Dabbelt , Paul Walmsley , Albert Ou , Anup Patel , Atish Patra , Heiko Stuebner , Andrew Jones Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Subject: [PATCH v2 03/13] riscv: cpufeature: detect RISCV_ALTERNATIVES_EARLY_BOOT earlier Date: Mon, 5 Dec 2022 01:46:22 +0800 Message-Id: <20221204174632.3677-4-jszhang@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221204174632.3677-1-jszhang@kernel.org> References: <20221204174632.3677-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Now, the riscv_cpufeature_patch_func() do nothing in the stage of RISCV_ALTERNATIVES_EARLY_BOOT. We can move the detection of "early boot" stage earlier. In following patch, we will make riscv_cpufeature_patch_func() scans all ISA extensions. Signed-off-by: Jisheng Zhang Reviewed-by: Andrew Jones Reviewed-by: Heiko Stuebner --- arch/riscv/kernel/cpufeature.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 364d1fe86bea..a4d2af67e05c 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -305,6 +305,9 @@ void __init_or_module riscv_cpufeature_patch_func(struc= t alt_entry *begin, struct alt_entry *alt; u32 tmp; =20 + if (stage =3D=3D RISCV_ALTERNATIVES_EARLY_BOOT) + return; + for (alt =3D begin; alt < end; alt++) { if (alt->vendor_id !=3D 0) continue; --=20 2.37.2