All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH 0/3] Regression test for L1 LDTR persistence bug
@ 2021-10-08 21:24 Jim Mattson
  2021-10-08 21:24 ` [kvm-unit-tests PATCH 1/3] x86: Fix operand size for lldt Jim Mattson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jim Mattson @ 2021-10-08 21:24 UTC (permalink / raw)
  To: kvm; +Cc: Jim Mattson

In Linux commit afc8de0118be ("KVM: nVMX: Set LDTR to its
architecturally defined value on nested VM-Exit"), Sean suggested that
this bug was likely benign, but it turns out that--for us, at
least--it can result in live migration failures. On restore, we call
KVM_SET_SREGS before KVM_SET_NESTED_STATE, so when L2 is active at the
time of save/restore, the target vmcs01 is temporarily populated with
L2 values. Hence, the LDTR visible to L1 after the next emulated
VM-exit is L2's, rather than its own.

This issue is significant enough that it warrants a regression
test. Unfortunately, at the moment, the best we can do is check for
the LDTR persistence bug. I'd like to be able to trigger a
save/restore from within the L2 guest, but AFAICT, there's no way to
do that under qemu. Does anyone want to implement a qemu ISA test
device that triggers a save/restore when its configured I/O port is
written to?

Jim Mattson (3):
  x86: Fix operand size for lldt
  x86: Make set_gdt_entry usable in 64-bit mode
  x86: Add a regression test for L1 LDTR persistence bug

 lib/x86/desc.c      | 41 +++++++++++++++++++++++++++++++----------
 lib/x86/desc.h      |  3 ++-
 lib/x86/processor.h |  2 +-
 x86/cstart64.S      |  1 +
 x86/vmx_tests.c     | 39 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 74 insertions(+), 12 deletions(-)

-- 
2.33.0.882.g93a45727a2-goog


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-08 21:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08 21:24 [kvm-unit-tests PATCH 0/3] Regression test for L1 LDTR persistence bug Jim Mattson
2021-10-08 21:24 ` [kvm-unit-tests PATCH 1/3] x86: Fix operand size for lldt Jim Mattson
2021-10-08 21:24 ` [kvm-unit-tests PATCH 2/3] x86: Make set_gdt_entry usable in 64-bit mode Jim Mattson
2021-10-08 21:24 ` [kvm-unit-tests PATCH 3/3] x86: Add a regression test for L1 LDTR persistence bug Jim Mattson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.