From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiang Liu Subject: [Patch V4 01/42] x86, irq: update high address field when updating affinity for MSI IRQ Date: Mon, 9 Jun 2014 16:19:30 +0800 Message-ID: <1402302011-23642-2-git-send-email-jiang.liu@linux.intel.com> References: <1402302011-23642-1-git-send-email-jiang.liu@linux.intel.com> Return-path: In-Reply-To: <1402302011-23642-1-git-send-email-jiang.liu@linux.intel.com> Sender: stable-owner@vger.kernel.org To: Benjamin Herrenschmidt , Thomas Gleixner , Grant Likely , Ingo Molnar , "H. Peter Anvin" , "Rafael J. Wysocki" , Bjorn Helgaas , Randy Dunlap , Yinghai Lu , x86@kernel.org, Jiang Liu Cc: Konrad Rzeszutek Wilk , Andrew Morton , Tony Luck , Joerg Roedel , Paul Gortmaker , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, stable@vger.kernel.org, Ingo Molnar List-Id: linux-acpi@vger.kernel.org If x2apic is enabled, the MSI high address field should also be aslo updated when setting affinity for MSI IRQ, otherwise the MSI IRQ may target wrong APIC IDs. Signed-off-by: Jiang Liu Cc: stable@vger.kernel.org --- arch/x86/kernel/apic/io_apic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 9d0a9795a0f8..2de992501a1b 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -3007,6 +3007,10 @@ msi_set_affinity(struct irq_data *data, const struct cpumask *mask, bool force) __get_cached_msi_msg(data->msi_desc, &msg); + msg.address_hi = MSI_ADDR_BASE_HI; + if (x2apic_enabled()) + msg.address_hi |= MSI_ADDR_EXT_DEST_ID(dest); + msg.data &= ~MSI_DATA_VECTOR_MASK; msg.data |= MSI_DATA_VECTOR(cfg->vector); msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK; -- 1.7.10.4