* Re: [PATCH 4.19 35/47] x86/irq: Seperate unused system vectors from spurious entry again @ 2020-08-17 15:36 Guilherme G. Piccoli 2020-08-17 16:21 ` Greg KH 0 siblings, 1 reply; 8+ messages in thread From: Guilherme G. Piccoli @ 2020-08-17 15:36 UTC (permalink / raw) To: Greg KH Cc: jan.kiszka, jbeulich, linux-kernel, marc.zyngier, stable, Thomas Gleixner, Guilherme G. Piccoli, gpiccoli, pedro.principeza Hi Greg / Thomas and all involved here. First, apologies for necro-bumping this thread, but I'm working a backport of this patch to kernel 4.15 (Ubuntu) and then I noticed we have it on stable, but only in 4.19+. Since the fixes tag presents an old commit (since ~3.19), I'm curious if we have a special reason to not have it on long-term stables, like 4.9 or 4.14. It's a subtle portion of arch code, so I'm afraid I didn't see something that prevents its backport for previous versions. Thanks in advance, Guilherme ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 4.19 35/47] x86/irq: Seperate unused system vectors from spurious entry again 2020-08-17 15:36 [PATCH 4.19 35/47] x86/irq: Seperate unused system vectors from spurious entry again Guilherme G. Piccoli @ 2020-08-17 16:21 ` Greg KH 2020-08-17 16:43 ` Guilherme G. Piccoli 0 siblings, 1 reply; 8+ messages in thread From: Greg KH @ 2020-08-17 16:21 UTC (permalink / raw) To: Guilherme G. Piccoli Cc: jan.kiszka, jbeulich, linux-kernel, marc.zyngier, stable, Thomas Gleixner, Guilherme G. Piccoli, pedro.principeza On Mon, Aug 17, 2020 at 12:36:25PM -0300, Guilherme G. Piccoli wrote: > Hi Greg / Thomas and all involved here. First, apologies for > necro-bumping this thread, but I'm working a backport of this patch to > kernel 4.15 (Ubuntu) and then I noticed we have it on stable, but only > in 4.19+. > > Since the fixes tag presents an old commit (since ~3.19), I'm curious if > we have a special reason to not have it on long-term stables, like 4.9 > or 4.14. It's a subtle portion of arch code, so I'm afraid I didn't see > something that prevents its backport for previous versions. What is the git commit id of this patch you are referring to, you didn't provide any context here :( thanks, greg k-h ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 4.19 35/47] x86/irq: Seperate unused system vectors from spurious entry again 2020-08-17 16:21 ` Greg KH @ 2020-08-17 16:43 ` Guilherme G. Piccoli 2020-08-17 16:49 ` Greg KH 0 siblings, 1 reply; 8+ messages in thread From: Guilherme G. Piccoli @ 2020-08-17 16:43 UTC (permalink / raw) To: Greg KH Cc: jan.kiszka, jbeulich, linux-kernel, marc.zyngier, stable, Thomas Gleixner, Guilherme G. Piccoli, pedro.principeza On 17/08/2020 13:21, Greg KH wrote: > On Mon, Aug 17, 2020 at 12:36:25PM -0300, Guilherme G. Piccoli wrote: >> Hi Greg / Thomas and all involved here. First, apologies for >> necro-bumping this thread, but I'm working a backport of this patch to >> kernel 4.15 (Ubuntu) and then I noticed we have it on stable, but only >> in 4.19+. >> >> Since the fixes tag presents an old commit (since ~3.19), I'm curious if >> we have a special reason to not have it on long-term stables, like 4.9 >> or 4.14. It's a subtle portion of arch code, so I'm afraid I didn't see >> something that prevents its backport for previous versions. > > What is the git commit id of this patch you are referring to, you didn't > provide any context here :( > > thanks, > > greg k-h > I'm sorry, I hoped the subject + thread would suffice heh So, the mainline commit is: f8a8fe61fec8 ("x86/irq: Seperate unused system vectors from spurious entry again") [0]. The backport to 4.19 stable tree has the following id: fc6975ee932b . Thanks, Guilherme [0] http://git.kernel.org/linus/f8a8fe61fec8 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 4.19 35/47] x86/irq: Seperate unused system vectors from spurious entry again 2020-08-17 16:43 ` Guilherme G. Piccoli @ 2020-08-17 16:49 ` Greg KH 2020-08-17 16:59 ` Guilherme G. Piccoli 0 siblings, 1 reply; 8+ messages in thread From: Greg KH @ 2020-08-17 16:49 UTC (permalink / raw) To: Guilherme G. Piccoli Cc: jan.kiszka, jbeulich, linux-kernel, marc.zyngier, stable, Thomas Gleixner, Guilherme G. Piccoli, pedro.principeza On Mon, Aug 17, 2020 at 01:43:14PM -0300, Guilherme G. Piccoli wrote: > On 17/08/2020 13:21, Greg KH wrote: > > On Mon, Aug 17, 2020 at 12:36:25PM -0300, Guilherme G. Piccoli wrote: > >> Hi Greg / Thomas and all involved here. First, apologies for > >> necro-bumping this thread, but I'm working a backport of this patch to > >> kernel 4.15 (Ubuntu) and then I noticed we have it on stable, but only > >> in 4.19+. > >> > >> Since the fixes tag presents an old commit (since ~3.19), I'm curious if > >> we have a special reason to not have it on long-term stables, like 4.9 > >> or 4.14. It's a subtle portion of arch code, so I'm afraid I didn't see > >> something that prevents its backport for previous versions. > > > > What is the git commit id of this patch you are referring to, you didn't > > provide any context here :( > > > > thanks, > > > > greg k-h > > > > I'm sorry, I hoped the subject + thread would suffice heh There is no thread here :( > So, the mainline commit is: f8a8fe61fec8 ("x86/irq: Seperate unused > system vectors from spurious entry again") [0]. The backport to 4.19 > stable tree has the following id: fc6975ee932b . Wow, over 1 1/2 years old, can you remember individual patches that long ago? Anyway, did you try to backport the patch to older kernels to see if it was possible and could work? If so, great, please feel free to submit it to the stable@vger.kernel.org list and I will be glad to pick it up. thanks, greg k-h ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 4.19 35/47] x86/irq: Seperate unused system vectors from spurious entry again 2020-08-17 16:49 ` Greg KH @ 2020-08-17 16:59 ` Guilherme G. Piccoli 2020-08-17 17:05 ` Greg KH 0 siblings, 1 reply; 8+ messages in thread From: Guilherme G. Piccoli @ 2020-08-17 16:59 UTC (permalink / raw) To: Greg KH, Thomas Gleixner Cc: jan.kiszka, jbeulich, linux-kernel, marc.zyngier, stable, Guilherme G. Piccoli, pedro.principeza On 17/08/2020 13:49, Greg KH wrote: > [...] >> I'm sorry, I hoped the subject + thread would suffice heh > > There is no thread here :( > Wow, that's odd. I've sent with In-Reply-To, I'd expect it'd get threaded with the original message. Looking in lore archive [1], it seems my first message wasn't threaded but the others were...apologies for that, not sure what happened... >> So, the mainline commit is: f8a8fe61fec8 ("x86/irq: Seperate unused >> system vectors from spurious entry again") [0]. The backport to 4.19 >> stable tree has the following id: fc6975ee932b . > > Wow, over 1 1/2 years old, can you remember individual patches that long > ago? > > Anyway, did you try to backport the patch to older kernels to see if it > was possible and could work? > > If so, great, please feel free to submit it to the > stable@vger.kernel.org list and I will be glad to pick it up. > I'm working on it, it is feasible. But I'm seeking here, in this message, what is the reason it wasn't backported for pre-4.19 - is there anything on these patches that is known to break old kernels? I'll certainly submit my backported patch to stable 4.14 once I'm sure it's working and there's no specific reason to not have it done before. Thanks again! [1] https://lore.kernel.org/stable/a2788632-5690-932b-90de-14bd9cabedec@canonical.com/T/#mf0b26d5a7ff880cfd63bcda80136296275d3682e ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 4.19 35/47] x86/irq: Seperate unused system vectors from spurious entry again 2020-08-17 16:59 ` Guilherme G. Piccoli @ 2020-08-17 17:05 ` Greg KH 2020-08-17 17:13 ` Guilherme Piccoli 0 siblings, 1 reply; 8+ messages in thread From: Greg KH @ 2020-08-17 17:05 UTC (permalink / raw) To: Guilherme G. Piccoli Cc: Thomas Gleixner, jan.kiszka, jbeulich, linux-kernel, marc.zyngier, stable, Guilherme G. Piccoli, pedro.principeza On Mon, Aug 17, 2020 at 01:59:00PM -0300, Guilherme G. Piccoli wrote: > On 17/08/2020 13:49, Greg KH wrote: > > [...] > >> I'm sorry, I hoped the subject + thread would suffice heh > > > > There is no thread here :( > > > > Wow, that's odd. I've sent with In-Reply-To, I'd expect it'd get > threaded with the original message. Looking in lore archive [1], it > seems my first message wasn't threaded but the others were...apologies > for that, not sure what happened... reply to is fine, but how do you know what my email client has (hint, not a copy of 1.5 years of history sitting around in it at the moment...) So there is no "thread" here as far as it is concerned... Anyway, not a big deal, just properly quote emails in the future, that's good to get used to no matter what :) > >> So, the mainline commit is: f8a8fe61fec8 ("x86/irq: Seperate unused > >> system vectors from spurious entry again") [0]. The backport to 4.19 > >> stable tree has the following id: fc6975ee932b . > > > > Wow, over 1 1/2 years old, can you remember individual patches that long > > ago? > > > > Anyway, did you try to backport the patch to older kernels to see if it > > was possible and could work? > > > > If so, great, please feel free to submit it to the > > stable@vger.kernel.org list and I will be glad to pick it up. > > > > I'm working on it, it is feasible. But I'm seeking here, in this > message, what is the reason it wasn't backported for pre-4.19 Try reading the stable mailing list archives, again, you are asking about a patch 1.5 years ago. I can't remember information about patches sent _yesterday_ given the quantity we go through... thanks, greg k-h ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 4.19 35/47] x86/irq: Seperate unused system vectors from spurious entry again 2020-08-17 17:05 ` Greg KH @ 2020-08-17 17:13 ` Guilherme Piccoli 0 siblings, 0 replies; 8+ messages in thread From: Guilherme Piccoli @ 2020-08-17 17:13 UTC (permalink / raw) To: Greg KH Cc: Thomas Gleixner, jan.kiszka, jbeulich, LKML, marc.zyngier, stable, Guilherme G. Piccoli, Pedro Principeza On Mon, Aug 17, 2020 at 2:05 PM Greg KH <gregkh@linuxfoundation.org> wrote: > > On Mon, Aug 17, 2020 at 01:59:00PM -0300, Guilherme G. Piccoli wrote: > > On 17/08/2020 13:49, Greg KH wrote: > > > [...] > > >> I'm sorry, I hoped the subject + thread would suffice heh > > > > > > There is no thread here :( > > > > > > > Wow, that's odd. I've sent with In-Reply-To, I'd expect it'd get > > threaded with the original message. Looking in lore archive [1], it > > seems my first message wasn't threaded but the others were...apologies > > for that, not sure what happened... > > reply to is fine, but how do you know what my email client has (hint, > not a copy of 1.5 years of history sitting around in it at the > moment...) So there is no "thread" here as far as it is concerned... > > Anyway, not a big deal, just properly quote emails in the future, that's > good to get used to no matter what :) > Sure, will do - specially for super old threads like this. > > >> So, the mainline commit is: f8a8fe61fec8 ("x86/irq: Seperate unused > > >> system vectors from spurious entry again") [0]. The backport to 4.19 > > >> stable tree has the following id: fc6975ee932b . > > > > > > Wow, over 1 1/2 years old, can you remember individual patches that long > > > ago? > > > > > > Anyway, did you try to backport the patch to older kernels to see if it > > > was possible and could work? > > > > > > If so, great, please feel free to submit it to the > > > stable@vger.kernel.org list and I will be glad to pick it up. > > > > > > > I'm working on it, it is feasible. But I'm seeking here, in this > > message, what is the reason it wasn't backported for pre-4.19 > > Try reading the stable mailing list archives, again, you are asking > about a patch 1.5 years ago. I can't remember information about patches > sent _yesterday_ given the quantity we go through... > > thanks, > > greg k-h OK, thanks Greg. If Thomas or anybody involved here knows a reason to not backport it to older kernels, please let me know - I'd really appreciate that. Cheers, Guilherme ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 4.19 00/47] 4.19.60-stable review @ 2019-07-18 3:01 Greg Kroah-Hartman 2019-07-18 3:01 ` [PATCH 4.19 35/47] x86/irq: Seperate unused system vectors from spurious entry again Greg Kroah-Hartman 0 siblings, 1 reply; 8+ messages in thread From: Greg Kroah-Hartman @ 2019-07-18 3:01 UTC (permalink / raw) To: linux-kernel Cc: Greg Kroah-Hartman, torvalds, akpm, linux, shuah, patches, ben.hutchings, lkft-triage, stable This is the start of the stable review cycle for the 4.19.60 release. There are 47 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know. Responses should be made by Sat 20 Jul 2019 02:59:27 AM UTC. Anything received after that time might be too late. The whole patch series can be found in one patch at: https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.60-rc1.gz or in the git tree and branch at: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y and the diffstat can be found below. thanks, greg k-h ------------- Pseudo-Shortlog of commits: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Linux 4.19.60-rc1 Jiri Slaby <jslaby@suse.cz> x86/entry/32: Fix ENDPROC of common_spurious Dave Airlie <airlied@redhat.com> drm/udl: move to embedding drm device inside udl device. Thomas Zimmermann <tzimmermann@suse.de> drm/udl: Replace drm_dev_unref with drm_dev_put Dave Airlie <airlied@redhat.com> drm/udl: introduce a macro to convert dev to udl. Mark Zhang <markz@nvidia.com> regmap-irq: do not write mask register if mask_base is zero Haren Myneni <haren@linux.vnet.ibm.com> crypto/NX: Set receive window credits to max number of CRBs in RxFIFO Christophe Leroy <christophe.leroy@c-s.fr> crypto: talitos - fix hash on SEC1. Christophe Leroy <christophe.leroy@c-s.fr> crypto: talitos - move struct talitos_edesc into talitos.h Julian Wiedmann <jwi@linux.ibm.com> s390/qdio: don't touch the dsci in tiqdio_add_input_queues() Julian Wiedmann <jwi@linux.ibm.com> s390/qdio: (re-)initialize tiqdio list entries Heiko Carstens <heiko.carstens@de.ibm.com> s390: fix stfle zero padding Arnd Bergmann <arnd@arndb.de> ARC: hide unused function unw_hdr_alloc Thomas Gleixner <tglx@linutronix.de> x86/irq: Seperate unused system vectors from spurious entry again Thomas Gleixner <tglx@linutronix.de> x86/irq: Handle spurious interrupt after shutdown gracefully Thomas Gleixner <tglx@linutronix.de> x86/ioapic: Implement irq_get_irqchip_state() callback Thomas Gleixner <tglx@linutronix.de> genirq: Add optional hardware synchronization for shutdown Thomas Gleixner <tglx@linutronix.de> genirq: Fix misleading synchronize_irq() documentation Thomas Gleixner <tglx@linutronix.de> genirq: Delay deactivation in free_irq() Vinod Koul <vkoul@kernel.org> linux/kernel.h: fix overflow for DIV_ROUND_UP_ULL Nicolas Boichat <drinkcat@chromium.org> pinctrl: mediatek: Update cur_mask in mask/mask ops Eiichi Tsukata <devel@etsukata.com> cpu/hotplug: Fix out-of-bounds read when setting fail state Nicolas Boichat <drinkcat@chromium.org> pinctrl: mediatek: Ignore interrupts that are wake only during resume Kai-Heng Feng <kai.heng.feng@canonical.com> HID: multitouch: Add pointstick support for ALPS Touchpad Oleksandr Natalenko <oleksandr@redhat.com> HID: chicony: add another quirk for PixArt mouse Kirill A. Shutemov <kirill@shutemov.name> x86/boot/64: Add missing fixup_pointer() for next_early_pgt access Kirill A. Shutemov <kirill@shutemov.name> x86/boot/64: Fix crash if kernel image crosses page table boundary Milan Broz <gmazyland@gmail.com> dm verity: use message limit for data block corruption message Jerome Marchand <jmarchan@redhat.com> dm table: don't copy from a NULL pointer in realloc_argv() Phil Reid <preid@electromag.com.au> pinctrl: mcp23s08: Fix add_data and irqchip_add_nested call order Sébastien Szymanski <sebastien.szymanski@armadeus.com> ARM: dts: imx6ul: fix PWM[1-4] interrupts Sergej Benilov <sergej.benilov@googlemail.com> sis900: fix TX completion Takashi Iwai <tiwai@suse.de> ppp: mppe: Add softdep to arc4 Petr Oros <poros@redhat.com> be2net: fix link failure after ethtool offline test Colin Ian King <colin.king@canonical.com> x86/apic: Fix integer overflow on 10 bit left shift of cpu_khz David Howells <dhowells@redhat.com> afs: Fix uninitialised spinlock afs_volume::cb_break_lock Arnd Bergmann <arnd@arndb.de> ARM: omap2: remove incorrect __init annotation Linus Walleij <linus.walleij@linaro.org> ARM: dts: gemini Fix up DNS-313 compatible string Peter Zijlstra <peterz@infradead.org> perf/core: Fix perf_sample_regs_user() mm check Hans de Goede <hdegoede@redhat.com> efi/bgrt: Drop BGRT status field reserved bits check Tony Lindgren <tony@atomide.com> clk: ti: clkctrl: Fix returning uninitialized data Heyi Guo <guoheyi@huawei.com> irqchip/gic-v3-its: Fix command queue pointer comparison bug Sven Van Asbroeck <thesven73@gmail.com> firmware: improve LSM/IMA security behaviour James Morse <james.morse@arm.com> drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT Masahiro Yamada <yamada.masahiro@socionext.com> nilfs2: do not use unexported cpu_to_le32()/le32_to_cpu() in uapi header Cole Rogers <colerogers@disroot.org> Input: synaptics - enable SMBUS on T480 thinkpad trackpad Konstantin Khlebnikov <khlebnikov@yandex-team.ru> e1000e: start network tx queue only when link is up Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Revert "e1000e: fix cyclic resets at link up with active tx" ------------- Diffstat: Makefile | 4 +- arch/arc/kernel/unwind.c | 9 ++- arch/arm/boot/dts/gemini-dlink-dns-313.dts | 2 +- arch/arm/boot/dts/imx6ul.dtsi | 8 +-- arch/arm/mach-omap2/prm3xxx.c | 2 +- arch/s390/include/asm/facility.h | 21 ++++-- arch/x86/entry/entry_32.S | 24 +++++++ arch/x86/entry/entry_64.S | 30 ++++++-- arch/x86/include/asm/hw_irq.h | 5 +- arch/x86/kernel/apic/apic.c | 36 ++++++---- arch/x86/kernel/apic/io_apic.c | 46 ++++++++++++ arch/x86/kernel/apic/vector.c | 4 +- arch/x86/kernel/head64.c | 20 +++--- arch/x86/kernel/idt.c | 3 +- arch/x86/kernel/irq.c | 2 +- drivers/base/cacheinfo.c | 3 +- drivers/base/firmware_loader/fallback.c | 2 +- drivers/base/regmap/regmap-irq.c | 6 ++ drivers/clk/ti/clkctrl.c | 7 +- drivers/crypto/nx/nx-842-powernv.c | 8 ++- drivers/crypto/talitos.c | 99 +++++++++++--------------- drivers/crypto/talitos.h | 30 ++++++++ drivers/firmware/efi/efi-bgrt.c | 5 -- drivers/gpu/drm/udl/udl_drv.c | 56 ++++++++++++--- drivers/gpu/drm/udl/udl_drv.h | 9 +-- drivers/gpu/drm/udl/udl_fb.c | 12 ++-- drivers/gpu/drm/udl/udl_gem.c | 2 +- drivers/gpu/drm/udl/udl_main.c | 35 +++------ drivers/hid/hid-ids.h | 2 + drivers/hid/hid-multitouch.c | 4 ++ drivers/hid/hid-quirks.c | 1 + drivers/input/mouse/synaptics.c | 1 + drivers/irqchip/irq-gic-v3-its.c | 35 ++++++--- drivers/md/dm-table.c | 2 +- drivers/md/dm-verity-target.c | 4 +- drivers/net/ethernet/emulex/benet/be_ethtool.c | 28 ++++++-- drivers/net/ethernet/intel/e1000e/netdev.c | 21 +++--- drivers/net/ethernet/sis/sis900.c | 16 ++--- drivers/net/ppp/ppp_mppe.c | 1 + drivers/pinctrl/mediatek/mtk-eint.c | 34 +++++---- drivers/pinctrl/pinctrl-mcp23s08.c | 8 +-- drivers/s390/cio/qdio_setup.c | 2 + drivers/s390/cio/qdio_thinint.c | 5 +- fs/afs/callback.c | 4 +- fs/afs/internal.h | 2 +- fs/afs/volume.c | 1 + include/linux/cpuhotplug.h | 1 + include/linux/kernel.h | 3 +- include/uapi/linux/nilfs2_ondisk.h | 24 +++---- kernel/cpu.c | 3 + kernel/events/core.c | 2 +- kernel/irq/autoprobe.c | 6 +- kernel/irq/chip.c | 6 ++ kernel/irq/cpuhotplug.c | 2 +- kernel/irq/internals.h | 5 ++ kernel/irq/manage.c | 88 +++++++++++++++++------ 56 files changed, 534 insertions(+), 267 deletions(-) ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 4.19 35/47] x86/irq: Seperate unused system vectors from spurious entry again 2019-07-18 3:01 [PATCH 4.19 00/47] 4.19.60-stable review Greg Kroah-Hartman @ 2019-07-18 3:01 ` Greg Kroah-Hartman 0 siblings, 0 replies; 8+ messages in thread From: Greg Kroah-Hartman @ 2019-07-18 3:01 UTC (permalink / raw) To: linux-kernel Cc: Greg Kroah-Hartman, stable, Jan Kiszka, Thomas Gleixner, Marc Zyngier, Jan Beulich From: Thomas Gleixner tglx@linutronix.de commit f8a8fe61fec8006575699559ead88b0b833d5cad upstream Quite some time ago the interrupt entry stubs for unused vectors in the system vector range got removed and directly mapped to the spurious interrupt vector entry point. Sounds reasonable, but it's subtly broken. The spurious interrupt vector entry point pushes vector number 0xFF on the stack which makes the whole logic in __smp_spurious_interrupt() pointless. As a consequence any spurious interrupt which comes from a vector != 0xFF is treated as a real spurious interrupt (vector 0xFF) and not acknowledged. That subsequently stalls all interrupt vectors of equal and lower priority, which brings the system to a grinding halt. This can happen because even on 64-bit the system vector space is not guaranteed to be fully populated. A full compile time handling of the unused vectors is not possible because quite some of them are conditonally populated at runtime. Bring the entry stubs back, which wastes 160 bytes if all stubs are unused, but gains the proper handling back. There is no point to selectively spare some of the stubs which are known at compile time as the required code in the IDT management would be way larger and convoluted. Do not route the spurious entries through common_interrupt and do_IRQ() as the original code did. Route it to smp_spurious_interrupt() which evaluates the vector number and acts accordingly now that the real vector numbers are handed in. Fixup the pr_warn so the actual spurious vector (0xff) is clearly distiguished from the other vectors and also note for the vectored case whether it was pending in the ISR or not. "Spurious APIC interrupt (vector 0xFF) on CPU#0, should never happen." "Spurious interrupt vector 0xed on CPU#1. Acked." "Spurious interrupt vector 0xee on CPU#1. Not pending!." Fixes: 2414e021ac8d ("x86: Avoid building unused IRQ entry stubs") Reported-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Jan Beulich <jbeulich@suse.com> Link: https://lkml.kernel.org/r/20190628111440.550568228@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- arch/x86/entry/entry_32.S | 24 ++++++++++++++++++++++++ arch/x86/entry/entry_64.S | 30 ++++++++++++++++++++++++++---- arch/x86/include/asm/hw_irq.h | 2 ++ arch/x86/kernel/apic/apic.c | 33 ++++++++++++++++++++++----------- arch/x86/kernel/idt.c | 3 ++- 5 files changed, 76 insertions(+), 16 deletions(-) --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -1098,6 +1098,30 @@ ENTRY(irq_entries_start) .endr END(irq_entries_start) +#ifdef CONFIG_X86_LOCAL_APIC + .align 8 +ENTRY(spurious_entries_start) + vector=FIRST_SYSTEM_VECTOR + .rept (NR_VECTORS - FIRST_SYSTEM_VECTOR) + pushl $(~vector+0x80) /* Note: always in signed byte range */ + vector=vector+1 + jmp common_spurious + .align 8 + .endr +END(spurious_entries_start) + +common_spurious: + ASM_CLAC + addl $-0x80, (%esp) /* Adjust vector into the [-256, -1] range */ + SAVE_ALL switch_stacks=1 + ENCODE_FRAME_POINTER + TRACE_IRQS_OFF + movl %esp, %eax + call smp_spurious_interrupt + jmp ret_from_intr +ENDPROC(common_interrupt) +#endif + /* * the CPU automatically disables interrupts when executing an IRQ vector, * so IRQ-flags tracing has to follow that: --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -438,6 +438,18 @@ ENTRY(irq_entries_start) .endr END(irq_entries_start) + .align 8 +ENTRY(spurious_entries_start) + vector=FIRST_SYSTEM_VECTOR + .rept (NR_VECTORS - FIRST_SYSTEM_VECTOR) + UNWIND_HINT_IRET_REGS + pushq $(~vector+0x80) /* Note: always in signed byte range */ + jmp common_spurious + .align 8 + vector=vector+1 + .endr +END(spurious_entries_start) + .macro DEBUG_ENTRY_ASSERT_IRQS_OFF #ifdef CONFIG_DEBUG_ENTRY pushq %rax @@ -634,10 +646,20 @@ _ASM_NOKPROBE(interrupt_entry) /* Interrupt entry/exit. */ - /* - * The interrupt stubs push (~vector+0x80) onto the stack and - * then jump to common_interrupt. - */ +/* + * The interrupt stubs push (~vector+0x80) onto the stack and + * then jump to common_spurious/interrupt. + */ +common_spurious: + addq $-0x80, (%rsp) /* Adjust vector to [-256, -1] range */ + call interrupt_entry + UNWIND_HINT_REGS indirect=1 + call smp_spurious_interrupt /* rdi points to pt_regs */ + jmp ret_from_intr +END(common_spurious) +_ASM_NOKPROBE(common_spurious) + +/* common_interrupt is a hotpath. Align it */ .p2align CONFIG_X86_L1_CACHE_SHIFT common_interrupt: addq $-0x80, (%rsp) /* Adjust vector to [-256, -1] range */ --- a/arch/x86/include/asm/hw_irq.h +++ b/arch/x86/include/asm/hw_irq.h @@ -150,6 +150,8 @@ extern char irq_entries_start[]; #define trace_irq_entries_start irq_entries_start #endif +extern char spurious_entries_start[]; + #define VECTOR_UNUSED NULL #define VECTOR_SHUTDOWN ((void *)~0UL) #define VECTOR_RETRIGGERED ((void *)~1UL) --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2027,21 +2027,32 @@ __visible void __irq_entry smp_spurious_ entering_irq(); trace_spurious_apic_entry(vector); + inc_irq_stat(irq_spurious_count); + + /* + * If this is a spurious interrupt then do not acknowledge + */ + if (vector == SPURIOUS_APIC_VECTOR) { + /* See SDM vol 3 */ + pr_info("Spurious APIC interrupt (vector 0xFF) on CPU#%d, should never happen.\n", + smp_processor_id()); + goto out; + } + /* - * Check if this really is a spurious interrupt and ACK it - * if it is a vectored one. Just in case... - * Spurious interrupts should not be ACKed. + * If it is a vectored one, verify it's set in the ISR. If set, + * acknowledge it. */ v = apic_read(APIC_ISR + ((vector & ~0x1f) >> 1)); - if (v & (1 << (vector & 0x1f))) + if (v & (1 << (vector & 0x1f))) { + pr_info("Spurious interrupt (vector 0x%02x) on CPU#%d. Acked\n", + vector, smp_processor_id()); ack_APIC_irq(); - - inc_irq_stat(irq_spurious_count); - - /* see sw-dev-man vol 3, chapter 7.4.13.5 */ - pr_info("spurious APIC interrupt through vector %02x on CPU#%d, " - "should never happen.\n", vector, smp_processor_id()); - + } else { + pr_info("Spurious interrupt (vector 0x%02x) on CPU#%d. Not pending!\n", + vector, smp_processor_id()); + } +out: trace_spurious_apic_exit(vector); exiting_irq(); } --- a/arch/x86/kernel/idt.c +++ b/arch/x86/kernel/idt.c @@ -321,7 +321,8 @@ void __init idt_setup_apic_and_irq_gates #ifdef CONFIG_X86_LOCAL_APIC for_each_clear_bit_from(i, system_vectors, NR_VECTORS) { set_bit(i, system_vectors); - set_intr_gate(i, spurious_interrupt); + entry = spurious_entries_start + 8 * (i - FIRST_SYSTEM_VECTOR); + set_intr_gate(i, entry); } #endif } ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-08-17 19:20 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-08-17 15:36 [PATCH 4.19 35/47] x86/irq: Seperate unused system vectors from spurious entry again Guilherme G. Piccoli 2020-08-17 16:21 ` Greg KH 2020-08-17 16:43 ` Guilherme G. Piccoli 2020-08-17 16:49 ` Greg KH 2020-08-17 16:59 ` Guilherme G. Piccoli 2020-08-17 17:05 ` Greg KH 2020-08-17 17:13 ` Guilherme Piccoli -- strict thread matches above, loose matches on Subject: below -- 2019-07-18 3:01 [PATCH 4.19 00/47] 4.19.60-stable review Greg Kroah-Hartman 2019-07-18 3:01 ` [PATCH 4.19 35/47] x86/irq: Seperate unused system vectors from spurious entry again Greg Kroah-Hartman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).