summaryrefslogtreecommitdiff
path: root/drivers/irqchip
AgeCommit message (Collapse)Author
2026-11-05treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() familyKees Cook
Mirroring the earlier kmalloc_obj() conversion, convert the device-managed allocators over to the type-based API using the now updated scripts/coccinelle/api/kmalloc_objs.cocci. The size is derived from the type rather than written out as a sizeof(), and the result is a pointer to that type rather than void *, so a mismatch between the size requested and the variable assigned becomes a build error instead of being silently accepted. The conversions break down as: 6713 devm_kzalloc_obj() 1749 devm_kzalloc_objs() 307 devm_kzalloc_flex() 91 devm_kmalloc_objs() 82 devm_kmalloc_obj() 2 devm_kmalloc_flex() The rules deliberately leave alone allocations sized by a string or a byte-sized type, or assigned to a pointer to a byte-sized type, since those are byte buffers rather than objects. Allocations sized by a multi-byte integer type are only converted when they are assigned to a pointer to that same type, and allocations of pointers to integers or of void pointers are left alone too. After this change, 528 files still call devm_kmalloc(), devm_kzalloc(), devm_kcalloc(), or devm_kmalloc_array(). Build tested with allmodconfig on x86_64, arm64, i386, arm, riscv, s390, m68k, mips, parisc, sparc, loongarch, arc, xtensa, and openrisc with GCC 16.2.0 with no new warnings. Signed-off-by: Kees Cook <kees+treewide@kernel.org>
2026-11-05treewide: refresh kmalloc_obj() conversionsKees Cook
Refresh the tree with run of the existing Coccinelle rules in scripts/coccinelle/api/kmalloc_objs.cocci, now that they also convert arrays of multi-byte integers. The conversions break down as: 435 kzalloc_objs() 169 kmalloc_objs() 52 kvzalloc_objs() 47 kzalloc_obj() 42 kvmalloc_objs() 8 kmalloc_obj() 2 kzalloc_flex() 2 kvmalloc_flex() and 37 existing kmalloc_obj() family calls drop a redundant GFP_KERNEL. Build tested with allmodconfig on x86_64 with GCC 16.2.0, and, together with the devm_kmalloc_obj() conversion that follows, on x86_64, arm64, i386, arm, riscv, s390, m68k, mips, parisc, sparc, loongarch, arc, xtensa, and openrisc with GCC 16.2.0 with no new warnings. Signed-off-by: Kees Cook <kees+treewide@kernel.org>
2026-11-01Merge tag 'irq-urgent-2026-11-01' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull misc irqchip fixes from Ingo Molnar: - Fix the hardware IRQ-retrigger logic on the riscv-imsic irqchip driver (Avi Weiss) - Fix MSI descriptor leak in the irq-msi-lib irqchip driver (Avi Weiss) * tag 'irq-urgent-2026-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/irq-msi-lib: Free wired MSI descriptors irqchip/riscv-imsic: Report successful hardware retrigger
2026-10-28irqchip/irq-msi-lib: Free wired MSI descriptorsAvi Weiss
msi_device_domain_alloc_wired() allocates a descriptor for each interrupt, but wired MSI domains do not set MSI_FLAG_FREE_MSI_DESCS. msi_device_domain_free_wired() releases the IRQ without freeing its descriptor, eventually exhausting the domain. Failed allocations also leave descriptors behind. Set MSI_FLAG_FREE_MSI_DESCS for wired MSI domains so both paths release the descriptors. Fixes: 64a855324311 ("irqchip/irq-msi-lib: Prepare for DOMAIN_BUS_WIRED_TO_MSI") Signed-off-by: Avi Weiss <thnkslprpt@gmail.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261025122058.2180685-1-thnkslprpt@gmail.com
2026-10-28irqchip/riscv-imsic: Report successful hardware retriggerAvi Weiss
imsic_irq_retrigger() writes to the IMSIC MSI register to retrigger an interrupt, but returns 0. The IRQ core treats zero as failure and may schedule a software resend despite the hardware retrigger. Return 1 after the MSI write to report successful hardware retriggering and prevent the unnecessary software resend. Fixes: 027e125acdba ("irqchip/riscv-imsic: Add device MSI domain support for platform devices") Signed-off-by: Avi Weiss <thnkslprpt@gmail.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Björn Töpel <bjorn@kernel.org> Reviewed-by: Anup Patel <anup@brainfault.org> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261026122641.3292904-2-thnkslprpt@gmail.com
2026-10-23Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvmLinus Torvalds
Pull KVM updates from Paolo Bonzini: "ARM: - pKVM state isolation: years after pKVM started being enabled upstream, we finally get the basics in the form of state isolation. The vcpu state is now off-limit for the host for protected VMs - pKVM also grows a hypervisor-private memory allocator, allowing it to deal with sub-page allocation, much like everywhere else - pKVM also lands a trace_printk() equivalent, which hopefully will make debugging a bit easier - First shot at annotating portions of the KVM/arm64 code to be extracted and built on s390. The real fun is yet to come - Allow pre-faulting of stage-2 canonical mappings from userspace, joining x86 and s390 in implementing this feature - Add a reverse mapping infrastructure for shadow stage-2, significantly improving performance when MMU notifiers kick in, and avoiding full unmap of all shadow tables for this VM - Next step of GICv5 enablement, adding support for the IRS block, and providing both SPI and LPI support. This is the first point where KVM/arm64 can support an SMP GICv5 guest - As a preliminary to eventually enabling CCA, add a bunch of infrastructure to KVM/arm64, splitting some of the basic operations into individual backends (normal VM, normal pKVM VM, protected pKVM VM). This allows CCA to later slot in without polluting the rest of KVM with its firmware-driven nonsense - Make ID registers immutable from the point where a vcpu is able to run, even if it fails to run. This prevents KVM from sampling untrusted values - Restore some type checking to the EL2 object. KVM/arm64 originally had some strong type checking between the kernel and the EL2 object, but lost it along the way when the private hypercall interface was (somewhat pointlessly) converted to SMCCC. Type checking is back, syscall style, and with added sparse goodies - Expand the FFA support to FFA_NOTIFICATION_*, and add some sanitisation of the protocol that pKVM relays to the "trusted" runtime - Make GICv3 RD assignment more robust to userspace nonsense - Convert the remaining MMU fault handler backends to kvm_s2_fault_vma_info and co., fixing a number of bugs in the process - Fix the SError/SEA selftests to be both more robust and less braindead - Fix a smattering of documentation bugs, some of them as a result of our AI friends spitting out credible assertions based on non-existing symbols - The usual collection of low impact bug fixes (SMCCC, timers, PMU) Loongarch: - Add separate vmid support - Simplify MSI interrupt injection - Add crash hypercall support - Allow to set pv_feature until vCPU run - Enable HW page table walk automatically in selftests s390: - rework page allocation for secure guest variable storage - Selftests and documentation improvements - Replace get_zeroed_page with kzalloc - Fix corner cases of floating interrupt injection - Initial arm64 on s390 support x86: - Clean up the handling of vcpu->arch.xen.long_mode to be consistent and correctly handle 32-bit/64-bit alignment, and various other bug fixes have accumulated over the months since v1 - Grab KVM's SRCU "lock" in kvm_zap_gfn_range() to fix a recurring bug where callers fail to do so - Fix a variety of issues in the pre-fault code that are mostly benign in the current code base, but will show up in big ways if/when the pre-faulting logic is used to implementing prefetch-on-fault for the TDP MMU - For PREEMPT_RT=y kernels, drop the rmaps' individual bit-spinlock and just walk the rmaps' with mmu_lock taken. On the write side (which always uses mmu_lock), the bit-spinlock was assuming that preemption was disabled, but that is *not* true when rwlocks become sleepable - Prepare a memory_fault exit (paired with -EFAULT) when KVM hits an error PFN, e.g. so that userspace can resolve transient issues instead of killing the guest. Convert a variety of WARN()+EFAULT paths into KVM_BUG_ON()+EIO so that KVM can hard commit to filling memory_fault on -EFAULTs that occur in the page fault path - Fix a NX hugepage un-accounting bug where KVM would always uncharge the shadow MMU, even when handling TDP MMU pages - Mask off the address space ID when checking for illegal usage of kvm_set_internal_memslot() to prevent false negatives on the sanity check - Explicitly zero reserved flags when delivering a SynIC message to avoid leaking a byte of stack information to the guest - Rework TDX's handling of the canonical MMU root level to not rely on userspace to fill CPUID correctly, as doing so lets userspace trivially trigger a KVM_BUG_ON() - Reject KVM_SET_NESTED_STATE if userspace "restores" L1 with EFER.LMA=1 && EFER.LME=0, which confuses KVM into trying to configure an 64-bit MMU without PAE - Ignore EFER.LMA (clear it from KVM's cached save state) if EFER.LME=0 when preparing L2 state, to fix another way to confuse KVM's MMU (and because real hardware also ignores EFER.LMA) - Improve KVM's sanity checks for a misconfigured MMU to (hopefully) detect all of the ways KVM can botch EFER.LMA vs. CR4.PAE - Remove the "full" out-param from kvm_x86_ops.flush_tlb_gva() as the param is only used to avoid what effectively amounts to a single memory write - Fix a mostly-benign bug where KVM can write through a guest's read-only mapping due to not checking the error code when expediting emulated MMIO page faults - Honor the guest's view of the "EFER.LMSLE must be zero" defeature so that userspace can provide migration compatibility between Rome and Milan+ - Pend a KVM_REQ_EVENT request when an exception is morphed into a nested VM-Exit, otherwise KVM can fail to actually deliver the nested VM-Exit, e.g. when injecting a page fault - Add support for PML on SVM - Add support for virtualizing Bus Lock Detect on SVM, and fix a number of DR6 bugs and warts along the way - Fix a variety of warts in KVM's handling of guest TSC, kvmclock, and timekeeping in general, as a (big) first step towards addressing several longstanding problems with the kvmclock implementation. Most notably, fix a precision issue where get_kvmclock_ns() computed the clock from the *host* TSC without applying guest TSC scaling, causing systemic drift from the values the guest computes from its own TSC - Rip out KVM's shadow timekeeping structures, now that ktime snapshots are powerful enough to replace it - Misc fixes and cleanups x86 (AMD): - Fix a benign-in-practice bug where KVM unintentionally sets a non-zero error code when delivering exceptions to SEV-ES+ guests - Force a new ASID in both VMCBs on pCPU migration to fix a bug where KVM can run a VMCB with a stale ASID due to the tracking being per-CPU, not per-VMCB - Return INVALID_INPUT to the guest instead of exiting to userspace with -EIO if KVM can't access "guest request" buffer, i.e. try to keep the guest alive if the guest or userspace goofs x86 (Intel): - Enable Notify VM-Exits (now called Instruction Timeout in the SDM) and Bus Lock VM-Exits for TDX guests when they're enabled by userspace (KVM forgot to wire up the TDX Module knobs) - Move all common (between VMX and TDX) APIs/helpers to common.h/main.c, and change all namespace prefixes from "vmx" to "vt" - Fix a thankfully benign bug (due to other areas of KVM being hardened) where userspace can bypass INIT_MEM_REGION's address wrap check by providing a nr_pages that will overflow a u64 when converted to bytes, and fix an also- benign off-by-one bug in the check (inclusive vs. exclusive) - Set the vmcs.GUEST_ACTIVITY_STATE back to ACTIVE when userspace sets KVM's mp_state to anything other than HALTED, e.g. so that a vCPU doesn't get stuck in HLT if userspace emulates RESET guest_memfd: - Take the invalidate lock when unbinding a dying file to fix a race with kvm_gmem_invalidate_end() that results in KVM leaving the MMU invalidation count elevated. Not taking the lock in the first place was pure misguided paranoid - When binding a memslot, purge the bindings if storing the new memslot fails, as Xarray's "store range" API can subtly fail partway through - Establish memslot<=>guest_memfd bindings *after* the memslot is ready, as the memslot becomes reachable the instant the binding is installed - Don't grab a page refcount when reloading an SNP VMSA and stop returning a "struct page" from guest_memfd's PFN lookup altogether, to ensure that KVM doesn't hold any unnecessary refcounts (the lifetime of the page is ensured by MMU notifiers and similar hooks). Preventing unnecessary refcounts greatly simplifies supporting in-place SHARED=>PRIVATE conversions - Add support for in-place PRIVATE<=>SHARED conversion, i.e. allow a single guest_memfd instance to be used for both PRIVATE and SHARED variations of CoCo guests' memory (though not at the same time). This eliminates the need to double allocate guest memory for TDX and SNP, and is basically a hard requirement for pKVM, which relies on being able to preserve memory contents on conversions - Hack-a-fix a deadlock bug in ->error_remove_folio() by returning -EBUSY if the filemap invalidate lock is contended. Punt on a proper fix for the moment, as a proper fix likely involves reworking truncate_error_folio() - Add a pile of selftests for in-place conversions - Misc guest_memfd cleanups Generic: - Move some configuration items to preprocessor symbols, to help with arm-on-s390's need to compile the same code twice with different values - Allow KVM implementations to choose alternative device names, also for s390's support of ARM virtualmachines - Switch the KVM-VFIO interface and external consumers over to standard file-based reference counting, eliminating all external KVM symbol exports Selftests: - Rework KVM selftest's handling of memory regions all so that PPC can force its page table allocations to be naturally aligned - PPC support - Fix emulation of VMPTRST and VMPTRLD when eVMCS is in-use to match real Hyper-V's behavior - Saturate L2's TSC frequency if stacking L1 and L2 scaling multipliers exceeds what hardware supports, as attempting to run L2 with an illegal multiplier will either cause VM-Entry to fail (VMX) or trigger a #GP when writing MSR_AMD64_TSC_RATIO (SVM). The #GP is thankfully benign in the grand scheme as even "unsafe" WRMSRs have exception fixup - Rework KVM selftest's handling of memory regions so that PPC can force its page table allocations to be naturally aligned - Clean up selftest's VMX instruction helpers, and drop an absurd number of completely useless return values, e.g. functions that unconditionally return %true and then have every caller assert success - Add selftests support for Zhaoxin CPUs - Overhaul the TSC scaling test to add a regression test for the saturation behavior, and to increase its coverage in general - Fix selftests usage various NUMA syscalls to account for an undocumented, but known since 2007, off-by-one kernel bug. Add helpers to try and avoid re-introducing the same flaws in the future - Automatically run xAPIC IPI migration test (between NUMA nodes) when possible, as the entire point of the test is verify KVM's handling of page migration of the APIC backing page - Misc cleanups" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (506 commits) KVM: always make in-place conversion a compile-time constant when possible KVM: x86: leave the legacy private attribute in for TDX and SEV KVM: split CONFIG_KVM_PRIVATE_MEMATTR_VM out of KVM_VM_MEMORY_ATTRIBUTES selftests: kvm: remove useless comma operator arm64: Use proper include variant MAINTAINERS: Add entry for ARM on s390 KVM KVM: s390: arm64: Integrate arm on s390 KVM: s390: arm64: Implement basic page fault handler KVM: s390: arm64: Implement vCPU IOCTLs KVM: s390: arm64: Implement vm/vcpu create destroy KVM: s390: arm64: Implement required functions KVM: s390: Add basic arm64 kvm module s390/hwcaps: Report SAE support as hwcap KVM: s390: arm64: Introduce host definitions s390: Introduce Start Arm Execution instruction KVM: s390: Use arm64 code s390/tools: Use arm64 headers KVM: s390: Use dedicated function for migration mode s390/Kconfig: remove PCI dependency from HAS_IOMEM KVM: s390: Kick PV cpus at the right time for service irqs ...
2026-10-22Merge tag 'soc-dt-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/socLinus Torvalds
Pull SoC devicetree updates from Arnd Bergmann: "This is a rather large update of over 1000 non-merge commits touching devicetree files and bindings. A few notable SoC were added this time: - Apple M4 and A18 Pro are used in laptops, these follow the M3 model added in 7.2. - Google Laguna (aka Tensor G5) is used last year's Pixel phone generation. Unlike the earlier Tensor chips, this is not based on Samsung's Exynos family design but starts a new chip family. - Qualcomm's Hawi and Nord SoCs are two powerful chips using the custom Oryon cores. Product names and applications are so far not known, which means that Qualcomm is doing something right by upstreaming kernel support early. The ST stm32mp23xc/stm32mp25xc SoC support was previously removed because there were no users upstream, but they are back now that boards have shown up. Renesas RZ/G2M v3.0 (R8A774A3) is just a minor variation of the already supported SoC. In total, there are 81 new dts files for individual boards, and they are all over the place. Only one riscv based machine is added, the Milk-V Meles SBC using the T-Head th1520 chip. For 32-bit Arm, we have 13 new boards. About half are industrial embedded boards using NXP i.MX6/7 chips, the rest are older products: two Amazon tablets, two Motorola phones and two SoM boards. Everything else is 64-bit Arm: - many industrial embedded boards using NXP layerscape, NXP i.MX8/9, Qualcomm Hamoa, ST stm32mp2, Rockchip rk35xx, and Renesas RZ/G2 SoCs - Laptops and tablets using Apple M4, Qualcomm Snapdragon X2, Snapdragon X1 Elite and Allwinner A133 chips - Valve Steam Frame VR headset using Snapdragon 8 Gen 3 - Seven handheld game consoles using Qualcomm Dragonwing qcs8550 - Mobile phones using Google Tensor G5, Samsung Exynos 850, and various Qualcomm Snapdragon chips Aside from the new stuff, there is still a lot going on for existing socs and boards, including GPU hardware support on MediaTek MT8173 based laptops. Most patches actually add features this time, as the compile-time diagnostic changes are slowing down" * tag 'soc-dt-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (1022 commits) arm64: dts: rockchip: Add Radxa E54C dt-bindings: arm: rockchip: Add Radxa E54C arm64: dts: rockchip: remove FRL GPIO for 100ASK DshanPi A1 arm64: dts: rockchip: fix M.2 E-key reset pinctrl on rk3588 rock-5-itx arm64: dts: rockchip: add pcie30phy data-lanes on rk3588 coolpi-cm5-evb arm64: dts: rockchip: Add the fan tachometers to Kobol Helios64 arm64: dts: rockchip: enable NPU on Radxa E52C arm64: dts: rockchip: fix adc button voltage on Radxa E52C riscv: dts: sophgo: sg2002-milkv-duo256m: drop reserved memory node riscv: dts: sophgo: cv1800b-milkv-duo: drop reserved memory node arm64: dts: nuvoton: npcm845-evb: Add peripheral nodes arm64: dts: nuvoton: npcm845-evb: Fix DTS coding style arm64: dts: nuvoton: npcm845: Add peripheral nodes arm64: dts: nuvoton: npcm845: Split APB address ranges riscv: dts: sophgo: cv180x: Fix internal ephy node name riscv: dts: sophgo: add Milk-V Duo 256M ethernet support overlay riscv: dts: sophgo: Limit SG2042 SPI NOR to 12.5 MHz riscv: dts: sophgo: Enable SPI NOR on SRD3-10 riscv: dts: spacemit: set ETH MAC from eeprom for OrangePi arm64: dts: allwinner: sun50i-h616: Add video engine ...
2026-10-21Merge tag 'irq-drivers-2026-10-20' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq chip driver updates from Thomas Gleixner: "Updates for interrupt chip drivers: - Remove the futile attempts to cleanup resources when the probing of the main interrupt chip fails for SiFIVE/PLIC devices. If that probe fails the system will stall immediately afterwards in the boot process without reaching a state where the error could be diagnosed. The lack of resource cleanup led to a frenzy of AI detected/assisted "fixes" which just make the code pretend to be correct for no value. Remove the existing half baked cleanup and immediately panic the machine when the probe fails. That's far more useful than letting it proceed and stall out a millisecond later with no information about the root cause. - A series of fixes for the ARM GIC-V3 driver addressing a potential double free, a bitmask overrun on 32-bit ARM and a OF node leak. - Automatically set the IRQ_DOMAIN_FLAG_DESTROY_GC when a interrupt domain is created that also allocates the generic interrupt chip during domain creation. That removes the requirement for manually setting the flag in the domain creation info structure when it contains a valid entry for allocating the generic interrupt chip. Remove the therefore redundant setters of IRQ_DOMAIN_FLAG_DESTROY_GC in the existing drivers. - Add support for Annapurna Labs FIC version 2 and 3 and implement affinity control for the demultiplexed interrupts by utilizing the recently merged interrupt redirection infrastructure. - Convert the ACPI device ID structures to named initializers - Consolidate the IPI related constants for RISC-V interrupt controllers - Add support for Qualcomm Purwa SoC interrupt chip and consolidate the workaround for the previous version in Hamoa SoCs. - The usual small fixes and improvements all over the place" * tag 'irq-drivers-2026-10-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (61 commits) irqchip/al-fic: Support per-child affinity via interrupt redirection irqchip/al-fic: Add support for FIC v3 irqchip/al-fic: Support error and fatal outputs and FIC v2 dt-bindings: interrupt-controller: amazon,al-fic: Add mask selection irqchip/al-fic: Switch to shared parent interrupt irqchip/al-fic: Keep the device_node instead of a cached name string irqchip/al-fic: Use %pOF and raise init log level irqchip/al-fic: Use %pe to print init error irqchip/al-fic: Fix coding style issues irqchip: Use named initializers for acpi_device_id irqchip/gic-v5: Fix standalone IRSes OF probe dt-bindings: interrupt-controller: gicv5: Relax IRS properties constraints irqchip/renesas-rzv2h: Preserve TIEN state in rzv2h_tint_set_type() irqchip/loongson-eiointc: Use pa_to_nid() rather than hard-code irqchip/riscv-imsic: Expose the fwnode via the global config irqchip/meson-gpio: Allow the GPIO interrupts to wake the system irqchip/gic-v3: Ensure change to DS is visible irqchip/mips-gic: Transfer interrupt mask state across clusters irqchip/mips-gic: Fix recursive acquisition of gic_lock in gic_set_affinity() irqchip/mips-gic: Fix unbalanced cm_core_lock in for_each_online_cpu_gic() ...
2026-10-15irqchip/al-fic: Support per-child affinity via interrupt redirectionEliav Farber
The FIC multiplexes up to 32 sources into one parent GIC SPI, and a child's handler runs in the parent's context, so a child has no affinity control of its own. irq_set_affinity() therefore fails with -EINVAL, and drivers that treat that as fatal cannot probe when their interrupt arrives through a FIC group. The parent routing cannot be changed on behalf of one child either, because several FIC groups may share one SPI and all of them would move with it. Use the interrupt redirection infrastructure. Dispatch children with generic_handle_demux_domain_irq() and set irq_set_affinity to irq_chip_redirect_set_affinity(), so a child whose affinity excludes the CPU taking the parent interrupt runs on its target CPU in IRQ work context. The interrupt is still taken on the parent's CPU; only the child's handler body moves. Redirection defers the whole flow handler, so the cause bit is cleared in al_fic_irq_pre_redirect(), which runs in parent context on both the inline and the redirected path. A level configured group is masked there too, because its cause bit re-latches while the input stays asserted; the deferred handle_level_irq() masks again and unmasks when the handler is done. An edge configured group is only acked, since handle_edge_irq() has no unconditional unmask. irq_ack is a noop because irq_pre_redirect runs on every dispatch and the ack must not happen twice. Signed-off-by: Eliav Farber <farbere@amazon.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20261011050449.41903-10-farbere@amazon.com
2026-10-15irqchip/al-fic: Add support for FIC v3Eliav Farber
FIC v3 reports version id 2 in the control register version field. It exposes the same info/error/fatal groups as v2, so add the version to enum al_fic_version; the existing "version_id > V1" handling masks the error and fatal groups at init as for v2. Signed-off-by: Eliav Farber <farbere@amazon.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20261011050449.41903-9-farbere@amazon.com
2026-10-15irqchip/al-fic: Support error and fatal outputs and FIC v2Eliav Farber
FIC v2 hardware adds two interrupt outputs on top of the info output: an error output and a fatal output, each with its own mask register (AL_FIC_ERROR_MASK, AL_FIC_FATAL_MASK). A group drives exactly one of the three outputs. Read which output a group drives from the amazon,al-fic-mask devicetree property (info, error or fatal; absent means info) and program the matching mask register. Detect the hardware revision from the CONTROL register version field (bits 28-29). The revision is not in the devicetree, so requesting the error or fatal output on a v1 device - which has neither - is rejected at probe against the register. Name the selected output in the probe log line, in place of the "Legacy mode" text it replaces. A booted system then shows which output each group drives. The "v1" and "v2" names are this driver's labels for the CONTROL version field encoding (0 and 1). The driver seeds mask_cache from the value it programs rather than having the generic chip read the mask register back, so the error and fatal mask registers are never read - which also sidesteps the v2 erratum where they always read as 0 regardless of their contents. Reading CONTROL to get the version field turns the write that follows into a read-modify-write instead of a value built from CONTROL_MASK_MSI_X alone. Every RW bit in this register resets to 0, so the two are equivalent at probe time; the read-modify-write is kept anyway as the better practice; it costs nothing and does not depend on the reset value staying 0. Signed-off-by: Eliav Farber <farbere@amazon.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20261011050449.41903-8-farbere@amazon.com
2026-10-15irqchip/al-fic: Switch to shared parent interruptEliav Farber
Until now the driver requested its parent interrupt using the chained IRQ API (irq_set_chained_handler_and_data()), which only works when each parent interrupt is wired to a single FIC instance. A FIC controller is built from groups, each described by its own DT node, and the groups of one controller share that controller's output line toward the parent. So a real devicetree has several FIC nodes on one parent GIC SPI, and a chained handler can only be installed once per parent. Cascading compounds this: an aggregating group collects several peripherals' outputs onto the line above it. To support that, request the parent interrupt as a shared interrupt (IRQF_SHARED) instead of installing a chained handler. The handler now has the standard irqreturn_t prototype and reports whether this instance had anything pending, so the shared-IRQ core can tell which instance on the line raised the interrupt. IRQF_NO_THREAD is set because the handler only demultiplexes to the child domain and must not be forced-threaded; all instances sharing a parent line agree on this flag, as the shared-IRQ core requires. The handler reads the group's cause register and returns IRQ_HANDLED when any unmasked cause bit is set, IRQ_NONE otherwise. That is the signal the shared-IRQ core needs - "did this instance's hardware raise the line" - rather than the result of dispatching to the child domain. For that filter to be right, gc->mask_cache must be valid before the parent is requested. IRQ_GC_INIT_MASK_CACHE seeds it from the mask register only on the first child mapping, and never at all for a group with no consumer in the devicetree; until then the cache reads 0 and every latched cause bit passes the filter. Seed it from the value al_fic_wire_init() programmed and drop the flag; nothing can change the register in between, so the read could only have returned that same value. request_irq() can fail, unlike irq_set_chained_handler_and_data(), so add an error path for it. Set IRQ_DOMAIN_FLAG_DESTROY_GC on the domain after creating it, so irq_domain_remove() tears the generic chips down too and the single call suffices for both the chip-allocation and request_irq() failure paths. Co-developed-by: Talel Shenhar <talel@amazon.com> Signed-off-by: Talel Shenhar <talel@amazon.com> Signed-off-by: Eliav Farber <farbere@amazon.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20261011050449.41903-6-farbere@amazon.com
2026-10-15irqchip/al-fic: Keep the device_node instead of a cached name stringEliav Farber
struct al_fic cached a const char *name that al_fic_wire_init() set from node->name. That string pointed into the device_node, so the driver already depended on the node outliving init, but nothing in the struct said so. Keep the device_node itself and derive the name where it is needed. The dependency does not go away: of_node_full_name() also returns a pointer into the node, and irq_alloc_domain_generic_chips() keeps the string it is given. The driver therefore needs its own reference. of_irq_init() holds one across the init callback, but since commit 30724547b221 ("of/irq: Fix remaining refcount leaks in of_irq_init()") it drops that reference again when it drains its parent list. Take a reference where the pointer is stored and drop it on the error path. The driver is __init-only with no teardown, so on success it is held for the life of the system. Deriving the name this way also changes the generic chip name from the bare node name (e.g. "interrupt-controller") to the full name including the unit address (e.g. "interrupt-controller@fd8a8500"), which keeps instances that share a bare name distinguishable. Signed-off-by: Eliav Farber <farbere@amazon.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20261011050449.41903-5-farbere@amazon.com
2026-10-15irqchip/al-fic: Use %pOF and raise init log levelEliav Farber
Use %pOF in the driver's log messages, so that both the success and the error paths identify the specific FIC instance by its full devicetree path rather than by its bare node name, e.g.: /soc/interrupt-controller@fd803000 initialized successfully in Legacy mode (parent-irq=3) A single controller is described by several FIC nodes that share the same bare node name (e.g. "interrupt-controller"), so the bare name cannot tell one instance from another. The full path includes the unit address and keeps the instances distinguishable. While converting the parent-missing message, fix a grammar typo in it ("device require a parent" -> "device requires a parent"). Raise the successful-initialization message from pr_debug to pr_info, as this single boot-time printout is useful when dynamic debug is not enabled at this stage of boot. Signed-off-by: Eliav Farber <farbere@amazon.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20261011050449.41903-4-farbere@amazon.com
2026-10-15irqchip/al-fic: Use %pe to print init errorEliav Farber
al_fic_init_dt() logs PTR_ERR(fic) with %lu when al_fic_wire_init() fails. PTR_ERR() returns a signed long, so printing it with an unsigned format specifier turns a negative error code into a large positive value, making it harder to read. Pass fic to %pe directly instead of unwrapping it with PTR_ERR() first. %pe accepts the ERR_PTR-encoded pointer itself and prints a symbolic error name (e.g. -EINVAL) when one is known, falling back to the plain decimal value otherwise. Signed-off-by: Eliav Farber <farbere@amazon.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20261011050449.41903-3-farbere@amazon.com
2026-10-15irqchip/al-fic: Fix coding style issuesEliav Farber
Remove pointless line breaks and align continuations and struct declarations properly. No functional change. [ tglx: Do a full sweep of the code instead of fixing a single instance ] Signed-off-by: Eliav Farber <farbere@amazon.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20261011050449.41903-2-farbere@amazon.com
2026-10-15irqchip: Use named initializers for acpi_device_idPawel Zalewski
Use a designated initializer for the acpi_device_id fields which makes the code more readable and consistent with how lists are initialized in the rest of the kernel code base. Also drop explicitly setting fields to 0 where it is redundant. Unify the list terminator to have a single space between the brackets and no trailing comma. Signed-off-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20261014-acpi-irqchip-v1-1-821917378de3@thegoodpenguin.co.uk
2026-10-15irqchip/gic-v5: Fix standalone IRSes OF probeLorenzo Pieralisi
An IRS is architecturally allowed to be standalone, namely, with no direct CPUs connections. Make sure such configuration is allowed on OF firmware by skipping "cpus" and "arm,iaffids" IRS node properties parsing if they are not present so that the IRS configuration can complete successfully. Fixes: 5cb1b6dab2de ("irqchip/gic-v5: Add GICv5 IRS/SPI support") Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com> Link: https://patch.msgid.link/20261015-gicv5-irs-no-cpus-v1-2-d4b337b7f000@kernel.org
2026-10-15irqchip/renesas-rzv2h: Preserve TIEN state in rzv2h_tint_set_type()Au Dang
rzv2h_tint_set_type() clears TIEN while switching the TINT source and then unconditionally sets it again, enabling the interrupt even if it was disabled before the call. Restore the previous TIEN state instead of forcing it on. Fixes: 0d7605e75ac2 ("irqchip: Add RZ/V2H(P) Interrupt Control Unit (ICU) driver") Signed-off-by: Au Dang <au.dang.jx@renesas.com> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261014095927.635132-1-tommaso.merciai.xr@bp.renesas.com
2026-10-15irqchip/loongson-eiointc: Use pa_to_nid() rather than hard-codeHuacai Chen
NODE_ADDRSPACE_SHIFT is 44 now but may be changed in the future, so use pa_to_nid() rather than the hard-coded valud. Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20261013062358.60654-1-chenhuacai@loongson.cn
2026-10-15irqchip/riscv-imsic: Expose the fwnode via the global configPrajwal N
The fwnode describes a global property of the IMSIC interrupt controller that is equally relevant to external consumers of imsic_global_config as it is to the imsic_priv itself. Keeping it in imsic_priv forces the external drivers to access the private structure rather than using the already exported imsic_get_global_config() interface. Moving the fwnode into imsic_global_config makes the public API self-contained and eliminates the need for callers to access imsic_priv internals directly. Signed-off-by: Prajwal N <prajwal.n@oss.qualcomm.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20261002120417.2708979-1-prajwal.n@oss.qualcomm.com
2026-10-15irqchip/meson-gpio: Allow the GPIO interrupts to wake the systemIgor Velkov
meson_gpio_irq_chip has neither .irq_set_wake nor IRQCHIP_SKIP_SET_WAKE, so enable_irq_wake() fails with -ENXIO for every interrupt routed through it, and such an interrupt never gets IRQD_WAKEUP_STATE. That matters for suspend-to-idle. suspend_device_irqs() keeps only the wakeup interrupts enabled; the rest are suspended and masked by the flow handler when they first fire. A GPIO interrupt that fires during s2idle therefore brings a CPU out of idle once, gets masked, and the system sleeps on. For mem the firmware chooses the wakeup sources, and this flag changes nothing there. Set IRQCHIP_SKIP_SET_WAKE, like the other hierarchical irqchips with a GIC parent. The GIC sets the same flag, so irq_chip_set_wake_parent() would end there anyway. Tested on ODROID-HC4 with the PCF8563 alarm interrupt routed through this controller: with the flag the alarm wakes the board from s2idle 4/4, and /sys/power/pm_wakeup_irq names it; without the flag the board stayed in s2idle past the alarm until a power cycle (0/5). Signed-off-by: Igor Velkov <iav@iav.lv> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Assisted-by: LLM Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20261010-meson-gpio-wake-v2-1-790ecc6df792@iav.lv
2026-10-15irqchip/gic-v3: Ensure change to DS is visibleVladimir Murzin
Sashiko reported missing GIC synchronization when the FLAGS_WORKAROUND_INSECURE path modifies DS. Specifically, an immediate read of the DS state after the write might not observe the effect of that write, which can lead to misreporting the DS state. Updates to the DS bit are tracked by RWP, so poll it after the write before proceeding to read back the DS state. Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Link: https://patch.msgid.link/20260930161123.46368-1-vladimir.murzin@arm.com
2026-10-15irqchip/mips-gic: Transfer interrupt mask state across clustersBenoît Monin
When an interrupt's affinity is moved to a CPU in another cluster, gic_set_affinity() updates the routing (GIC_SH_MAP_VP) and trigger type in the destination cluster, but never touched the interrupt's mask state. The interrupt mask is per-cluster. After such a move the interrupt may be left disabled in the destination cluster, so it never fires despite being correctly routed to its new VP. Move the mask state along with the interrupt: disable it in the old cluster while clearing the route so it is no longer delivered, then configure the trigger type in the new cluster and re-enable it there if it was enabled in the old cluster. Fixes: 322a90638768 ("irqchip/mips-gic: Multi-cluster support") Signed-off-by: Benoît Monin <benoit.monin@bootlin.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Link: https://patch.msgid.link/20260929-sync-gic-counters-v4-3-ec70c4b60434@bootlin.com
2026-10-15irqchip/mips-gic: Fix recursive acquisition of gic_lock in gic_set_affinity()Benoît Monin
Commit 322a90638768 ("irqchip/mips-gic: Multi-cluster support") made gic_set_affinity() call gic_set_type() when an interrupt's affinity is moved between clusters. gic_set_type() takes gic_lock with raw_spin_lock_irqsave(), but gic_set_affinity() holds gic_lock at that point, so the same raw spinlock is acquired twice, triggering a deadlock. Split gic_set_type() into a gic_set_type_locked() helper that assumes gic_lock is already held. gic_set_type() takes gic_lock and calls the helper, and gic_set_affinity() calls gic_set_type_locked() directly, since it already holds gic_lock. Fixes: 322a90638768 ("irqchip/mips-gic: Multi-cluster support") Signed-off-by: Benoît Monin <benoit.monin@bootlin.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Link: https://patch.msgid.link/20260929-sync-gic-counters-v4-2-ec70c4b60434@bootlin.com
2026-10-15irqchip/mips-gic: Fix unbalanced cm_core_lock in for_each_online_cpu_gic()Benoît Monin
Commit d9e2ed610a60 ("irqchip/mips-gic: Support multi-cluster in for_each_online_cpu_gic()") added a gic_unlock_cluster() call to the macro's loop increment, which unconditionally invokes mips_cm_unlock_other() on multi-cluster systems. However nothing in the loop ever acquires the corresponding mips_cm_lock_other(), so on multi-cluster hardware every invocation of for_each_online_cpu_gic() releases an unheld per-CPU cm_core_lock. With CONFIG_PROVE_LOCKING this triggers a "bad unlock balance detected" warning at boot, e.g. from gic_irq_domain_map() while mapping local interrupts. Only the first occurrence is reported, since the first warning permanently disables lockdep (debug_locks = 0); the unbalanced release itself silently persists. Fix this by moving both the acquire and release into __gic_with_next_online_cpu() so they stay balanced. When advancing to a CPU in a remote cluster, lock the CM redirect block for that cluster via mips_cm_lock_other(); when leaving a remote cluster (or finishing the iteration) release it with mips_cm_unlock_other(). Local-cluster CPUs require no locking, so single-cluster systems are unaffected. This also makes the redirect region behave correctly when accessing local register blocks of CPUs in other clusters. Drop the now-unused gic_unlock_cluster() helper and its call from the for_each_online_cpu_gic() increment. Fixes: d9e2ed610a60 ("irqchip/mips-gic: Support multi-cluster in for_each_online_cpu_gic()") Signed-off-by: Benoît Monin <benoit.monin@bootlin.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Link: https://patch.msgid.link/20260929-sync-gic-counters-v4-1-ec70c4b60434@bootlin.com
2026-10-15irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driverAnirudha Sarangi
The Xilinx Versal NET SoC implements a Control and Status Register (CSR) block in front of the ARM SMMUv3 to manage EVENTQ, PRIQ and GLOBAL interrupts. Interrupts are enabled, cleared, and acknowledged through this block by writing to the relevant registers. Once an interrupt is acknowledged, it is forwarded to the parent interrupt controller for further processing. Add an irqchip driver for the CSR block. The driver registers as an interrupt controller and chains to the upstream SMMUv3 driver, so that the standard SMMUv3 driver does not require modification while still supporting Xilinx SoCs. The CSR block can also gate the SMMUv3 CMDQ_SYNC completion interrupt (bit 1), but it is intentionally left unsupported. The Linux arm-smmu-v3 driver signals CMDQ_SYNC completion via polling or MSI and never requests a wired CMD_SYNC interrupt, so there is no in-kernel consumer for it. Exposing it as a child line would only risk spurious, never-acked interrupts, and it is omitted from the DT binding for the same reason. This driver is intended to operate in conjunction with the ARM SMMUv3 driver and the kernel's IOMMU DMA infrastructure. These dependencies are not selected directly in Kconfig to avoid introducing dependency recursion. Co-developed-by: Tushar Nimkar <tushar.nimkar@amd.com> Signed-off-by: Anirudha Sarangi <anirudha.sarangi@amd.com> Signed-off-by: Tushar Nimkar <tushar.nimkar@amd.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260928-smmu-changes-v2-v4-2-3c79a14cd806@amd.com
2026-10-15irqchip/jcore-aic: Fix lost IPIs on SMPKarl Mehltretter
Since commit bdf4e2ac295fe ("genirq: Allow per-cpu interrupt sharing for non-overlapping affinities"), handle_percpu_devid_irq() only runs an action whose affinity mask contains the current CPU. Only actions set up through the percpu_devid request functions have such a mask. handle_jcore_irq() passes every per-CPU interrupt to handle_percpu_devid_irq(). The J2 IPI is not a percpu_devid interrupt. j2_prepare_cpus() requests it with request_irq() and IRQF_PERCPU, so its action has no affinity mask and cpumask_test_cpu() reads through a NULL pointer. J2 has no MMU to catch this. The read returns whatever is at address 0, the action is not found, and IPIs are dropped as spurious ("Spurious percpu IRQ20 on CPU1", printed once). Pass only percpu_devid interrupts (the PIT) to handle_percpu_devid_irq() and the other per-CPU interrupts to handle_percpu_irq() again, as before commit d7e3fd658248f ("irqchip/jcore-aic, clocksource/drivers/jcore: Fix jcore-pit interrupt request"). Found with a two-CPU J2 model simulated from the J-Core RTL. Without this change the boot stalls with both CPUs idle shortly after "smp: Brought up 1 node, 2 CPUs". With it, the boot reaches userspace. Fixes: bdf4e2ac295fe ("genirq: Allow per-cpu interrupt sharing for non-overlapping affinities") Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Assisted-by: LLM Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260928035408.25871-1-kmehltretter@gmail.com
2026-10-15irqchip/atmel-aic[5]: Disable interrupts in the irq_pm_shutdown() callbacksKarl Mehltretter
irq_gc_shutdown() calls the irq_pm_shutdown() callbacks from syscore_shutdown() with interrupts enabled. aic_pm_shutdown() and aic5_pm_shutdown() take the generic chip lock with raw_spin_lock(), and irq_gc_eoi() takes the same lock from the interrupt handler. An interrupt from the chip while the lock is held spins in irq_gc_eoi() and hangs the reboot. Lockdep reports this on every reboot of a SAM9X75 Curiosity board: WARNING: inconsistent lock state inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. busybox/101 [HC0[0]:SC0[0]:HE1:SE1] takes: c1c2b434 (&gc->lock){?.-.}-{2:2}, at: aic5_pm_shutdown+0x34/0xd8 {IN-HARDIRQ-W} state was registered at: ... irq_gc_eoi+0x28/0x60 handle_fasteoi_irq+0x120/0x214 ... aic5_pm_shutdown from irq_gc_shutdown+0x4c/0x58 irq_gc_shutdown from syscore_shutdown+0x5c/0x9c syscore_shutdown from kernel_restart+0x34/0x78 kernel_restart from sys_reboot+0x180/0x25c Use the irqsave guard, as commit 33517881ede7 ("irqchip/brcmstb-l2: Use _irqsave locking variants in non-interrupt code") did for brcmstb-l2. Fixes: b1479ebb7720 ("irqchip: atmel-aic: Add atmel AIC/AIC5 drivers") Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Assisted-by: LLM Reviewed-by: Radu Rendec <radu@rendec.net> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260926004124.88221-1-kmehltretter@gmail.com
2026-10-15irqchip/gic: Fix UBSAN shift-out-of-bounds in GIC helpersZhu Ling
When running with UBSAN enabled, enabling a GPIO controller that uses a GIC interrupt as its parent triggers several shift-out-of-bounds warnings: shift-out-of-bounds in drivers/irqchip/irq-gic-common.c:50:21 left shift of 2 by 30 places cannot be represented in type 'int' Similar reports are emitted from gic_poke_irq() and gic_peek_irq() in drivers/irqchip/irq-gic-v3.c. The corresponding GICv2 helpers use the same signed-shift pattern. These masks are generated by shifting signed integer constants, which invokes undefined behavior when bit 31 is selected. Use BIT() to generate the masks with an unsigned type and make their intent explicit. Fixes: f27ecacc54cc ("[ARM] Add support for ARM GIC") Fixes: 5c0c1f08abf0 ("ARM: 6150/1: gic: implement set_type") Fixes: 021f653791ad ("irqchip: gic-v3: Initial support for GICv3") Signed-off-by: Zhu Ling <zhuling2709@phytium.com.cn> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev> Reviewed-by: Radu Rendec <radu@rendec.net> Acked-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/2fJDwUUYdEf2_eaRa041L9xkT8RkSWFeo7euOnqMbbPhUatLlEaAvGfB6sOspDmXaxO87Eh7bQLV9UolyjbMtZBT1wB2UGypjPOo0Z-RC0Q=@proton.me Link: https://patch.msgid.link/20260929031050.16988-1-zhuling2709@phytium.com.cn
2026-10-15irqchip/gic-v3: Don't register a redistributor that was never countedFuad Tabba
gic_acpi_match_gicc() counts only the enabled GICCs with a non-zero gicr_base_address, and that count sizes redist_regs[], but gic_acpi_parse_madt_gicc() registers every enabled one. On a MADT with no GICR entries, an enabled GICC with a zero GICR base therefore makes gic_acpi_register_redist() write a struct redist_region past the end of the array. Commit fa2dabe57220e ("irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc()") removed the check that kept the two consistent. Its message says such entries are still caught by gic_populate_rdist(), but that runs from gic_cpu_init(), after the write. Skip the entry instead, and mark the CPU's redistributor broken as the online-capable path does, so that gic_check_rdist() rejects the CPU. gic_starting_cpu() runs past cpuhp's last failure point, so without the mark the CPU would come online with its redistributor and CPU interface unconfigured. With an ITS, its_cpu_init() would then dereference a NULL rd_base. Fixes: fa2dabe57220e ("irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc()") Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Link: https://patch.msgid.link/20260925085000.753400-4-fuad.tabba@linux.dev
2026-10-15irqchip/gic-v3-its: Don't free the tables of an enabled ITSFuad Tabba
its_probe_one() enables the ITS before its_init_domain(), the last step that can fail, and the unwind from there frees the tables and the command queue without disabling it. The kernel comes up with an enabled ITS pointing at freed pages. Enable the ITS last. Nothing reaches the new domain before then: this runs from init_IRQ(), and the ITS joins its_nodes only after the enable. Fixes: 4c21f3c26ecc2 ("irqchip: GICv3: ITS: DT probing and initialization") Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Link: https://patch.msgid.link/20260925085000.753400-3-fuad.tabba@linux.dev
2026-10-15irqchip/gic-v3-its: Don't free a vPE table shared with another ITSFuad Tabba
On GICv4.1, its_alloc_tables() copies a sibling's vPE table baser rather than allocating one, but its_free_tables() frees it like the rest. A probe failure on the copying ITS then frees pages the enabled sibling still points GITS_BASER2 at, and the kernel comes up running on that sibling. Mark a shared table so its_free_tables() skips it. Fixes: 5e5168461c22c ("irqchip/gic-v4.1: VPE table (aka GICR_VPROPBASER) allocation") Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Link: https://patch.msgid.link/20260925085000.753400-2-fuad.tabba@linux.dev
2026-10-15irqchip/riscv-imsic: Reject overlapping group index fieldsPengpeng Hou
The IMSIC address layout places the group index above the page offset, guest index and HART index. imsic_parse_fwnode() checks the individual field widths and the upper end of the group field, but does not check that its lower end is above the other fields. Reject a nonzero group field whose shift overlaps the lower fields. Otherwise a firmware-supplied layout can assign the same address bit to different indices when MSI target addresses are constructed. Keep the existing upper-bound check unchanged. The new lower-bound check applies only when group index bits are present. The issue was found by our static-analysis tool. Fixes: 21a8f8a0eb35 ("irqchip: Add RISC-V incoming MSI controller early driver") Signed-off-by: Pengpeng Hou <hppiscas@163.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Assisted-by: gpt 5 Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://patch.msgid.link/caplitmus-rv.v2.imsic.f2c0e5bdc627451c83deb0cf7eb8834a@163.com
2026-10-15irqchip/sifive-plic: Avoid signed shift in interrupt enable maskPengpeng Hou
__plic_toggle() builds a 32-bit interrupt enable mask using a signed integer literal. A valid interrupt selecting bit 31 evaluates 1 << 31, which shifts a signed int into its sign bit. Use BIT(), matching the equivalent mask construction in plic_irq_eoi(). The resulting mask remains representable in u32 on both RV32 and RV64. The issue was found by our static-analysis tool. Fixes: 8237f8bc4f6e ("irqchip: add a SiFive PLIC driver") Signed-off-by: Pengpeng Hou <hppiscas@163.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Assisted-by: gpt 5 Link: https://patch.msgid.link/caplitmus-rv.v2.plic.87a8fc444de44e109889ba28703c76f3@163.com
2026-10-15irqchip/mst-intc: Validate the DT interrupt rangePengpeng Hou
The driver takes an inclusive interrupt range from the device tree without checking its endpoints. A reversed range wraps the unsigned count calculation, and a range larger than MST_INTC_MAX_IRQS exceeds the controller capacity used by the driver. Reject these ranges before calculating nr_irqs or creating the domain. Check the difference after ordering the endpoints so the validation itself cannot wrap. The issue was found by our static-analysis tool. Fixes: ad4c938c92af ("irqchip/irq-mst: Add MStar interrupt controller support") Signed-off-by: Pengpeng Hou <hppiscas@163.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Assisted-by: gpt 5 Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20260920034236.16229-1-hppiscas@163.com
2026-10-15irqchip: st: Convert to DEFINE_SIMPLE_DEV_PM_OPS()Triet Hoang
Convert the deprecated SIMPLE_DEV_PM_OPS to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr(). This allows dropping the __maybe_unused annotations from the PM callbacks, also reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled. Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20260917013835.223139-1-triet.hoang.dev@gmail.com
2026-10-15irqchip/mchp-eic: Fix clock reference leak in mchp_eic_probe()Wentao Liang
of_clk_get_by_name() returns the clock with an elevated reference count that mchp_eic_probe() keeps for the lifetime of the driver, but none of the probe error paths drops it, so the reference is leaked whenever probe fails after the clock has been obtained. Put the reference in the error cleanup. The clk_prepare_enable() failure path must jump there directly as it cannot call clk_disable_unprepare() on a clock that was never enabled. Fixes: 00fa3461c86d ("irqchip/mchp-eic: Add support for the Microchip EIC") Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260916190349.2094401-1-vulab@iscas.ac.cn
2026-10-15irqchip/qcom-pdc: Fix linking against QCOM_SCM firmwareArnd Bergmann
Build testing with SCM disabled or in a loadable module fails with a link error: s390-linux-ld: drivers/irqchip/qcom-pdc.o: in function `qcom_pdc_probe': qcom-pdc.c:(.text+0x18b8): undefined reference to `qcom_scm_is_available' qcom-pdc.c:(.text+0x18ce): undefined reference to `qcom_scm_io_writel' As QCOM_SCM can already be enabled for compile testing on non-qualcomm machines, but is always enabled on Qualcomm Arm kernels, use that as the Kconfig dependency and remove the ||COMPILE_TEST check. Fixes: 1b852de05f74 ("irqchip/qcom: Enable compile testing for QCOM_PDC and QCOM_MPM") Fixes: ad01c2b2f291 ("irqchip/qcom-pdc: Configure PDC to pass through mode") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260915195948.3521662-1-arnd@kernel.org
2026-10-15irqchip/imx-intmux: Fix runtime PM teardown on removeGuangshuo Li
imx_intmux_probe() enables the IPG clock and then drops its runtime PM reference with pm_runtime_put(). With CONFIG_PM enabled, the runtime suspend callback disables the IPG clock. With CONFIG_PM disabled, the clock remains enabled after probe. imx_intmux_remove() accesses the CHANIER registers without first making sure that the device is runtime active. The device may therefore be runtime suspended with the IPG clock disabled when these registers are accessed. In addition, the remove path only calls pm_runtime_disable() and does not balance the clock enable when CONFIG_PM is disabled. Resume the device and acquire a runtime PM reference before accessing the registers. If resume fails, skip the register accesses but still tear down the chained handlers and IRQ domains. Disable runtime PM afterwards, drop the acquired reference without triggering another runtime suspend, and explicitly disable the IPG clock. This keeps the clock enabled while the hardware registers are accessed and balances the clk_prepare_enable() performed during probe for both CONFIG_PM configurations. This issue was found by manual code inspection. Fixes: bb403111e017 ("irqchip/imx-intmux: Implement intmux runtime power management") Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Radu Rendec <radu@rendec.net> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260914134211.1734163-1-lgs201920130244@gmail.com
2026-10-15irqchip/sifive-plic: Panic if initialization failsNam Cao
If PLIC initialization fails, the driver unwinds and returns an error. However, that is futile because the system cannot function without the PLIC: all device interrupts are routed through it. Instead of the unnecessary cleanups, panic when PLIC initialization fails. Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20260911145037.427896-1-namcao@linutronix.de
2026-10-15irqchip/gic-v3-its: Clear vpt_page after freeing the pending tableFuad Tabba
its_vpe_teardown() frees vpt_page without clearing it, so its vpt_page == NULL guard only holds the first time it runs on a vPE. struct its_vpe outlives a failed KVM_DEV_ARM_VGIC_CTRL_INIT, so a retry that fails again frees the pending table and the vPE ID a second time. Fixes: 325ff3e78c64c ("irqchip/gic-v3-its: Prevent leak in its_vpe_irq_domain_alloc()") Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev> Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20260908142632.2795308-4-fuad.tabba@linux.dev
2026-10-15irqchip/gic-v3-its: Don't clamp nvecs to zero when id_bits is 32Fuad Tabba
GITS_TYPER_IDBITS is five bits, so id_bits reaches 32 and min_t(unsigned int, ...) truncates BIT(32) to 0. nvecs becomes 0, its_lpi_alloc() rejects that, and its_msi_prepare() returns -ENOMEM. On 32-bit ARM the shift is undefined instead. The clamp is correct for every value below the maximum, so only that one value is affected. Fixes: ce9e40a9a5e5c ("irqchip/gic-v3-its: Limit number of per-device MSIs to the range the ITS supports") Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev> Reviewed-by: Radu Rendec <radu@rendec.net> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260908142632.2795308-3-fuad.tabba@linux.dev
2026-10-15irqchip/gic-v3: Release the partition node in gic_irq_get_fwspec_info()Fuad Tabba
gic_irq_get_fwspec_info() never puts the node it takes from of_find_node_by_phandle(), so every lookup from a four-cell PPI or EPPI specifier naming a partition leaks one. The node is only used for the comparison against gic_data.parts[], and the mask returned points into gic_data, so it can go out of scope with the lookup. Fixes: 68905ea65ceff ("irqchip/gic-v3: Add FW info retrieval support") Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev> Reviewed-by: Radu Rendec <radu@rendec.net> Link: https://patch.msgid.link/20260908142632.2795308-2-fuad.tabba@linux.dev
2026-10-02irqchip/aclint-sswi: Add support for SpacemiT K3Junhui Liu
Add a match entry for the spacemit,k3-aclint-sswi compatible. The K3 SSWI device requires no special handling and can use the existing generic ACLINT SSWI initialization function. Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech> Reviewed-by: Yixun Lan <dlan@kernel.org> Link: https://patch.msgid.link/20260918-k3-aclint-v3-5-cf4fd4050e14@pigmoral.tech Signed-off-by: Yixun Lan <dlan@kernel.org>
2026-09-14KVM: arm64: gic-v5: Create and manage VM and VPE tablesSascha Bischoff
GICv5 uses a set of in-memory tables to track and manage VM state. These must be allocated by the hypervisor and provided to the IRS. The VMT (Virtual Machine Table) is a linear or two-level table comprising VMT Entries (VMTEs). Each VMTE describes the state for a single VM. This state includes things such as the SPI and LPI IST configuration (coming in a future commit), an implementation-defined VM Descriptor, and a VPE Table (VPET). The VPET contains one entry per possible VPE ID belonging to a VM. It is used to mark a VPE as valid and provide the address of an implementation-defined VPE Descriptor (VPED), which the hardware uses to track and manage VPE state. Allocate each VM's VPEDs as a single dense array indexed by vcpu_idx, while the VPET remains indexed by the userspace-provided vcpu_id. This keeps VPED storage proportional to the number of vCPUs even when their IDs are sparse. The VMT and VPET are shared with the IRS. On systems with a non-coherent IRS, cache maintenance operates at cache-line granularity, while multiple entries can occupy the same cache line. Use a common lock for CPU accesses to these tables and IRS command processing so that writing back one entry cannot overwrite an IRS update to a neighbouring entry. The implementation-defined VMD and VPED storage is also visible to the IRS. Round these allocations up to whole cache lines to prevent cache maintenance from corrupting unrelated slab objects. Initialise the storage before publishing its addresses to the IRS. This commit adds support for allocating the VMT and its descriptor backing state, and for managing VMTEs. The VMTEs can be initialised or released for reuse. VM IDs are allocated with an IDA, while an XArray tracks the host-side allocations associated with populated VMTEs. Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com> Link: https://patch.msgid.link/20260904113404.4051341-10-sascha.bischoff@arm.com Signed-off-by: Marc Zyngier <maz@kernel.org>
2026-09-14irqchip/gic-v5: Set up gic_kvm_info on ACPI hostsSascha Bischoff
Device-tree based GICv5 probing already passes the IRS details and maintenance interrupt to KVM, but the ACPI path only initialises the irqchip and installs the ACPI IRQ model. As a result, KVM never sees the GICv5 host information required to probe the vGIC on ACPI systems. Add the ACPI equivalent of the DT KVM setup. Parse the MADT GICC entries for the maintenance interrupt, retaining the value from the first relevant entry and warning if later entries disagree. Warn if firmware describes the interrupt as edge-triggered, but register it as a level-sensitive, active-high GSI. Pass the resulting IRQ together with the IRS base and coherency information to KVM. Native GICv5 does not require a maintenance interrupt unless the legacy GICv3-compatible CPU interface is present, so preserve the existing no-maintenance-IRQ handling for that case. Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com> Link: https://patch.msgid.link/20260904113404.4051341-4-sascha.bischoff@arm.com Signed-off-by: Marc Zyngier <maz@kernel.org>
2026-09-14irqchip/gic-v5: Provide OF IRS config frame attrs to KVMSascha Bischoff
KVM needs to interact with the host IRS in order to, for example, make VMs or VPEs valid. There are two potential approaches here. Either the host irqchip driver can provide an interface, or KVM can interact directly with the host IRS. The latter of these two is chosen as the set of MMIO registers that KVM needs to interact with is orthogonal to the set used by the host irqchip driver (with the exception of some of the read-only IRS_IDRx registers). Pass KVM a pointer to an IRS config frame - the config frame belonging to ANY IRS is fine as long as one IRS's config frame is used consistently - in struct gic_kvm_info. Additionally, include a flag telling KVM whether the IRS is coherent or non-coherent in order to make sure that KVM can do the correct cache state management, if required. Only OF (Device Tree) is supported with this change. ACPI is not. Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com> Link: https://patch.msgid.link/20260904113404.4051341-3-sascha.bischoff@arm.com Signed-off-by: Marc Zyngier <maz@kernel.org>
2026-09-14irqchip/gic-v5: Allow KVM setup without a maintenance IRQSascha Bischoff
GICv5 does not require a virtual CPU interface maintenance interrupt for native GCIE operation. The interrupt is only needed when FEAT_GCIE_LEGACY is present, as the legacy GICv3 interface still relies on maintenance IRQ delivery. Stop rejecting KVM setup solely because the maintenance interrupt is absent. Parse the interrupt if present, but if none is described and the system does not advertise FEAT_GCIE_LEGACY, tell KVM that no maintenance interrupt is required. This lets native GICv5 KVM support be registered on systems that do not provide a maintenance interrupt, while requiring a maintenance interrupt for GICv3-capable systems. Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com> Link: https://patch.msgid.link/20260904113404.4051341-2-sascha.bischoff@arm.com Signed-off-by: Marc Zyngier <maz@kernel.org>
2026-09-07irqchip/gic-v3: Add Altera SoCFPGA Agilex5 GIC600 DMA32 erratum workaroundAdrian Ng Ho Yin
Agilex5 integrates GIC600 with an ACE-lite interface limited to a 32-bit address bus, so the ITS can only access the first 4 GB of physical address space. Register intel,socfpga-agilex5 on the existing dma_32bit_impaired_platforms list so ITS allocations use GFP_DMA32. The workaround is guarded by ALTERA_ERRATUM_AGILEX5_2_1_23, which is selected by ARCH_INTEL_SOCFPGA as all Agilex5 devices are affected. This limitation is documented as Agilex 5 ES Device Errata 2.1.23 (825514). Signed-off-by: Adrian Ng Ho Yin <adrian.ho.yin.ng@altera.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Marc Zyngier <maz@kernel.org> Link: https://docs.altera.com/r/docs/825514/current/agilex-5-es-device-errata-and-user-guidelines/hps-gicv3-its-and-lpi-unable-to-access-physical-memory-larger-than-32-bits-causing-msi-x-interrupt-failure Link: https://lore.kernel.org/linux-arm-kernel/372f059069a5551ea1096015f855cc306dbd7cd4.1747368554.git.adrianhoyin.ng@altera.com/ # v1 Link: https://lore.kernel.org/linux-arm-kernel/6a44509ca0edaabc17e59d2e27fef1c782183456.1751618484.git.adrianhoyin.ng@altera.com/ # v2 Link: https://lore.kernel.org/linux-arm-kernel/20260622024945.21354-1-muhammad.nazim.amirul.nazle.asmade@altera.com/ # v3 (untagged) Link: https://lore.kernel.org/all/20260904091114.2259616-1-adrian.ho.yin.ng@altera.com/ #v4 Link: https://patch.msgid.link/fc927e43892b86200e157fa303b0d1dd344caffd.1788751033.git.adrian.ho.yin.ng@altera.com