]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
target/riscv/cpu.c: Fix elen check
authorDongxue Zhang <elta.era@gmail.com>
Thu, 15 Dec 2022 08:27:14 +0000 (16:27 +0800)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 20 Jan 2023 00:14:13 +0000 (10:14 +1000)
The elen check should be cpu->cfg.elen in range [8, 64].

Signed-off-by: Dongxue Zhang <elta.era@gmail.com>
Reviewed-by: LIU Zhiwei <zhiwe_liu@linux.alibaba.com>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <167236721596.15277.2653405273227256289-0@git.sr.ht>
[ Changes by AF:
 - Tidy up commit message
]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu.c

index cc75ca76677ff9a626fb8042c93e769ddc286761..a2e6238bd74a79ff90f0e52dc3527c635d45cbcc 100644 (file)
@@ -882,7 +882,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]");