Commit 2c5a3a05 authored by Nicolai Stange's avatar Nicolai Stange Committed by Greg Kroah-Hartman

x86/irq: Let interrupt handlers set kvm_cpu_l1tf_flush_l1d

commit ffcba43f upstream

The last missing piece to having vmx_l1d_flush() take interrupts after
VMEXIT into account is to set the kvm_cpu_l1tf_flush_l1d per-cpu flag on
irq entry.

Issue calls to kvm_set_cpu_l1tf_flush_l1d() from entering_irq(),
ipi_entering_ack_irq(), smp_reschedule_interrupt() and
uv_bau_message_interrupt().
Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarNicolai Stange <nstange@suse.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarDavid Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8574df1a
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <asm/mpspec.h> #include <asm/mpspec.h>
#include <asm/msr.h> #include <asm/msr.h>
#include <asm/idle.h> #include <asm/idle.h>
#include <asm/hardirq.h>
#define ARCH_APICTIMER_STOPS_ON_C3 1 #define ARCH_APICTIMER_STOPS_ON_C3 1
...@@ -647,6 +648,7 @@ static inline void entering_irq(void) ...@@ -647,6 +648,7 @@ static inline void entering_irq(void)
{ {
irq_enter(); irq_enter();
exit_idle(); exit_idle();
kvm_set_cpu_l1tf_flush_l1d();
} }
static inline void entering_ack_irq(void) static inline void entering_ack_irq(void)
...@@ -659,6 +661,7 @@ static inline void ipi_entering_ack_irq(void) ...@@ -659,6 +661,7 @@ static inline void ipi_entering_ack_irq(void)
{ {
irq_enter(); irq_enter();
ack_APIC_irq(); ack_APIC_irq();
kvm_set_cpu_l1tf_flush_l1d();
} }
static inline void exiting_irq(void) static inline void exiting_irq(void)
......
...@@ -271,6 +271,7 @@ __visible void __irq_entry smp_reschedule_interrupt(struct pt_regs *regs) ...@@ -271,6 +271,7 @@ __visible void __irq_entry smp_reschedule_interrupt(struct pt_regs *regs)
/* /*
* KVM uses this interrupt to force a cpu out of guest mode * KVM uses this interrupt to force a cpu out of guest mode
*/ */
kvm_set_cpu_l1tf_flush_l1d();
} }
__visible void __irq_entry smp_trace_reschedule_interrupt(struct pt_regs *regs) __visible void __irq_entry smp_trace_reschedule_interrupt(struct pt_regs *regs)
......
...@@ -1283,6 +1283,7 @@ void uv_bau_message_interrupt(struct pt_regs *regs) ...@@ -1283,6 +1283,7 @@ void uv_bau_message_interrupt(struct pt_regs *regs)
struct msg_desc msgdesc; struct msg_desc msgdesc;
ack_APIC_irq(); ack_APIC_irq();
kvm_set_cpu_l1tf_flush_l1d();
time_start = get_cycles(); time_start = get_cycles();
bcp = &per_cpu(bau_control, smp_processor_id()); bcp = &per_cpu(bau_control, smp_processor_id());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment