Skip to content

KVM/x86: Drop "1" as MSR emulation return value

Juergen Gross kvm linux-coco lkml 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/26 patches 10 repliesIn review
  2. v2 posting 1/25 patches 1 replySuperseded

Changes in v2 from the cover letter

- 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

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6KVM/x86: Change comment before KVM_MSR_RET_* definesarch/x86/kvm/x86.h+2 -20 replies
2/6KVM/x86: Return -errno instead of "1" for APIC related MSR emulationarch/x86/kvm/lapic.c+19 -200 replies
3/6KVM/x86: Return -errno instead of "1" for Hyper-V related MSR emulationarch/x86/kvm/hyperv.c+36 -360 replies
4/6KVM/x86: Return -errno instead of "1" for VMX related MSR emulationarch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/pmu_intel.c arch/x86/kvm/vmx/tdx.c +1 more+62 -620 replies
5/6KVM/x86: Return -errno instead of "1" for SVM related MSR emulationarch/x86/kvm/svm/pmu.c arch/x86/kvm/svm/svm.c+20 -200 replies
6/6KVM/x86: Return -errno instead of "1" for common MSR emulationarch/x86/kvm/mtrr.c arch/x86/kvm/pmu.c arch/x86/kvm/x86.c +1 more+63 -630 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] KVM/x86: Drop "1" as MSR emulation return value

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(-)
Signature · 1 line
2.54.0