Skip to content

x86: Better backtraces for leaf functions

Sean Christopherson kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest20 patches 15 repliesIn review

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20x86/vmx: Drop unused SYSENTER "support" in nested VMX infrastructurex86/vmx.c x86/vmx.h x86/vmx_tests.c+26 -710 replies
2/20x86/vmx: Drop unused guest_regs "support" in nested VMX infrastructurex86/vmx.c x86/vmx.h x86/vmx_tests.c+22 -260 replies
3/20x86/svm: Sort (and swap) GPRs by their index, not alphabeticallyx86/svm.h+4 -43 replies
4/20x86: Dedup guest/host context switch of registers across SVM and VMXlib/x86/virt.h x86/svm.c x86/svm.h +2 more+63 -902 replies
5/20x86/virt: Use macro shenanigans to get reg offsets when swapping guest/host regslib/x86/virt.h x86/svm.c x86/svm.h +1 more+56 -250 replies
6/20x86/virt: Track "guest regs" using per-CPU variablelib/x86/smp.h lib/x86/virt.h x86/svm.c +4 more+77 -611 reply
7/20x86/svm: Don't VMLOAD/VMSAVE "guest" state around VMRUNx86/svm.h+0 -40 replies
8/20x86/vmx: Use separate VMCSes for BSP vs. AP in INIT testx86/vmx_tests.c+10 -81 reply
9/20x86/vmx: Swap GPRs after checking "launched" statusx86/vmx.c+1 -10 replies
10/20x86/vmx: Track VMCS "launched" state per-CPUlib/x86/smp.h x86/vmx.c x86/vmx.h+11 -60 replies
11/20x86/vmx: Track "is this CPU in guest mode" per-CPUlib/x86/smp.h x86/vmx.c+14 -70 replies
12/20x86/vmx: Communicate hypercalls via RAX, not a global fieldx86/vmx.c x86/vmx.h+20 -180 replies
13/20x86/vmx: Initialize test stage in SIPI test *before* launching AP threadx86/vmx_tests.c+2 -20 replies
14/20x86/kvmclock: Replace spaces with tabsx86/kvmclock.c x86/kvmclock_test.c+130 -1300 replies
15/20x86/kvmclock: Skip kvmclock test when not running on KVM with CLOCKSOURCE2lib/x86/processor.h x86/kvmclock.h x86/kvmclock_test.c+25 -10 replies
16/20x86/vmx: Tag "struct vmx_msr_entry" as needing to be 16-byte alignedx86/vmx_tests.c+1 -10 replies
17/20x86/smp: Align the stack to a 16-byte boundary when invoking SMP function callslib/x86/smp.c+16 -50 replies
18/20x86/vmx: Write to KVM's WALL_CLOCK MSR via VM-Entry load list sync in SIPI testx86/vmx_tests.c+25 -10 replies
19/20x86: Better backtraces for leaf functionsx86/Makefile.common+11 -00 replies
20/20x86: Prevent realmode test code instrumentation with nop-mcountx86/Makefile.common x86/realmode.c+7 -10 replies

Reviews trailers per patch

1 of 20 patches has a Reviewed-by or Acked-by.

PatchAndrew JonesMathias Krause
SeriesT-b
1/20
2/20
3/20
4/20
5/20
6/20
7/20
8/20
9/20
10/20
11/20
12/20
13/20
14/20
15/20
16/20
17/20
18/20
19/20R-b T-b
20/20

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

Read the v3 thread

Cover letter [kvm-unit-tests PATCH v3 00/20] x86: Better backtraces for leaf functions

Finally re-posting Mathias' work to provide better backtraces on x86, which was blocked by a fatal bug in the nVMX SIPI test that was exposed by the stack frame side effects. This has been sitting on my local system(s) for something like 5 months, and I all but forgot I hadn't posted it.

Most of this series is cleaning up the nVMX and nSVM to play nice with multi-CPU tests. Then to fix the race in the problematic SIPI, abuse the VM-Entry MSR load list to atomically detect VM-Enter (I'm still proud of that hack).

For gory details:

https://lore.kernel.org/all/[email protected]

Mathias Krause (3):
x86/vmx: Initialize test stage in SIPI test *before* launching AP
thread
x86: Better backtraces for leaf functions
x86: Prevent realmode test code instrumentation with nop-mcount

Sean Christopherson (17):
x86/vmx: Drop unused SYSENTER "support" in nested VMX infrastructure x86/vmx: Drop unused guest_regs "support" in nested VMX infrastructure x86/svm: Sort (and swap) GPRs by their index, not alphabetically
x86: Dedup guest/host context switch of registers across SVM and VMX x86/virt: Use macro shenanigans to get reg offsets when swapping
guest/host regs
x86/virt: Track "guest regs" using per-CPU variable x86/svm: Don't VMLOAD/VMSAVE "guest" state around VMRUN x86/vmx: Use separate VMCSes for BSP vs. AP in INIT test x86/vmx: Swap GPRs after checking "launched" status x86/vmx: Track VMCS "launched" state per-CPU
x86/vmx: Track "is this CPU in guest mode" per-CPU x86/vmx: Communicate hypercalls via RAX, not a global field x86/kvmclock: Replace spaces with tabs
x86/kvmclock: Skip kvmclock test when not running on KVM with
CLOCKSOURCE2
x86/vmx: Tag "struct vmx_msr_entry" as needing to be 16-byte aligned x86/smp: Align the stack to a 16-byte boundary when invoking SMP
function calls
x86/vmx: Write to KVM's WALL_CLOCK MSR via VM-Entry load list sync in
SIPI test

 lib/x86/processor.h |  15 +++
 lib/x86/smp.c       |  21 ++++-
 lib/x86/smp.h       |  32 +++++++
 lib/x86/virt.h      |  61 ++++++++++++
 x86/Makefile.common |  14 +++
 x86/kvmclock.c      |  42 ++++-----
 x86/kvmclock.h      |   2 +
 x86/kvmclock_test.c | 225 +++++++++++++++++++++++---------------------
 x86/realmode.c      |   3 +
 x86/svm.c           |  19 ++--
 x86/svm.h           |  61 ++----------
 x86/svm_tests.c     |   5 +-
 x86/vmx.c           | 121 +++++++++++-------------
 x86/vmx.h           |  72 +-------------
 x86/vmx_tests.c     | 134 ++++++++++++++++----------
 15 files changed, 443 insertions(+), 384 deletions(-)
 create mode 100644 lib/x86/virt.h

base-commit: 4d60e2429d63dc0c24990114a8afc89e86c187cc

Signature · 1 line
2.54.0.563.g4f69b47b94-goog