summaryrefslogtreecommitdiff
path: root/arch/riscv/kvm/vcpu_sbi_pmu.c
diff options
context:
space:
mode:
authorAtish Patra <atishp@rivosinc.com>2024-04-20 18:17:28 +0300
committerAnup Patel <anup@brainfault.org>2024-04-26 10:43:46 +0300
commit2196c066f13861919a83b3b3ffda08a79cf87bdd (patch)
tree463ecb64c49689f627f682c2b4a7db2a16855dcf /arch/riscv/kvm/vcpu_sbi_pmu.c
parent98ce906bd0a64b59da894263b1ce0d2c19c70893 (diff)
downloadlinux-2196c066f13861919a83b3b3ffda08a79cf87bdd.tar.xz
RISC-V: KVM: No need to exit to the user space if perf event failed
Currently, we return a linux error code if creating a perf event failed in kvm. That shouldn't be necessary as guest can continue to operate without perf profiling or profiling with firmware counters. Return appropriate SBI error code to indicate that PMU configuration failed. An error message in kvm already describes the reason for failure. Fixes: 0cb74b65d2e5 ("RISC-V: KVM: Implement perf support without sampling") Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Atish Patra <atishp@rivosinc.com> Link: https://lore.kernel.org/r/20240420151741.962500-13-atishp@rivosinc.com Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'arch/riscv/kvm/vcpu_sbi_pmu.c')
-rw-r--r--arch/riscv/kvm/vcpu_sbi_pmu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/riscv/kvm/vcpu_sbi_pmu.c b/arch/riscv/kvm/vcpu_sbi_pmu.c
index 7eca72df2cbd..e1633606c98b 100644
--- a/arch/riscv/kvm/vcpu_sbi_pmu.c
+++ b/arch/riscv/kvm/vcpu_sbi_pmu.c
@@ -42,9 +42,9 @@ static int kvm_sbi_ext_pmu_handler(struct kvm_vcpu *vcpu, struct kvm_run *run,
#endif
/*
* This can fail if perf core framework fails to create an event.
- * Forward the error to userspace because it's an error which
- * happened within the host kernel. The other option would be
- * to convert to an SBI error and forward to the guest.
+ * No need to forward the error to userspace and exit the guest.
+ * The operation can continue without profiling. Forward the
+ * appropriate SBI error to the guest.
*/
ret = kvm_riscv_vcpu_pmu_ctr_cfg_match(vcpu, cp->a0, cp->a1,
cp->a2, cp->a3, temp, retdata);