]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/riscv/kvm: Fix exposure of Zkr
authorAndrew Jones <ajones@ventanamicro.com>
Mon, 22 Apr 2024 13:46:06 +0000 (15:46 +0200)
committerAlistair Francis <alistair.francis@wdc.com>
Mon, 3 Jun 2024 01:12:11 +0000 (11:12 +1000)
commit86997772fa807f3961e5aeed97af7738adec1b43
treeb66356b1fd5b628caace09c76776f065c8bafd74
parentc76b121840c6ca79dc6305a5f4bcf17c72217d9c
target/riscv/kvm: Fix exposure of Zkr

The Zkr extension may only be exposed to KVM guests if the VMM
implements the SEED CSR. Use the same implementation as TCG.

Without this patch, running with a KVM which does not forward the
SEED CSR access to QEMU will result in an ILL exception being
injected into the guest (this results in Linux guests crashing on
boot). And, when running with a KVM which does forward the access,
QEMU will crash, since QEMU doesn't know what to do with the exit.

Fixes: 3108e2f1c69d ("target/riscv/kvm: update KVM exts to Linux 6.8")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Cc: qemu-stable <qemu-stable@nongnu.org>
Message-ID: <20240422134605.534207-2-ajones@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu.h
target/riscv/csr.c
target/riscv/kvm/kvm-cpu.c