Skip to content

Commit 4064a4c

Browse files
Wanpeng Libonzini
authored andcommitted
KVM: X86: Filter out the broadcast dest for IPI fastpath
Except destination shorthand, a destination value 0xffffffff is used to broadcast interrupts, let's also filter out this for single target IPI fastpath. Reviewed-by: Vitaly Kuznetsov <[email protected]> Signed-off-by: Wanpeng Li <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 1b0c58a commit 4064a4c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

arch/x86/kvm/lapic.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@
5959
#define MAX_APIC_VECTOR 256
6060
#define APIC_VECTORS_PER_REG 32
6161

62-
#define APIC_BROADCAST 0xFF
63-
#define X2APIC_BROADCAST 0xFFFFFFFFul
64-
6562
static bool lapic_timer_advance_dynamic __read_mostly;
6663
#define LAPIC_TIMER_ADVANCE_ADJUST_MIN 100 /* clock cycles */
6764
#define LAPIC_TIMER_ADVANCE_ADJUST_MAX 10000 /* clock cycles */

arch/x86/kvm/lapic.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
#define APIC_BUS_CYCLE_NS 1
1818
#define APIC_BUS_FREQUENCY (1000000000ULL / APIC_BUS_CYCLE_NS)
1919

20+
#define APIC_BROADCAST 0xFF
21+
#define X2APIC_BROADCAST 0xFFFFFFFFul
22+
2023
enum lapic_mode {
2124
LAPIC_MODE_DISABLED = 0,
2225
LAPIC_MODE_INVALID = X2APIC_ENABLE,

arch/x86/kvm/x86.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,8 @@ static int handle_fastpath_set_x2apic_icr_irqoff(struct kvm_vcpu *vcpu, u64 data
15861586

15871587
if (((data & APIC_SHORT_MASK) == APIC_DEST_NOSHORT) &&
15881588
((data & APIC_DEST_MASK) == APIC_DEST_PHYSICAL) &&
1589-
((data & APIC_MODE_MASK) == APIC_DM_FIXED)) {
1589+
((data & APIC_MODE_MASK) == APIC_DM_FIXED) &&
1590+
((u32)(data >> 32) != X2APIC_BROADCAST)) {
15901591

15911592
data &= ~(1 << 12);
15921593
kvm_apic_send_ipi(vcpu->arch.apic, (u32)data, (u32)(data >> 32));

0 commit comments

Comments
 (0)