summaryrefslogtreecommitdiff
path: root/arch
AgeCommit message (Collapse)Author
2026-06-02powerpc/code-patching: Avoid r/w mapping of the zero pageArd Biesheuvel
The only remaining use of map_patch_area() is mapping the zero page, and immediately unmapping it again so that the intermediate page table levels are all guaranteed to be populated. The use of the zero page here is completely arbitrary, and not harmful per se, but currently, it creates a writable mapping, and does so in a manner that requires that the empty_zero_page[] symbol is not const-qualified. Given that this is about to change, and that map_patch_area() now never maps anything other than the zero page, let's simplify the code and - remove the helpers and call [un]map_kernel_page() directly - take the PA of empty_zero_page directly - create a read-only temporary mapping. This allows empty_zero_page[] to be repainted as const u8[] in a subsequent patch, without making substantial changes to this code patching logic. Cc: Madhavan Srinivasan <maddy@linux.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Christophe Leroy (CS GROUP) <chleroy@kernel.org> Link: https://lore.kernel.org/all/20260520085423.485402-1-ardb@kernel.org/ Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
2026-06-02arm64: mm: Don't abuse memblock NOMAP to check for overlapsArd Biesheuvel
Now that the linear region mapping routines respect existing table mappings and contiguous block and page mappings, it is no longer needed to fiddle with the memblock tables to set and clear the NOMAP attribute in order to omit text and rodata when creating the linear map. Instead, map the kernel text and rodata alias first with the desired initial attributes and granularity, so that the loop iterating over the memblocks will not remap it in a manner that prevents it from being remapped with updated attributes later. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
2026-06-02arm64: Move fixmap and kasan page tables to end of kernel imageArd Biesheuvel
Move the fixmap and kasan page tables out of the BSS section, and place them at the end of the image, right before the init_pg_dir section where some of the other statically allocated page tables live. These page tables are currently the only data objects in vmlinux that are meant to be accessed via the kernel image's linear alias, and so placing them together allows the remainder of the data/bss section to be remapped read-only or unmapped entirely. Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
2026-06-02arm64: mm: Permit contiguous attribute for preliminary mappingsArd Biesheuvel
There are a few cases where we omit the contiguous hint for mappings that start out as read-write and are remapped read-only later, on the basis that manipulating live descriptors with the PTE_CONT attribute set is unsafe. When support for the contiguous hint was added to the code, the ARM ARM was ambiguous about this, and so we erred on the side of caution. In the meantime, this has been clarified [0], and regions that will be remapped in their entirety, retaining the contiguous bit on all entries, can use the contiguous hint both in the initial mapping as well as the one that replaces it. Note that this requires that the logic that may be called to remap overlapping regions respects existing valid descriptors that have the contiguous bit cleared. So omit the NO_CONT_MAPPINGS flag in places where it is unneeded. [0] RJQQTC For a TLB lookup in a contiguous region mapped by translation table entries that have consistent values for the Contiguous bit, but have the OA, attributes, or permissions misprogrammed, that TLB lookup is permitted to produce an OA, access permissions, and memory attributes that are consistent with any one of the programmed translation table values. Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
2026-06-02arm64: kfence: Avoid NOMAP tricks when mapping the early poolArd Biesheuvel
Now that the map_mem() routines respect existing page mappings and contiguous granule sized blocks with the contiguous bit cleared, there is no longer a reason to play tricks with the memblock NOMAP attribute. Instead, the kfence pool can be allocated and mapped with page granularity first, and this granularity will be respected when the rest of DRAM is mapped later, even if block and contiguous mappings are allowed for the remainder of those mappings. Add the NO_EXEC_MAPPINGS flag to ensure that hierarchical XN attributes are set on the intermediate page tables that are allocated when mapping the pool. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
2026-06-02arm64: mm: Permit contiguous descriptors to be manipulatedArd Biesheuvel
Currently, pgattr_change_is_safe() is overly pedantic when it comes to descriptors with the contiguous hint attribute set, as it rejects assignments even if the old and the new value are the same. In fact, as per ARM ARM RJQQTC, manipulating descriptors with the contiguous bit set is safe as long as the bit itself does not change value, in the sense that no TLB conflict aborts or other exceptions may be raised as a result. Inconsistent permission attributes within the contiguous region may result in any of the alternatives to be taken to apply to the entire region, which might be a programming error, but it does not constitute an unsafe manipulation in terms of what pgattr_change_is_safe() is intended to detect. So drop the special PTE_CONT check, but still omit PTE_CONT from 'mask' so that modifying the bit is still regarded as unsafe. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
2026-06-02arm64: mm: Preserve non-contiguous descriptors when mapping DRAMArd Biesheuvel
Instead of blindly overwriting existing live entries regardless of the value of their contiguous bit when mapping DRAM regions at contiguous-hint granularity, check whether the contiguous region in question contains any valid descriptors that have the contiguous bit cleared, and in that case, leave the contiguous bit unset on the entire region. This permits the logic of mapping the kernel's linear alias to be simplified in a subsequent patch. Note that this can only result in a misprogrammed contiguous bit (as per ARM ARM RNGLXZ) if the region in question already contains a mix of valid contiguous and valid non-contiguous descriptors, in which case it was already misprogrammed to begin with. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
2026-06-02arm64: mm: Preserve existing table mappings when mapping DRAMArd Biesheuvel
Instead of blindly overwriting an existing table entry when mapping DRAM regions, take care not to replace a pre-existing table entry with a block entry. This permits the logic of mapping the kernel's linear alias to be simplified in a subsequent patch. Reviewed-by: Ryan Roberts <ryan.roberts@arm.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
2026-06-02arm64: mm: Check for pud_/pmd_set_huge() failures on kernel mappingsArd Biesheuvel
Sashiko reports: | If pmd_set_huge() rejects an unsafe page table transition (such as | mapping a different physical address over an existing block mapping), | it returns 0 and leaves the page table entry unmodified. | | Because *pmdp remains unmodified, READ_ONCE(pmd_val(*pmdp)) will equal | pmd_val(old_pmd). The transition from old_pmd to old_pmd is evaluated | as safe by pgattr_change_is_safe(), so the BUG_ON never triggers. | | This allows invalid and unsafe mapping updates to be silently dropped | instead of panicking, leaving stale memory mappings active while the | caller assumes the update was successful. The same applies to pud_set_huge() in alloc_init_pud(). Given how it is generally preferred to limp on rather than blow up the system if an unexpected condition such as this one occurs, and the fact that there are no known cases where this disparity results in real problems, let's WARN on these failures rather than BUG, allowing the system to survive to the point where it can actually report them. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
2026-06-02arm64: mm: Drop redundant pgd_t* argument from map_mem()Ard Biesheuvel
__map_memblock() and map_mem() always operate on swapper_pg_dir, so there is no need to pass around a pgd_t pointer between them. Reviewed-by: Ryan Roberts <ryan.roberts@arm.com> Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
2026-06-02arm64: mm: Remove bogus stop condition from map_mem() loopArd Biesheuvel
The memblock API guarantees that start is not greater than or equal to end, so there is no need to test it. And if it were, it is doubtful that breaking out of the loop would be a reasonable course of action here (rather than attempting to map the remaining regions) So let's drop this check. Reviewed-by: Ryan Roberts <ryan.roberts@arm.com> Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Will Deacon <will@kernel.org>
2026-06-02KVM: s390: Lock pte when making page secureClaudio Imbrenda
Make sure _kvm_s390_pv_make_secure() takes the pte lock for the given address when attempting to make the page secure. One of the steps in making the page secure is freezing the folio using folio_ref_freeze(), which temporarily sets the reference count to 0. Any attempt to get such a folio while frozen will fail and cause a warning to be printed. Other users of folio_ref_freeze() make sure that the page is not mapped while it's being frozen, thus preventing gup functions from being able to access it. For _kvm_s390_pv_make_secure(), this is not possible, because the page needs to be mapped in order for the import to succeed. By taking the pte lock, gup functions will be blocked until the import operation is done, thus avoiding the race. In theory this does not completely solve the issue: if a page is mapped through multiple mappings, locking one pte does not protect from calling gup on it through the other mapping. In practice this does not happen and it is a decent stopgap solution until a more correct solution is available. Fixes: e38c884df921 ("KVM: s390: Switch to new gmap") Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-ID: <20260602142356.169458-8-imbrenda@linux.ibm.com>
2026-06-02KVM: s390: Fix fault-in codeClaudio Imbrenda
Fix the fault-in code so that it does not return success if a concurrent unmap event invalidated the fault-in process between the best-effort lockless check and the proper check with lock. The new behaviour is to retry, like the best-effort lockless check already did. This prevents the fault-in handler from returning success without having actually faulted in the requested page. Fixes: e907ae530133 ("KVM: s390: Add helper functions for fault handling") Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-ID: <20260602142356.169458-7-imbrenda@linux.ibm.com>
2026-06-02KVM: s390: vsie: Fix rmap handling in _do_shadow_crste()Claudio Imbrenda
Fix _do_shadow_crste() to also apply a mask on the reverse address, to prevent spurious entries from being created, like already done in gmap_protect_rmap(). Fixes: e38c884df921 ("KVM: s390: Switch to new gmap") Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-ID: <20260602142356.169458-6-imbrenda@linux.ibm.com>
2026-06-02KVM: s390: Fix guest / virtual address confusion in _essa_clear_cbrl()Claudio Imbrenda
Until now, gmap_helper_zap_one_page() was being called with the guest absolute address, but it expects a userspace virtual address. This meant that in the best case the requested pages were not being discarded, and in the worst case that the wrong pages were being discarded. Fix this by converting the guest absolute address to host virtual before passing it to gmap_helper_zap_one_page(). Fixes: e38c884df921 ("KVM: s390: Switch to new gmap") Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-ID: <20260602142356.169458-5-imbrenda@linux.ibm.com>
2026-06-02KVM: s390: Avoid potentially sleeping while atomic when zapping pagesClaudio Imbrenda
Factor out try_get_locked_pte(), which behaves similarly to get_locked_pte(), but does not attempt to allocate missing tables and performs a spin_trylock() instead of blocking. The new function is also exported, since it will be used in other patches. If intermediate entries are missing, there can be no pte swap entry to free, so it's safe to ignore them. This avoids potentially sleeping while atomic. Fixes: e38c884df921 ("KVM: s390: Switch to new gmap") Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-ID: <20260602142356.169458-4-imbrenda@linux.ibm.com>
2026-06-02KVM: s390: Fix _gmap_crstep_xchg_atomic()Claudio Imbrenda
The previous incorrect behaviour cleared the vsie_notif bit without returning false, which allowed shadow crstes to be installed without the vsie_notif bit. Return false and do not perform the operation if an unshadow event has been triggered, but still attempt to clear the vsie_notif bit from the existing crste. This will prevent the installation of shadow crstes without vsie_notif bit and will also prevent the caller from looping forever if it was not checking for the sg->invalidated flag. Fixes: b827ef02f409 ("KVM: s390: Remove non-atomic dat_crstep_xchg()") Fixes: a2c17f9270cc ("KVM: s390: New gmap code") Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-ID: <20260602142356.169458-3-imbrenda@linux.ibm.com>
2026-06-02KVM: s390: Fix _gmap_unmap_crste()Claudio Imbrenda
In _gmap_unmap_crste(), the crste to be unmapped is zapped calling gmap_crstep_xchg_atomic() exactly once, and expecting it to succeed. This is a reasonable sanity check, since kvm->mmu_lock is being held in write mode, and thus no races should be possible. An upcoming patch will change the behaviour of gmap_crstep_xchg_atomic() to return false and clear the vsie_notif bit if the operation triggers an unshadow operation. With the new behaviour, an unmap operation that triggers an unshadow would cause the VM to be killed. Prepare for the change by checking if the vsie_notif bit was set in the old crste if gmap_crstep_xchg_atomic() fails the first time, and try a second time. The second time no failures are allowed. Fixes: b827ef02f409 ("KVM: s390: Remove non-atomic dat_crstep_xchg()") Fixes: a2c17f9270cc ("KVM: s390: New gmap code") Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-ID: <20260602142356.169458-2-imbrenda@linux.ibm.com>
2026-06-02arm64: dts: rockchip: enable adc button for Radxa E25Chukun Pan
The Radxa E25 board has an ADC button. Enable it. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn> Link: https://patch.msgid.link/20260601101000.2076721-1-amadeus@jmu.edu.cn Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2026-06-02Merge tag 'v7.2-rockchip-dts64-1' of ↵Linus Walleij
https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into soc/dt New peripherals: Watchdog on RK3528, MIPI CSI-2 receiver on RK3588. Adding frl-enable-gpios to a number of boards for HDMI 2.0 support. And a bunch of fixes and new peripherals for a number of boards. * tag 'v7.2-rockchip-dts64-1' of https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: (30 commits) arm64: dts: rockchip: Add watchdog node for RK3528 arm64: dts: rockchip: add mipi csi-2 receiver nodes to rk3588 arm64: dts: rockchip: fix rk809 interrupt pin on rk3566-roc-pc arm64: dts: rockchip: Add missing pinctrl-names to rk3588s boards arm64: dts: rockchip: Add missing pinctrl-names to rk3588 boards arm64: dts: rockchip: Add missing pinctrl-names to rk3576 boards arm64: dts: rockchip: Drop unnecessary #{address,size}-cells from rk3588-jaguar arm64: dts: rockchip: Add frl-enable-gpios to rk3588s-roc-pc arm64: dts: rockchip: Add frl-enable-gpios to rk3588s-orangepi-cm5-base arm64: dts: rockchip: Add frl-enable-gpios to rk3588s-khadas-edge2 arm64: dts: rockchip: Add frl-enable-gpios to rk3588s-gameforce-ace arm64: dts: rockchip: Add frl-enable-gpios to rk3588s boards arm64: dts: rockchip: Add frl-enable-gpios to rk3588 boards arm64: dts: rockchip: Add frl-enable-gpios to rk3576-nanopi-r76s arm64: dts: rockchip: Add frl-enable-gpios to rk3576-luckfox-core3576 arm64: dts: rockchip: Add frl-enable-gpios to rk3576 boards arm64: dts: rockchip: Add AP6275P wireless support for Khadas Edge 2L arm64: dts: rockchip: Add HYM8563 RTC for Khadas Edge 2L arm64: dts: rockchip: Add #{address,size}-cells to Chromium-based /firmware arm64: dts: rockchip: Add HDMI and VOP support for Khadas Edge 2L ... Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-06-02Merge tag 'v7.2-rockchip-dts32' of ↵Linus Walleij
https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into soc/dt Cleanups for RK3288-based ChromeOS platform. * tag 'v7.2-rockchip-dts32' of https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: Add #{address,size}-cells to Chromium-based /firmware ARM: dts: rockchip: Remove invalid properies from rk3288-veyron-analog-audio Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-06-02ARM64: remove unnecessary architecture-specific <asm/device.h>Ethan Nelson-Moore
arch/arm64/include/asm/device.h is identical to include/asm-generic/device.h, and therefore the ARM64-specific version is unnecessary. Remove it. Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com> Signed-off-by: Will Deacon <will@kernel.org>
2026-06-02Merge branch 'tip/sched/urgent'Peter Zijlstra
Pick up urgent fixes. Signed-off-by: Peter Zijlstra <peterz@infradead.org>
2026-06-02Merge tag 'qcom-arm64-for-7.2' of ↵Linus Walleij
https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/dt Qualcomm Arm64 DeviceTree updates for v7.2 Introduce the Qualcomm IPQ9650 router/gateway platform and the RDP488 board. Add support for the Motorola Edge 30 and the Nothing Phone. Describe the IPA block on the Agatti platform and missing OPP-levels for the video encoder/decoder. For Eliza, describe the QUP Serial Engines, GPI DMA, SDHCI, LLCC, IMEM, QCE crypto, ADSP remoteproc and USB nodes. Enable DSI panel, DisplayPort, USB, and ADSP support on the Eliza MTP. On Glymur enable ADSP and CDSP remoteprocs, FastRPC, crypto hardware, CPUfreq cooling devices, and coresight nodes. Enable the remoteprocs and the LID sensor on the Glymur CRD. Describe the CAN-FD controller found on the Hamoa EVK. Correct the DisplayPort controller OPP tables. Describe the watchdog on IPQ5210 and IPQ9650. Describe USB controller and PHYs for the Kaanapali platform and enable basic USB support on the MTP and QRD devices. Enable the second display subsystem on Lemans and use this to enable additional DisplayPort outputs on the Lemans Ride board, and IFP mezzanine for the EVK. Also enable the GPIO expander on the Lemans EVK to get the CAN signals out. Add crypto hardware and qfprom nodes on Milos. Reduce the remotefs shared memory size to avoid sanity checks in the modem firmware rejecting the region. Enable the vibrator on FairPhone FP6. Add GPSDP FastRPC support on Monaco, and describe the Bluetooth controller on the Arduino VENTUNO Q board. Introduce an EL2 overlay for the Purwa IoT EVK. Enable CAN bus controller on QCS6490 RB3gen2 and add a remotefs node. Enable FastRPC on the SC8280XP ADSP. Correct SDM630 and SDM660 ADSP FastRPC channel ids. Also add the ADSP memory region on SDM630. On SDM845 devices, enable NFC on Google Pixel 3, OnePlus 6, OnePlus 6T, and SHIFT SHIFT6mq. Enable camera flash on LG devices. Rework the framebuffer description on Samsung, SHIFT and Xiaomi devices. Enable camera flash on LG devices. Fix Bluetooth and WiFi on LG and Xiaomi devices. Enable MDSS and the display panel on Xiaomi Mi A3. Scale L3 and DDR clock votes based on CPUfreq selection. Enable camera clock controller, cpufreq cooling devices, and correct the DSI1 reference clock on SM8750. On the Talos platform, describe the QSPI support, GPR and audio services, and enable sound on the EVK target. Enable QSPI and describe the SPINOR on this bus, on the QCS615 Ride. Describe power-domain and iface clock for the Inline Crypto Engine (ICE) across various platforms. Fix the Bluetooth RFA supply name across a variety of devices. * tag 'qcom-arm64-for-7.2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (131 commits) arm64: dts: qcom: add support for pixel 3a xl with the tianma panel arm64: dts: qcom: sdm670-google: add common device tree include arm64: dts: qcom: hamoa-iot-evk: add MCP2518FD CAN on spi18 arm64: dts: qcom: sm8750: allow mode-switch events to reach the QMP Combo PHY arm64: dts: qcom: sc8280xp: drop unused polling-delay-passive properties arm64: dts: qcom: ipq5210: add watchdog node arm64: dts: qcom: sdm845-xiaomi-beryllium: Correct IPA FW path arm64: dts: qcom: monaco-arduino-monza: Add Bluetooth UART node arm64: dts: qcom: glymur: Add qfprom efuse node arm64: dts: qcom: milos: Add qfprom efuse node arm64: dts: qcom: glymur: add coresight nodes arm64: dts: qcom: qcs6490-rb3gen2: add rmtfs node arm64: dts: qcom: lemans-evk: Enable CAN RX via I2C GPIO expander arm64: dts: qcom: glymur: Fix wrong interrupt number for i2c19 arm64: dts: qcom: Drop unused remoteproc_adsp_glink label arm64: dts: qcom: lemans: Add eDP ref clock for eDP PHYs arm64: dts: qcom: sm8750: Add power-domain and iface clk for ice node arm64: dts: qcom: sm8650: Add power-domain and iface clk for ice node arm64: dts: qcom: sm8550: Add power-domain and iface clk for ice node arm64: dts: qcom: sm8450: Add power-domain and iface clk for ice node ... Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-06-02arm64: dts: amlogic: t7: Add i2c pinctrl nodeRonald Claveau
Add the T7 pinctrl used by the Khadas VIM4 for MCU communication. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr> Link: https://patch.msgid.link/20260516-add-mcu-fan-khadas-vim4-v6-6-cccc9b61f465@aliel.fr Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: t7: khadas-vim4: add PWM-driven status LEDRonald Claveau
The VIM4 board exposes a status LED wired to the PWM_AO_C_D output. Enable the pwm_ao_cd controller with its pinmux, and declare a pwm-leds node with a heartbeat trigger. Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr> Link: https://patch.msgid.link/20260513-add-kvim4-sysled-v2-3-3ec9779e8875@aliel.fr Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: t7: khadas-vim4: reorder root nodeRonald Claveau
Move the xtal-clk node to restore alphabetical ordering. Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20260513-add-kvim4-sysled-v2-2-3ec9779e8875@aliel.fr Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: t7: Fix missing required reset propertyRonald Claveau
CHECK_DTBS shows missing reset required property in T7 DTBS. A new CHECK_DTBS with this patch does not show this anymore. Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr> Link: https://patch.msgid.link/20260331-fix-aml-t7-null-reset-v1-2-eb95b625234c@aliel.fr Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: t7: khadas-vim4: Add MMC nodesRonald Claveau
Enable and configure the three MMC controllers for the Khadas VIM4 board: - sd_emmc_a: SDIO interface for the BCM43752 Wi-Fi module - sd_emmc_b: SD card slot - sd_emmc_c: eMMC storage Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr> Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-9-d3f182b48e9d@aliel.fr Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: t7: khadas-vim4: Add SDIO power sequence and WiFi clockRonald Claveau
Add the SDIO power sequence node using mmc-pwrseq-simple and a 32.768kHz PWM-based clock required by the Wi-Fi module. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr> Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-7-d3f182b48e9d@aliel.fr Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: t7: Add PWM controller nodesRonald Claveau
Add device tree nodes for the seven PWM controllers available on the Amlogic T7 SoC, using amlogic,meson-s4-pwm as fallback compatible. All nodes are disabled by default and should be enabled in the board-specific DTS file. Co-developed-by: Nick Xie <nick@khadas.com> Signed-off-by: Nick Xie <nick@khadas.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr> Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-5-d3f182b48e9d@aliel.fr Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: t7: Add MMC controller nodesRonald Claveau
Add device tree nodes for the three MMC controllers available on the Amlogic T7 SoC, using amlogic,meson-axg-mmc as fallback compatible. All nodes are disabled by default and should be enabled in the board-specific DTS file. Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-3-d3f182b48e9d@aliel.fr Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: t7: Add clock controller nodesJian Hu
Add the required clock controller nodes for Amlogic T7 SoC family: - SCMI clock controller - PLL clock controller - Peripheral clock controller Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr> Signed-off-by: Jian Hu <jian.hu@amlogic.com> Link: https://patch.msgid.link/20260326092645.1053261-4-jian.hu@amlogic.com Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: use rc-khadas keymapNick Xie
The Khadas VIM1S board has an onboard IR receiver. Configure the default keymap to "rc-khadas" to support the official Khadas IR remote control. Signed-off-by: Nick Xie <nick@khadas.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20260327093016.722095-4-nick@khadas.com Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: enable HYM8563 RTCNick Xie
The Khadas VIM1S board has an on-board Haoyu Micro HYM8563 Real Time Clock (RTC) connected to the I2C1 bus. Enable the I2C1 controller and add the RTC child node to support hardware clock persistence. Signed-off-by: Nick Xie <nick@khadas.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20260327093016.722095-3-nick@khadas.com Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: meson-s4: add VRTC nodeNick Xie
Add the Virtual RTC (VRTC) controller node to the Meson S4 SoC dtsi. Signed-off-by: Nick Xie <nick@khadas.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20260327093016.722095-2-nick@khadas.com Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: add Function key supportNick Xie
Enable the SARADC controller and add the adc-keys node to support the Function key found on the Khadas VIM1S board. Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Nick Xie <nick@khadas.com> Link: https://patch.msgid.link/20260325070618.81955-5-nick@khadas.com Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: meson-s4: add internal SARADC controllerNick Xie
Add the SARADC (Successive Approximation Register ADC) controller node to the Meson S4 SoC dtsi. It uses the S4-specific compatible string with a fallback to the G12A generation, as there are no known hardware differences. Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Nick Xie <nick@khadas.com> Link: https://patch.msgid.link/20260325070618.81955-4-nick@khadas.com Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02arm64: dts: amlogic: t7: khadas-vim4: Add power regulatorsRonald Claveau
Add voltage regulator nodes describing the VIM4 power tree, required by peripheral nodes such as the SD card controller. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr> Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-6-d3f182b48e9d@aliel.fr [narmstrong: squashed "Remove invalid property fix" from Ronald] Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2026-06-02powerpc/pseries/lparcfg: Replace deprecated strcpy in ↵Thorsten Blum
parse_system_parameter_string strcpy() is deprecated; use strscpy() instead. Use the return value of strscpy() instead of calling strlen() again, and ignore any potential string truncation since both strings are much shorter than the buffer size SPLPAR_MAXLENGTH. Change both if conditions to silence the following checkpatch warnings: Comparisons should place the constant on the right side of the test Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20251013135703.97260-2-thorsten.blum@linux.dev
2026-06-02powerpc: Fix indentation and replace typedef with struct nameThorsten Blum
Indent several struct members using tabs instead of spaces. Replace the typedef alias AOUTHDR with an explicit struct name to silence a checkpatch warning. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20250517125834.421088-2-thorsten.blum@linux.dev
2026-06-02powerpc/rtas: Replace one-element array with flexible array memberThorsten Blum
Replace the deprecated one-element array with a modern flexible array member in the struct rtas_error_log and add the __counted_by_be() compiler attribute to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Link: https://github.com/KSPP/linux/issues/79 Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20250813103101.163698-2-thorsten.blum@linux.dev
2026-06-02powerpc: use sysfs_emit{_at} in sysfs show functionsThorsten Blum
Replace sprintf() with sysfs_emit() and sysfs_emit_at() in sysfs show functions, which are preferred for formatting sysfs output because they provide safer bounds checking. While the current code only emits strings that fit easily within PAGE_SIZE, use sysfs_emit() and sysfs_emit_at() to follow secure coding best practices. This is a mechanical cleanup with a few simple edge cases: - In domains_show(), drop the redundant n < 0 check since neither sprintf() nor sysfs_emit() return negative values. - In powercap_show() and psr_show(), also drop the dead ret < 0 checks. - In ps3_fw_version_show(), normalize the output by adding a terminating newline as suggested by checkpatch. - In vio's modalias_show(), replace the deprecated strcpy() [1] followed by strlen() with sysfs_emit(). Leave validate_show() and the variable-length hv-gpci helpers unchanged since they already have explicit bounds handling, and converting those would be more than a mechanical conversion. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260524130002.793476-2-thorsten.blum@linux.dev
2026-06-02ppc/fadump: invoke kmsg_dump in fadump panic pathShivang Upadhyay
fadump is registered in panic_notifier_list and gets triggered before kmsg_dump_desc() in the panic path. As a result, kmsg_dumpers such as pstore are not executed during fadump crashes. This is problematic because pstore provides a critical fallback mechanism for crash analysis. When fadump fails to successfully reboot the system or capture a dump, pstore logs may be the only available information from the crashed kernel. Without invoking kmsg_dump_desc() in the fadump path, we lose this valuable diagnostic data. Invoke kmsg_dump_desc() from the fadump panic handler, but only when fadump is actually registered (checked via should_fadump_crash()). This ensures kmsg_dumpers are called without duplicating the call that occurs later in panic() when fadump is not active. The call is placed before crash_fadump() to ensure logs are captured before the system attempts to trigger the firmware-assisted dump. Reported-by: Shirisha G <shirisha@linux.ibm.com> Suggested-by: Sourabh Jain <sourabhjain@linux.ibm.com> Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com> Tested-by: Shirisha G <shirisha@linux.ibm.com> Reviewed-by: Mahesh Salgaonkar <mahesh@linux.ibm.com> Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260412113057.46090-1-shivangu@linux.ibm.com
2026-06-02powerpc/xive: Add warning if target CPU not foundShrikanth Hegde
Add a warn_once to warn if the CPU target is not found. This could help to find about any such usecase. This is a very rare case, which either means mask was empty or atomic update failed for all online CPUs. So it is worth printing that path for potential fix. Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com> Reviewed-by: Yury Norov <ynorov@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260427044715.559137-5-sshegde@linux.ibm.com
2026-06-02powerpc/perf: Use cpumask_intersects api for checking disable pathShrikanth Hegde
First online CPU in the node disables the nest counters by making an OPAL call. Any other CPU in that node, will bail out. Instead of using a temporary mask to find out if any cpu in the node is visited or not, it is better to use the cpumask_intersects api to achieve the same. Similarly a temporary cpumask is used to check if a core is already part of core_imc_cpumask. Use the same cpumask_intersects api there. Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com> Reviewed-by: Yury Norov <ynorov@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260427044715.559137-4-sshegde@linux.ibm.com
2026-06-02powerpc: Simplify cpumask api usage for cpuinfo displayShrikanth Hegde
- cpumask_next can take -1 as valid argument. So simplify cpuinfo iterator. - Use cpumask_last to find if this_cpu is last online CPU. /proc/cpuinfo shows same info with patch. Reviewed-by: Yury Norov <ynorov@nvidia.com> Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com> Reviewed-by: Yury Norov <ynorov@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260427044715.559137-3-sshegde@linux.ibm.com
2026-06-02powerpc: Use cpumask_next_wrap insteadShrikanth Hegde
cpu = cpumask_next(cpu, mask) if (cpu >= nr_cpu_ids) cpu = cpumask_first(mask) Above block is identical to: cpu = cpumask_next_wrap(cpu, mask) Replace it, No change in functionality or performance. Slightly simpler code. Reviewed-by: Yury Norov <ynorov@nvidia.com> Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com> Reviewed-by: Yury Norov <ynorov@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260427044715.559137-2-sshegde@linux.ibm.com
2026-06-02powerpc/fadump: Add timeout to RTAS busy-wait loopsAdriano Vero
The ibm,configure-kernel-dump RTAS call sites in rtas_fadump_register(), rtas_fadump_unregister(), and rtas_fadump_invalidate() polled indefinitely while firmware returned a busy status. A misbehaving or hung firmware could stall these paths forever, blocking fadump registration at boot or preventing clean teardown. Introduce rtas_fadump_call(), a helper that wraps the common busy-wait pattern shared by all three sites. The helper accumulates the total delay and returns -ETIMEDOUT if firmware keeps returning a busy status beyond RTAS_FADUMP_MAX_WAIT_MS (60 seconds). A pr_debug() message is emitted on each busy iteration to aid diagnosis when the timeout is hit. Signed-off-by: Adriano Vero <adri.vero.dev@gmail.com> Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com> [Maddy: Fixed newline after Signed-off-by] Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260506222024.30352-1-adri.vero.dev@gmail.com
2026-06-02powerpc64/bpf: Add powerpc64 JIT support for timed may_gotoSaket Kumar Bhaskar
When verifier sees a timed may_goto instruction, it emits a call to arch_bpf_timed_may_goto() with a stack offset in BPF_REG_AX (powerpc64 R12) and expects the refreshed count value to be returned in the same register. The verifier doesn't save or restore any registers before emitting this call. arch_bpf_timed_may_goto() should act as a trampoline to call bpf_check_timed_may_goto() with powerpc64 ELF ABI calling convention. To support this custom calling convention, implement arch_bpf_timed_may_goto() in assembly and make sure BPF caller saved registers are preserved, then call bpf_check_timed_may_goto with the powerpc64 ABI calling convention where first argument and return value both are in R3. Finally, move the result back into BPF_REG_AX(R12) before returning. Also, introduce bpf_jit_emit_func_call() that computes the offset from kernel_toc_addr(), validates that the target and emits the ADDIS/ADDI sequence to load the function address before performing the indirect branch via MTCTR/BCTRL. The existing code in bpf_jit_emit_func_call_rel() is refactored to use this function. Acked-by: Hari Bathini <hbathini@linux.ibm.com> Signed-off-by: Saket Kumar Bhaskar <skb99@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260403105016.74775-1-skb99@linux.ibm.com