[RFC PATCH] kvm/riscv: Add ctxsstatus and ctxhstatus for migration

Radim Krčmář rkrcmar at ventanamicro.com
Mon Sep 15 10:01:03 PDT 2025


2025-09-15T18:52:56+02:00, Radim Krčmář <rkrcmar at ventanamicro.com>:
> 2025-09-15T23:27:31+08:00, Jinyu Tang <tjytimi at 163.com>:
>> +	if (reg_num == KVM_REG_RISCV_CSR_REG(ctxhstatus))
>> +		csr->ctxhstatus = vcpu->arch.guest_context.hstatus;
>
> Neither should userspace be able to directly set hstatus.
> KVM should derive it from other userspace configuration.
>
> What isn't correctly reflected in hstatus?

Ah, we don't set hstatus.SPVP when setting KVM_REG_RISCV_CORE_REG(mode).



More information about the linux-riscv mailing list