Skip to content

KVM: my debug patch queue

Maxim Levitsky kvm linux-doc linux-kselftest lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 21 repliesIn review
  2. v29 patches 6 repliesSuperseded
  3. v13 patches 28 repliesSuperseded

Changes in v3 from the cover letter

* Modified a selftest to cover the KVM_GUESTDBG_BLOCKIRQ
* Rebased on kvm/queue

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6KVM: SVM: split svm_handle_invalid_exitarch/x86/kvm/svm/svm.c+9 -80 replies
2/6KVM: x86: add force_intercept_exceptions_maskarch/x86/kvm/x86.c arch/x86/kvm/x86.h+5 -06 replies
3/6KVM: SVM: implement force_intercept_exceptions_maskarch/x86/include/asm/kvm_host.h arch/x86/kvm/svm/svm.c arch/x86/kvm/svm/svm.h +1 more+80 -33 replies
4/6scripts/gdb: rework lx-symbols gdb scriptkernel/module.c scripts/gdb/linux/symbols.py+143 -680 replies
5/6KVM: x86: implement KVM_GUESTDBG_BLOCKIRQDocumentation/virt/kvm/api.rst arch/x86/include/asm/kvm_host.h arch/x86/include/uapi/asm/kvm.h +1 more+8 -10 replies
6/6KVM: selftests: test KVM_GUESTDBG_BLOCKIRQtools/testing/selftests/kvm/x86_64/debug_regs.c+21 -312 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 0/6] KVM: my debug patch queue

Hi!

I would like to publish two debug features which were needed for other stuff I work on.

One is the reworked lx-symbols script which now actually works on at least gdb 9.1 (gdb 9.2 was reported to fail to load the debug symbols from the kernel for some reason, not related to this patch) and upstream qemu.

The other feature is the ability to trap all guest exceptions (on SVM for now) and see them in kvmtrace prior to potential merge to double/triple fault.

This can be very useful and I already had to manually patch KVM a few times for this.
I will, once time permits, implement this feature on Intel as well.

V2:

* Some more refactoring and workarounds for lx-symbols script

* added KVM_GUESTDBG_BLOCKIRQ flag to enable 'block interrupts on single step' together with KVM_CAP_SET_GUEST_DEBUG2 capability to indicate which guest debug flags are supported.

This is a replacement for unconditional block of interrupts on single step that was done in previous version of this patch set. Patches to qemu to use that feature will be sent soon.

* Reworked the the 'intercept all exceptions for debug' feature according to the review feedback:

- renamed the parameter that enables the feature and moved it to common kvm module.
(only SVM part is currently implemented though)

- disable the feature for SEV guests as was suggested during the review
- made the vmexit table const again, as was suggested in the review as well.

V3:
* Modified a selftest to cover the KVM_GUESTDBG_BLOCKIRQ
* Rebased on kvm/queue

Best regards,
Maxim Levitsky

Maxim Levitsky (6):
KVM: SVM: split svm_handle_invalid_exit
KVM: x86: add force_intercept_exceptions_mask
KVM: SVM: implement force_intercept_exceptions_mask scripts/gdb: rework lx-symbols gdb script
KVM: x86: implement KVM_GUESTDBG_BLOCKIRQ
KVM: selftests: test KVM_GUESTDBG_BLOCKIRQ

 Documentation/virt/kvm/api.rst                |   1 +
 arch/x86/include/asm/kvm_host.h               |   5 +-
 arch/x86/include/uapi/asm/kvm.h               |   1 +
 arch/x86/kvm/svm/svm.c                        |  87 +++++++-
 arch/x86/kvm/svm/svm.h                        |   6 +-
 arch/x86/kvm/x86.c                            |  12 +-
 arch/x86/kvm/x86.h                            |   2 +
 kernel/module.c                               |   8 +-
 scripts/gdb/linux/symbols.py                  | 203 ++++++++++++------
 .../testing/selftests/kvm/x86_64/debug_regs.c |  24 ++-
 10 files changed, 266 insertions(+), 83 deletions(-)
Signature · 1 line
2.26.3