Skip to contentSkip to conversation

target/riscv/cpu.c: Fix elen check

PATCH Applied ~elta 2 participants 2 messages Dec 30, 2022 – Jan 9, 2023 RISC-V

lore
Share & tools
lore

~elta

author
#0 lore raw

PATCH 1/1 target/riscv/cpu.c: Fix elen check

From: Dongxue Zhang <[email protected]>

Should be cpu->cfg.elen in range [8, 64].

Message-ID: <[email protected]>

Message-ID: <CANzO1D0du4TSza=-bnqZ+N9cGVfZ6P4xwYaiJg6doTzo7_MdYg@mail.gmail.com>

---
 target/riscv/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/riscv/cpu.c +1 -1
index 6fe176e483..5dc51f7912 100644
@@ -872,7 +872,7 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
                         "Vector extension ELEN must be power of 2");
                 return;
             }
-            if (cpu->cfg.elen > 64 || cpu->cfg.vlen < 8) {
+            if (cpu->cfg.elen > 64 || cpu->cfg.elen < 8) {
                 error_setg(errp,
                         "Vector extension implementation only supports ELEN "
                         "in the range [8, 64]");
Signature · 1 line
2.34.5
Reviewed-by on v1 1/1 Applied
#1 lore raw
Quoted 10 lines · ~elta

From: Dongxue Zhang <[email protected]>

Should be cpu->cfg.elen in range [8, 64].

Message-ID: <[email protected]>

Message-ID: <CANzO1D0du4TSza=-bnqZ+N9cGVfZ6P4xwYaiJg6doTzo7_MdYg@mail.gmail.com>

Thanks!

Applied to riscv-to-apply.next

Alistair

Quoted 19 lines
---
 target/riscv/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/riscv/cpu.c +1 -2
index 6fe176e483..5dc51f7912 100644
@@ -872,7 +872,7 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
                         "Vector extension ELEN must be power of 2");
                 return;
             }
-            if (cpu->cfg.elen > 64 || cpu->cfg.vlen < 8) {
+            if (cpu->cfg.elen > 64 || cpu->cfg.elen < 8) {
                 error_setg(errp,
                         "Vector extension implementation only supports ELEN "
                         "in the range [8, 64]");
--

2.34.5