[PATCH v2 0/6] KVM/x86: Drop "1" as MSR emulation return value
From: Juergen Gross
Date: Thu May 28 2026 - 07:43:22 EST
Get rid of the literal "1" used as general error return value in KVM
MSR emulation. It can easily be replaced by negative errno values
instead.
This is meant to avoid confusion with the literal "1" used as return
value for "return to guest".
Changes in V2:
- series carved out from initial "KVM: Avoid literal numbers as return
values" series
- don't use new KVM_MSR_RET_* defines, but 0 and -errno
Juergen Gross (6):
KVM/x86: Change comment before KVM_MSR_RET_* defines
KVM/x86: Return -errno instead of "1" for APIC related MSR emulation
KVM/x86: Return -errno instead of "1" for Hyper-V related MSR
emulation
KVM/x86: Return -errno instead of "1" for VMX related MSR emulation
KVM/x86: Return -errno instead of "1" for SVM related MSR emulation
KVM/x86: Return -errno instead of "1" for common MSR emulation
arch/x86/kvm/hyperv.c | 72 ++++++++++++-------------
arch/x86/kvm/lapic.c | 39 +++++++-------
arch/x86/kvm/mtrr.c | 6 +--
arch/x86/kvm/pmu.c | 8 +--
arch/x86/kvm/svm/pmu.c | 4 +-
arch/x86/kvm/svm/svm.c | 36 ++++++-------
arch/x86/kvm/vmx/nested.c | 2 +-
arch/x86/kvm/vmx/pmu_intel.c | 16 +++---
arch/x86/kvm/vmx/tdx.c | 10 ++--
arch/x86/kvm/vmx/vmx.c | 96 ++++++++++++++++-----------------
arch/x86/kvm/x86.c | 102 +++++++++++++++++------------------
arch/x86/kvm/x86.h | 4 +-
arch/x86/kvm/xen.c | 10 ++--
13 files changed, 202 insertions(+), 203 deletions(-)
--
2.54.0