Re: [PATCH v3 4/9] KVM: arm64: Discard a pending SError when resetting a vcpu

From: Steffen Eiden

Date: Mon Nov 30 2026 - 08:38:58 EST


On Mon, Nov 30, 2026 at 11:48:16AM +0300, Dan Carpenter wrote:
> Resetting a vcpu with the KVM_ARM_VCPU_INIT ioctl keeps a pending
> SError. We used to rely on vcpu_reset_hcr() to clear the SError but
> commit f1ff3fc5209a ("KVM: arm64: unify code to prepare traps") changed
> it to only reset HCR_EL2 before the vcpu's very first KVM_RUN.
>
> If we reboot a guest while there is a pending SError then KVM delivers
> it to the freshly booted guest.
>
> Clear HCR_EL2.VSE in kvm_reset_vcpu().
>
> Fixes: f1ff3fc5209a ("KVM: arm64: unify code to prepare traps")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Dan Carpenter <dan@xxxxxxxx>

Reviewed-by: Steffen Eiden <seiden@xxxxxxxxxxxxx>