Skip to content

KVM: x86: hyper-v: make L2 Hyper-V 2019 on KVM guests see MD_CLEAR

Vitaly Kuznetsov kvm linux-hyperv lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3cpu/SMT: create and export cpu_smt_possible()include/linux/cpu.h kernel/cpu.c+11 -23 replies
2/3KVM: x86: hyper-v: set NoNonArchitecturalCoreSharing CPUID bit when SMT is impossiblearch/x86/include/asm/hyperv-tlfs.h arch/x86/kvm/hyperv.c+10 -15 replies
3/3KVM: selftests: hyperv_cpuid: add check for NoNonArchitecturalCoreSharing bittools/testing/selftests/kvm/x86_64/hyperv_cpuid.c+27 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] KVM: x86: hyper-v: make L2 Hyper-V 2019 on KVM guests see MD_CLEAR

[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(-)
Signature · 1 line
2.20.1