RISC-V: Do no continue isa string parsing without correct XLEN
authorAtish Patra <atishp@rivosinc.com>
Wed, 9 Feb 2022 07:46:07 +0000 (23:46 -0800)
committerminda.chen <minda.chen@starfivetech.com>
Tue, 3 Jan 2023 06:26:17 +0000 (14:26 +0800)
commite80193abdfc06372234496e3d4b7b0cba915bcd9
treef80856813f847ede9456cf7bad327473d3630e2f
parent6c8ec1267ed8a95c44e53b09f70ba037ed45a554
RISC-V: Do no continue isa string parsing without correct XLEN

The isa string should begin with either rv64 or rv32. Otherwise, it is
an incorrect isa string. Currently, the string parsing continues even if
it doesnot begin with current XLEN.

Fix this by checking if it found "rv64" or "rv32" in the beginning.

Signed-off-by: Atish Patra <atishp@rivosinc.com>
arch/riscv/kernel/cpufeature.c