linux-stable/arch/x86
Saurabh Sengar 00132fab90 x86/ioapic: Don't return 0 from arch_dynirq_lower_bound()
[ Upstream commit 5af507bef9 ]

arch_dynirq_lower_bound() is invoked by the core interrupt code to
retrieve the lowest possible Linux interrupt number for dynamically
allocated interrupts like MSI.

The x86 implementation uses this to exclude the IO/APIC GSI space.
This works correctly as long as there is an IO/APIC registered, but
returns 0 if not. This has been observed in VMs where the BIOS does
not advertise an IO/APIC.

0 is an invalid interrupt number except for the legacy timer interrupt
on x86. The return value is unchecked in the core code, so it ends up
to allocate interrupt number 0 which is subsequently considered to be
invalid by the caller, e.g. the MSI allocation code.

The function has already a check for 0 in the case that an IO/APIC is
registered, as ioapic_dynirq_base is 0 in case of device tree setups.

Consolidate this and zero check for both ioapic_dynirq_base and gsi_top,
which is used in the case that no IO/APIC is registered.

Fixes: 3e5bedc2c2 ("x86/apic: Fix arch_dynirq_lower_bound() bug for DT enabled machines")
Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/1679988604-20308-1-git-send-email-ssengar@linux.microsoft.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-11 23:00:24 +09:00
..
boot x86/boot: Avoid using Intel mnemonics in AT&T syntax asm 2023-01-18 11:48:53 +01:00
configs
crypto crypto: x86/ghash - fix unaligned access in ghash_setkey() 2023-03-10 09:39:08 +01:00
entry exit: Add and use make_task_dead. 2023-02-01 08:27:20 +01:00
events x86/perf/zhaoxin: Add stepping check for ZXC 2023-03-10 09:39:05 +01:00
hyperv x86/hyperv: Remove unregister syscore call from Hyper-V cleanup 2022-12-31 13:14:39 +01:00
ia32
include x86/cpu: Add model number for Intel Arrow Lake processor 2023-05-11 23:00:15 +09:00
kernel x86/ioapic: Don't return 0 from arch_dynirq_lower_bound() 2023-05-11 23:00:24 +09:00
kvm KVM: nVMX: Emulate NOPs in L2, and PAUSE if it's not intercepted 2023-05-11 23:00:18 +09:00
lib x86/asm: Fix an assembler warning with current binutils 2023-01-24 07:22:42 +01:00
math-emu
mm x86/mm: Fix use of uninitialized buffer in sme_enable() 2023-03-22 13:31:36 +01:00
net x86/extable: Extend extable functionality 2022-07-29 17:25:26 +02:00
pci x86/PCI: Add quirk for AMD XHCI controller that loses MSI-X state in D3hot 2023-04-20 12:13:55 +02:00
platform x86/olpc: fix 'logical not is only applied to the left hand side' 2022-08-17 14:24:18 +02:00
power x86/pm: Add enumeration check before spec MSRs save/restore setup 2022-12-02 17:41:09 +01:00
purgatory purgatory: fix disabling debug info 2023-04-26 13:51:53 +02:00
ras
realmode
tools
um x86: um: vdso: Add '%rcx' and '%r11' to the syscall clobber list 2023-03-11 13:57:26 +01:00
video
xen x86/PVH: avoid 32-bit build warning when obtaining VGA console info 2023-04-05 11:25:02 +02:00
.gitignore
Kbuild
Kconfig x86/microcode: Default-disable late loading 2023-03-10 09:39:12 +01:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug arch: make TRACE_IRQFLAGS_NMI_SUPPORT generic 2022-08-17 14:23:00 +02:00
Makefile x86/realmode: build with -D__DISABLE_EXPORTS 2022-07-23 12:53:56 +02:00
Makefile.um
Makefile_32.cpu