OSDN Git Service

x86/KVM/VMX: Add L1D flush algorithm
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 Jul 2018 10:47:38 +0000 (12:47 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 4 Jul 2018 18:49:38 +0000 (20:49 +0200)
commita47dd5f06714c844b33f3b5f517b6f3e81ce57b5
treed63eac82760e1c3f71bc300ae0cbaade92c8c0c7
parenta399477e52c17e148746d3ce9a483f681c2aa9a0
x86/KVM/VMX: Add L1D flush algorithm

To mitigate the L1 Terminal Fault vulnerability it's required to flush L1D
on VMENTER to prevent rogue guests from snooping host memory.

CPUs will have a new control MSR via a microcode update to flush L1D with a
single MSR write, but in the absence of microcode a fallback to a software
based flush algorithm is required.

Add a software flush loop which is based on code from Intel.

[ tglx: Split out from combo patch ]
[ bpetkov: Polish the asm code ]

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kvm/vmx.c