public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] AMD invpcid exception fix
@ 2021-02-11 21:22 Bandan Das
  2021-02-11 21:22 ` [PATCH 1/3] KVM: Add a stub for invpcid in the emulator table Bandan Das
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Bandan Das @ 2021-02-11 21:22 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini, jmattson, wei.huang2, babu.moger

The pcid-disabled test from kvm-unit-tests fails on a Milan host because the
processor injects a #GP while the test expects #UD. While setting the intercept
when the guest has it disabled seemed like the obvious thing to do, Babu Moger (AMD)
pointed me to an earlier discussion here - https://lkml.org/lkml/2020/6/11/949

Jim points out there that  #GP has precedence over the intercept bit when invpcid is
called with CPL > 0 and so even if we intercept invpcid, the guest would end up with getting
and "incorrect" exception. To inject the right exception, I created an entry for the instruction
in the emulator to decode it successfully and then inject a UD instead of a GP when
the guest has it disabled.

Bandan Das (3):
  KVM: Add a stub for invpcid in the emulator table
  KVM: SVM: Handle invpcid during gp interception
  KVM: SVM:  check if we need to track GP intercept for invpcid

 arch/x86/kvm/emulate.c |  3 ++-
 arch/x86/kvm/svm/svm.c | 22 +++++++++++++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)

-- 
2.24.1


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

end of thread, other threads:[~2021-02-12 21:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-11 21:22 [PATCH 0/3] AMD invpcid exception fix Bandan Das
2021-02-11 21:22 ` [PATCH 1/3] KVM: Add a stub for invpcid in the emulator table Bandan Das
2021-02-11 21:22 ` [PATCH 2/3] KVM: SVM: Handle invpcid during gp interception Bandan Das
2021-02-11 21:22 ` [PATCH 3/3] KVM: SVM: check if we need to track GP intercept for invpcid Bandan Das
2021-02-12 10:51 ` [PATCH 0/3] AMD invpcid exception fix Paolo Bonzini
2021-02-12 14:49   ` Bandan Das
2021-02-12 17:43     ` Jim Mattson
2021-02-12 17:55       ` Bandan Das
2021-02-12 18:20         ` Jim Mattson
2021-02-12 18:35           ` Bandan Das
2021-02-12 19:40             ` Jim Mattson
2021-02-12 20:09               ` Bandan Das
2021-02-12 20:56                 ` Jim Mattson
2021-02-12 21:42                   ` Paolo Bonzini
2021-02-12 21:49                     ` Bandan Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox