Skip to content

x86: KVM: svm: get rid of hardcoded instructions lengths

Vitaly Kuznetsov kvm lkml 4 versions – Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 7 repliesApplied
  2. v37 patches 4 repliesSuperseded
  3. v25 patches 6 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v15 patches2 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/7x86: KVM: svm: don't pretend to advance RIP in case wrmsr_interception() results in #GParch/x86/kvm/svm.c+1 -10 replies
2/7x86: kvm: svm: propagate errors from skip_emulated_instruction()arch/x86/include/asm/kvm_host.h arch/x86/kvm/svm.c arch/x86/kvm/vmx/vmx.c +1 more+38 -224 replies
3/7x86: KVM: clear interrupt shadow on EMULTYPE_SKIParch/x86/kvm/x86.c+1 -00 replies
4/7x86: KVM: add xsetbv to the emulatorarch/x86/include/asm/kvm_emulate.h arch/x86/kvm/emulate.c arch/x86/kvm/svm.c +1 more+31 -20 replies
5/7x86: KVM: svm: remove hardcoded instruction length from interceptsarch/x86/kvm/svm.c+0 -110 replies
6/7x86: KVM: svm: eliminate weird goto from vmrun_interception()arch/x86/kvm/svm.c+14 -221 reply
7/7x86: KVM: svm: eliminate hardcoded RIP advancement from vmrun_interception()arch/x86/kvm/svm.c+10 -101 reply

Reviews trailers per patch

5 of 7 patches have a Reviewed-by or Acked-by.

PatchSean Christopherson
1/7R-b
2/7
3/7R-b
4/7
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/7] x86: KVM: svm: get rid of hardcoded instructions lengths

Changes since v3 [Sean Christopherson]:
- add Reviewed-by tag to PATCH5
- __skip_emulated_instruction()/skip_emulated_instruction() split, 'unlikely(r != EMULATE_DONE)' in PATCH2
- Make nested_svm_vmrun() return an int in PATCH6 (moved from PATCH7)
- Avoid weird-looking 'if (rc) return ret' in PATCH7

Original description:

Jim rightfully complains that hardcoding instuctions lengths is not always
correct: additional (redundant) prefixes can be used. Luckily, the ugliness is mostly harmless: modern AMD CPUs support NRIP_SAVE feature but I'd like to clean things up and sacrifice speed in favor of correctness.

Vitaly Kuznetsov (7):
x86: KVM: svm: don't pretend to advance RIP in case
wrmsr_interception() results in #GP
x86: kvm: svm: propagate errors from skip_emulated_instruction()
x86: KVM: clear interrupt shadow on EMULTYPE_SKIP
x86: KVM: add xsetbv to the emulator
x86: KVM: svm: remove hardcoded instruction length from intercepts
x86: KVM: svm: eliminate weird goto from vmrun_interception()
x86: KVM: svm: eliminate hardcoded RIP advancement from
vmrun_interception()

 arch/x86/include/asm/kvm_emulate.h |   3 +-
 arch/x86/include/asm/kvm_host.h    |   2 +-
 arch/x86/kvm/emulate.c             |  23 ++++++-
 arch/x86/kvm/svm.c                 | 100 +++++++++++++----------------
 arch/x86/kvm/vmx/vmx.c             |  16 ++++-
 arch/x86/kvm/x86.c                 |  13 +++-
 6 files changed, 92 insertions(+), 65 deletions(-)
Signature · 1 line
2.20.1