From fe4fdd2c849652a1eaf5a88abe03a02f93d0ed94 Mon Sep 17 00:00:00 2001 From: Atish Patra Date: Thu, 15 May 2025 15:06:05 -0700 Subject: [PATCH] RISC-V: KVM: Remove scounteren initialization Scounteren CSR controls the direct access the hpmcounters and cycle/ instret/time from the userspace. It's the supervisor's responsibility to set it up correctly for it's user space. They hypervisor doesn't need to decide the policy on behalf of the supervisor. Signed-off-by: Atish Patra Signed-off-by: Linux RISC-V bot --- arch/riscv/kvm/vcpu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/riscv/kvm/vcpu.c b/arch/riscv/kvm/vcpu.c index 60d684c76c5873..fa3713b5a41b6f 100644 --- a/arch/riscv/kvm/vcpu.c +++ b/arch/riscv/kvm/vcpu.c @@ -146,9 +146,6 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) if (kvm_riscv_vcpu_alloc_vector_context(vcpu, cntx)) return -ENOMEM; - /* By default, make CY, TM, and IR counters accessible in VU mode */ - reset_csr->scounteren = 0x7; - /* Setup VCPU timer */ kvm_riscv_vcpu_timer_init(vcpu);