kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: support the cpu feature FLUSH_L1D
@ 2023-02-01 13:29 Emanuele Giuseppe Esposito
  2023-02-01 13:29 ` [PATCH 1/3] kvm: vmx: Add IA32_FLUSH_CMD guest support Emanuele Giuseppe Esposito
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Emanuele Giuseppe Esposito @ 2023-02-01 13:29 UTC (permalink / raw)
  To: kvm
  Cc: Jim Mattson, Ben Serebrin, Peter Shier, Sean Christopherson,
	Paolo Bonzini, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, Maxim Levitsky, x86, H. Peter Anvin, linux-kernel,
	Emanuele Giuseppe Esposito

As the title suggest, if the host cpu supports flush_l1d flag and
QEMU/userspace wants to boot a VM with the same flag (or emulate same
host features), KVM should be able to do so.

Patch 3 is the main fix, because if flush_l1d is not advertised by
KVM, a linux VM will erroneously mark
/sys/devices/system/cpu/vulnerabilities/mmio_stale_data
as vulnerable, even though it isn't since the host has the feature
and takes care of this. Not sure what would happen in the nested case though.

Patch 1 and 2 are just taken and refactored from Jim Mattison's serie that it
seems was lost a while ago:
https://patchwork.kernel.org/project/kvm/patch/20180814173049.21756-1-jmattson@google.com/

I thought it was worth re-posting them.

Thank you,
Emanuele

Emanuele Giuseppe Esposito (3):
  kvm: vmx: Add IA32_FLUSH_CMD guest support
  kvm: svm: Add IA32_FLUSH_CMD guest support
  kvm: x86: Advertise FLUSH_L1D to user space

 arch/x86/kvm/cpuid.c      |  2 +-
 arch/x86/kvm/svm/svm.c    | 44 ++++++++++++++++--------
 arch/x86/kvm/vmx/nested.c |  3 ++
 arch/x86/kvm/vmx/vmx.c    | 70 +++++++++++++++++++++++++--------------
 4 files changed, 80 insertions(+), 39 deletions(-)

-- 
2.39.1


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

end of thread, other threads:[~2023-03-21 23:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-01 13:29 [PATCH 0/3] KVM: support the cpu feature FLUSH_L1D Emanuele Giuseppe Esposito
2023-02-01 13:29 ` [PATCH 1/3] kvm: vmx: Add IA32_FLUSH_CMD guest support Emanuele Giuseppe Esposito
2023-03-17 19:04   ` Nathan Chancellor
2023-03-17 22:53     ` Pawan Gupta
2023-03-17 23:14       ` Nathan Chancellor
2023-03-17 23:59         ` Pawan Gupta
2023-03-20 14:53           ` Sean Christopherson
2023-03-20 15:40             ` Emanuele Giuseppe Esposito
2023-03-20 16:24               ` Sean Christopherson
2023-03-20 16:48                 ` Emanuele Giuseppe Esposito
2023-03-21 23:59             ` Sean Christopherson
2023-02-01 13:29 ` [PATCH 2/3] kvm: svm: " Emanuele Giuseppe Esposito
2023-02-01 13:29 ` [PATCH 3/3] kvm: x86: Advertise FLUSH_L1D to user space Emanuele Giuseppe Esposito
2023-03-14 13:29 ` [PATCH 0/3] KVM: support the cpu feature FLUSH_L1D Paolo Bonzini
2023-03-20 16:52 ` Jim Mattson
2023-03-21  8:40   ` Emanuele Giuseppe Esposito
2023-03-21  9:43   ` Paolo Bonzini
2023-03-21 18:30     ` Jim Mattson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).