]> 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)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 5 Jun 2024 10:01:22 +0000 (13:01 +0300)
commit2ae8e12964a5622bd74e89c1845b42ab475deefa
tree7b7701c1120d7d18cbf708d067d7e50f5032f196
parent8d664e5bc24d1ec382a73679762a082bf313e12f
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>
(cherry picked from commit 86997772fa807f3961e5aeed97af7738adec1b43)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/riscv/cpu.h
target/riscv/csr.c
target/riscv/kvm/kvm-cpu.c