* [Patch V4 01/42] x86, irq: update high address field when updating affinity for MSI IRQ [not found] <1402302011-23642-1-git-send-email-jiang.liu@linux.intel.com> @ 2014-06-09 8:19 ` Jiang Liu 2014-06-09 23:46 ` Yinghai Lu 2014-06-10 0:22 ` David Rientjes 0 siblings, 2 replies; 4+ messages in thread From: Jiang Liu @ 2014-06-09 8:19 UTC (permalink / raw) To: Benjamin Herrenschmidt, Thomas Gleixner, Grant Likely, Ingo Molnar, H. Peter Anvin, Rafael J. Wysocki, Bjorn Helgaas, Randy Dunlap, Yinghai Lu, x86, Jiang Liu Cc: Konrad Rzeszutek Wilk, Andrew Morton, Tony Luck, Joerg Roedel, Paul Gortmaker, Greg Kroah-Hartman, linux-kernel, linux-pci, linux-acpi, stable, Ingo Molnar 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 <jiang.liu@linux.intel.com> 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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Patch V4 01/42] x86, irq: update high address field when updating affinity for MSI IRQ 2014-06-09 8:19 ` [Patch V4 01/42] x86, irq: update high address field when updating affinity for MSI IRQ Jiang Liu @ 2014-06-09 23:46 ` Yinghai Lu 2014-06-10 2:54 ` Jiang Liu 2014-06-10 0:22 ` David Rientjes 1 sibling, 1 reply; 4+ messages in thread From: Yinghai Lu @ 2014-06-09 23:46 UTC (permalink / raw) To: Jiang Liu Cc: Benjamin Herrenschmidt, Thomas Gleixner, Grant Likely, Ingo Molnar, H. Peter Anvin, Rafael J. Wysocki, Bjorn Helgaas, Randy Dunlap, the arch/x86 maintainers, Konrad Rzeszutek Wilk, Andrew Morton, Tony Luck, Joerg Roedel, Paul Gortmaker, Greg Kroah-Hartman, Linux Kernel Mailing List, linux-pci@vger.kernel.org, ACPI Devel Maling List, stable@vger.kernel.org, Ingo Molnar On Mon, Jun 9, 2014 at 1:19 AM, Jiang Liu <jiang.liu@linux.intel.com> wrote: > 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. Do you have any test case to reveal the problem? > > Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> > 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; No. This change is not needed. When x2apic is used, and apicid > 255, irq remapping is used. msi_chip.irq_set_affinity will be changed from msi_set_affinity to x86_io_apic_ops.set_affinity (aka intel_setup_ioapic_entry), via irq_remap_modify_chip_defaults(). Thanks Yinghai ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch V4 01/42] x86, irq: update high address field when updating affinity for MSI IRQ 2014-06-09 23:46 ` Yinghai Lu @ 2014-06-10 2:54 ` Jiang Liu 0 siblings, 0 replies; 4+ messages in thread From: Jiang Liu @ 2014-06-10 2:54 UTC (permalink / raw) To: Yinghai Lu Cc: Benjamin Herrenschmidt, Thomas Gleixner, Grant Likely, Ingo Molnar, H. Peter Anvin, Rafael J. Wysocki, Bjorn Helgaas, Randy Dunlap, the arch/x86 maintainers, Konrad Rzeszutek Wilk, Andrew Morton, Tony Luck, Joerg Roedel, Paul Gortmaker, Greg Kroah-Hartman, Linux Kernel Mailing List, linux-pci@vger.kernel.org, ACPI Devel Maling List, stable@vger.kernel.org, Ingo Molnar On 2014/6/10 7:46, Yinghai Lu wrote: > On Mon, Jun 9, 2014 at 1:19 AM, Jiang Liu <jiang.liu@linux.intel.com> wrote: >> 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. > > Do you have any test case to reveal the problem? Just by code inspection. > >> >> Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> >> 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; > > No. This change is not needed. > > When x2apic is used, and apicid > 255, irq remapping is used. > > msi_chip.irq_set_affinity will be changed from msi_set_affinity to > x86_io_apic_ops.set_affinity (aka intel_setup_ioapic_entry), via > irq_remap_modify_chip_defaults(). Thanks for explanation, will drop this patch. Gerry > > Thanks > > Yinghai > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch V4 01/42] x86, irq: update high address field when updating affinity for MSI IRQ 2014-06-09 8:19 ` [Patch V4 01/42] x86, irq: update high address field when updating affinity for MSI IRQ Jiang Liu 2014-06-09 23:46 ` Yinghai Lu @ 2014-06-10 0:22 ` David Rientjes 1 sibling, 0 replies; 4+ messages in thread From: David Rientjes @ 2014-06-10 0:22 UTC (permalink / raw) To: Jiang Liu Cc: Benjamin Herrenschmidt, Thomas Gleixner, Grant Likely, Ingo Molnar, H. Peter Anvin, Rafael J. Wysocki, Bjorn Helgaas, Randy Dunlap, Yinghai Lu, x86, Konrad Rzeszutek Wilk, Andrew Morton, Tony Luck, Joerg Roedel, Paul Gortmaker, Greg Kroah-Hartman, linux-kernel, linux-pci, linux-acpi, stable, Ingo Molnar On Mon, 9 Jun 2014, Jiang Liu wrote: > 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 <jiang.liu@linux.intel.com> > Cc: stable@vger.kernel.org Acked-by: David Rientjes <rientjes@google.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-10 2:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1402302011-23642-1-git-send-email-jiang.liu@linux.intel.com>
2014-06-09 8:19 ` [Patch V4 01/42] x86, irq: update high address field when updating affinity for MSI IRQ Jiang Liu
2014-06-09 23:46 ` Yinghai Lu
2014-06-10 2:54 ` Jiang Liu
2014-06-10 0:22 ` David Rientjes
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox