Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RISC-V: KVM: Set initial value of hedeleg in kvm_arch_vcpu_create()

The hedeleg may be updated by ONE_REG interface before the VCPU
is run at least once hence set the initial value of hedeleg in
kvm_arch_vcpu_create() instead of kvm_riscv_vcpu_setup_config().

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>
Link: https://lore.kernel.org/r/20250823155947.1354229-2-apatel@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>

authored by

Anup Patel and committed by
Anup Patel
83df1d64 b8d13949

+2 -1
+2 -1
arch/riscv/kvm/vcpu.c
··· 133 133 134 134 /* Mark this VCPU never ran */ 135 135 vcpu->arch.ran_atleast_once = false; 136 + 137 + vcpu->arch.cfg.hedeleg = KVM_HEDELEG_DEFAULT; 136 138 vcpu->arch.mmu_page_cache.gfp_zero = __GFP_ZERO; 137 139 bitmap_zero(vcpu->arch.isa, RISCV_ISA_EXT_MAX); 138 140 ··· 572 570 cfg->hstateen0 |= SMSTATEEN0_SSTATEEN0; 573 571 } 574 572 575 - cfg->hedeleg = KVM_HEDELEG_DEFAULT; 576 573 if (vcpu->guest_debug) 577 574 cfg->hedeleg &= ~BIT(EXC_BREAKPOINT); 578 575 }