linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: x86: hyper-v: make L2 Hyper-V 2019 on KVM guests see MD_CLEAR
@ 2019-09-16 16:22 Vitaly Kuznetsov
  2019-09-16 16:22 ` [PATCH 1/3] cpu/SMT: create and export cpu_smt_possible() Vitaly Kuznetsov
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Vitaly Kuznetsov @ 2019-09-16 16:22 UTC (permalink / raw)
  To: kvm
  Cc: linux-kernel, linux-hyperv, x86, Paolo Bonzini,
	Radim Krčmář,
	Sean Christopherson, Jim Mattson, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin, Peter Zijlstra (Intel),
	Michael Kelley, Roman Kagan

[The series is KVM specific but the first patch of the series likely requires
 someone else's ACK. hyperv-tlfs.h gets a small addition too.]

It was discovered that L2 guests on Hyper-V 2019 on KVM don't see MD_CLEAR
bit (and thus think they're MDS vulnerable) even when it is present on the
host. Turns out, Hyper-V is filtering it out because it is not sure the
topology L0 is exposing is trustworthy and generally it is not. In some
specific cases (e.g. when SMT is unsupported or forcesully disabled) it is
and we can tell this to userspace hoping that it'll pass this info to L1.
See PATCH2 of the series for additional details.

The series can be tested with QEMU-4.1+ and 'hv-passthrough' CPU flag.

Vitaly Kuznetsov (3):
  cpu/SMT: create and export cpu_smt_possible()
  KVM: x86: hyper-v: set NoNonArchitecturalCoreSharing CPUID bit when
    SMT is impossible
  KVM: selftests: hyperv_cpuid: add check for
    NoNonArchitecturalCoreSharing bit

 arch/x86/include/asm/hyperv-tlfs.h            |  7 +++++
 arch/x86/kvm/hyperv.c                         |  4 ++-
 include/linux/cpu.h                           |  2 ++
 kernel/cpu.c                                  | 11 ++++++--
 .../selftests/kvm/x86_64/hyperv_cpuid.c       | 27 +++++++++++++++++++
 5 files changed, 48 insertions(+), 3 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2019-09-23 16:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-16 16:22 [PATCH 0/3] KVM: x86: hyper-v: make L2 Hyper-V 2019 on KVM guests see MD_CLEAR Vitaly Kuznetsov
2019-09-16 16:22 ` [PATCH 1/3] cpu/SMT: create and export cpu_smt_possible() Vitaly Kuznetsov
2019-09-16 17:16   ` Jim Mattson
2019-09-17 14:07     ` Paolo Bonzini
2019-09-17 15:11     ` Vitaly Kuznetsov
2019-09-16 16:22 ` [PATCH 2/3] KVM: x86: hyper-v: set NoNonArchitecturalCoreSharing CPUID bit when SMT is impossible Vitaly Kuznetsov
2019-09-16 16:34   ` Jim Mattson
2019-09-17  9:33     ` Vitaly Kuznetsov
2019-09-17 14:08       ` Paolo Bonzini
2019-09-23 15:37   ` Peter Zijlstra
2019-09-23 16:48     ` Paolo Bonzini
2019-09-16 16:22 ` [PATCH 3/3] KVM: selftests: hyperv_cpuid: add check for NoNonArchitecturalCoreSharing bit Vitaly Kuznetsov

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).