]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/riscv: Set vtype.vill on CPU reset
authorRob Bradford <rbradford@rivosinc.com>
Mon, 30 Sep 2024 16:52:57 +0000 (17:52 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 10 Nov 2024 08:09:26 +0000 (11:09 +0300)
The RISC-V unprivileged specification "31.3.11. State of Vector
Extension at Reset" has a note that recommends vtype.vill be set on
reset as part of ensuring that the vector extension have a consistent
state at reset.

This change now makes QEMU consistent with Spike which sets vtype.vill
on reset.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20240930165258.72258-1-rbradford@rivosinc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
(cherry picked from commit f8c1f36a2e3dab4935e7c5690e578ac71765766b)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/riscv/cpu.c

index 776f3778495b1a2dcaaca3a113e2638fc7d3bce5..a9483ced9237b2fae74492eead8ffeb232f7a848 100644 (file)
@@ -1006,6 +1006,7 @@ static void riscv_cpu_reset_hold(Object *obj)
     cs->exception_index = RISCV_EXCP_NONE;
     env->load_res = -1;
     set_default_nan_mode(1, &env->fp_status);
+    env->vill = true;
 
 #ifndef CONFIG_USER_ONLY
     if (cpu->cfg.debug) {