arm: dts: vexpress-v2p-ca9: Fix the SMB unit-address
Subsystems (11)
Sasha Levin
maintainerPATCH 17/17 firmware: include drivers/firmware/Kconfig unconditionally
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 951cd3a0866d29cb9c01ebc1d9c17590e598226e ]
Compile-testing drivers that require access to a firmware layer fails when that firmware symbol is unavailable. This happened twice this week:
- My proposed to change to rework the QCOM_SCM firmware symbol broke on ppc64 and others.
- The cs_dsp firmware patch added device specific firmware loader into drivers/firmware, which broke on the same set of architectures.
We should probably do the same thing for other subsystems as well, but fix this one first as this is a dependency for other patches getting merged.
--- arch/arm/Kconfig | 2 -- arch/arm64/Kconfig | 2 -- arch/ia64/Kconfig | 2 -- arch/mips/Kconfig | 2 -- arch/parisc/Kconfig | 2 -- arch/riscv/Kconfig | 2 -- arch/x86/Kconfig | 2 -- drivers/Kconfig | 2 ++ 8 files changed, 2 insertions(+), 14 deletions(-)
arch/arm/Kconfig +0 -2
@@ -1994,8 +1994,6 @@ config ARCH_HIBERNATION_POSSIBLE endmenu -source "drivers/firmware/Kconfig" - if CRYPTO source "arch/arm/crypto/Kconfig" endif
arch/arm64/Kconfig +0 -2
@@ -1935,8 +1935,6 @@ source "drivers/cpufreq/Kconfig" endmenu -source "drivers/firmware/Kconfig" - source "drivers/acpi/Kconfig" source "arch/arm64/kvm/Kconfig"
arch/ia64/Kconfig +0 -2
@@ -386,8 +386,6 @@ config CRASH_DUMP help Generate crash dump after being started by kexec. -source "drivers/firmware/Kconfig" - endmenu menu "Power management and ACPI options"
arch/mips/Kconfig +0 -2
@@ -3343,8 +3343,6 @@ source "drivers/cpuidle/Kconfig" endmenu -source "drivers/firmware/Kconfig" - source "arch/mips/kvm/Kconfig" source "arch/mips/vdso/Kconfig"
arch/parisc/Kconfig +0 -2
@@ -385,6 +385,4 @@ config KEXEC_FILE endmenu -source "drivers/firmware/Kconfig" - source "drivers/parisc/Kconfig"
arch/riscv/Kconfig +0 -2
@@ -558,5 +558,3 @@ menu "Power management options" source "kernel/power/Kconfig" endmenu - -source "drivers/firmware/Kconfig"
arch/x86/Kconfig +0 -2
@@ -2854,8 +2854,6 @@ config HAVE_ATOMIC_IOMAP def_bool y depends on X86_32 -source "drivers/firmware/Kconfig" - source "arch/x86/kvm/Kconfig" source "arch/x86/Kconfig.assembler"
drivers/Kconfig +2 -0
@@ -17,6 +17,8 @@ source "drivers/bus/Kconfig" source "drivers/connector/Kconfig" +source "drivers/firmware/Kconfig" + source "drivers/gnss/Kconfig" source "drivers/mtd/Kconfig"
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 1/17 arm: dts: vexpress-v2p-ca9: Fix the SMB unit-address
From: Rob Herring <[email protected]>
[ Upstream commit 2e9edc07df2ec6f835222151fa4e536e9e54856a ]
Based on 'ranges', the 'bus@4000000' node unit-address is off by 1 '0'.
--- arch/arm/boot/dts/vexpress-v2m.dtsi | 2 +- arch/arm/boot/dts/vexpress-v2p-ca9.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/vexpress-v2m.dtsi +1 -1
@@ -19,7 +19,7 @@ */ / { - bus@4000000 { + bus@40000000 { motherboard { model = "V2M-P1"; arm,hbi = <0x190>;
arch/arm/boot/dts/vexpress-v2p-ca9.dts +1 -1
@@ -295,7 +295,7 @@ power-vd10-s3 { }; }; - smb: bus@4000000 { + smb: bus@40000000 { compatible = "simple-bus"; #address-cells = <2>;
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 2/17 ARM: config: multi v7: Enable dependancies
From: Joel Stanley <[email protected]>
[ Upstream commit cf8dd57bd0d62133e4ed9e1ad83af994fac34da5 ]
Some drivers have not been built as they gained dependencies in kconfig but those dependencies were not added to the defconfig.
The MSM pinctrl drivers fell out of the defconfig as of commit be117ca32261 ("pinctrl: qcom: Kconfig: Rework PINCTRL_MSM to be a depenency rather then a selected config"). Add PINCTRL_MSM so these stay enabled.
EDAC depends on RAS, so enable it to ensure the EDAC drivers stay enabled.
--- arch/arm/configs/multi_v7_defconfig | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/configs/multi_v7_defconfig +2 -0
@@ -454,6 +454,7 @@ CONFIG_PINCTRL_STMFX=y CONFIG_PINCTRL_PALMAS=y CONFIG_PINCTRL_OWL=y CONFIG_PINCTRL_S500=y +CONFIG_PINCTRL_MSM=y CONFIG_PINCTRL_APQ8064=y CONFIG_PINCTRL_APQ8084=y CONFIG_PINCTRL_IPQ8064=y
@@ -1114,6 +1115,7 @@ CONFIG_PHY_DM816X_USB=m CONFIG_OMAP_USB2=y CONFIG_TI_PIPE3=y CONFIG_TWL4030_USB=m +CONFIG_RAS=y CONFIG_NVMEM_IMX_OCOTP=y CONFIG_ROCKCHIP_EFUSE=m CONFIG_NVMEM_SUNXI_SID=y
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 3/17 ARM: config: mutli v7: Reenable FB dependency
In reply to Sasha LevinFrom: Joel Stanley <[email protected]>
[ Upstream commit 8c1768967e2733d55abf449d8abd6f1915ba3539 ]
DRM_FBDEV_EMULATION previously selected FB and was default y as long as DRM was enabled. In commit f611b1e7624c ("drm: Avoid circular dependencies for CONFIG_FB") the select was replaced with a depends on FB, disabling the drivers that depended on it.
Renable FB so we get back FB_EFI, FB_WM8505, FB_SH_MOBILE_LCDC, FB_SIMPLE and VIDEO_VIVID.
It must be set to y and not a module as the test driver VIDEO_VIVID requires it to be built in.
--- arch/arm/configs/multi_v7_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/configs/multi_v7_defconfig +1 -0
@@ -721,6 +721,7 @@ CONFIG_DRM_PL111=m CONFIG_DRM_LIMA=m CONFIG_DRM_PANFROST=m CONFIG_DRM_ASPEED_GFX=m +CONFIG_FB=y CONFIG_FB_EFI=y CONFIG_FB_WM8505=y CONFIG_FB_SH_MOBILE_LCDC=y
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 4/17 ARM: dts: at91: sama5d2_som1_ek: disable ISC node by default
In reply to Sasha LevinFrom: Eugen Hristev <[email protected]>
[ Upstream commit 4348cc10da6377a86940beb20ad357933b8f91bb ]
Without a sensor node, the ISC will simply fail to probe, as the corresponding port node is missing.
It is then logical to disable the node in the devicetree.
If we add a port with a connection to a sensor endpoint, ISC can be enabled.
--- arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 1 - 1 file changed, 1 deletion(-)
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +0 -1
@@ -71,7 +71,6 @@ apb { isc: isc@f0008000 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit &pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>; - status = "okay"; }; qspi1: spi@f0024000 {
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 5/17 block: decode QUEUE_FLAG_HCTX_ACTIVE in debugfs output
In reply to Sasha LevinFrom: Johannes Thumshirn <[email protected]>
[ Upstream commit 1dbdd99b511c966be9147ad72991a2856ac76f22 ]
While debugging an issue we've found that $DEBUGFS/block/$disk/state doesn't decode QUEUE_FLAG_HCTX_ACTIVE but only displays its numerical value.
Add QUEUE_FLAG(HCTX_ACTIVE) to the blk_queue_flag_name array so it'll get decoded properly.
--- block/blk-mq-debugfs.c | 1 + 1 file changed, 1 insertion(+)
block/blk-mq-debugfs.c +1 -0
@@ -129,6 +129,7 @@ static const char *const blk_queue_flag_name[] = {QUEUE_FLAG_NAME (PCI_P2PDMA ),QUEUE_FLAG_NAME (ZONE_RESETALL ),QUEUE_FLAG_NAME (RQ_ALLOC_TIME ), +QUEUE_FLAG_NAME (HCTX_ACTIVE ), QUEUE_FLAG_NAME(NOWAIT), };#undef QUEUE_FLAG_NAME
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 6/17 xen/x86: prevent PVH type from getting clobbered
In reply to Sasha LevinFrom: Jan Beulich <[email protected]>
[ Upstream commit 9172b5c4a778da1f855b2e3780b1afabb3cfd523 ]
Like xen_start_flags, xen_domain_type gets set before .bss gets cleared. Hence this variable also needs to be prevented from getting put in .bss, which is possible because XEN_NATIVE is an enumerator evaluating to zero. Any use prior to init_hvm_pv_info() setting the variable again would lead to wrong decisions; one such case is xenboot_console_setup() when called as a result of "earlyprintk=xen".
Use __ro_after_init as more applicable than either __section(".data") or __read_mostly.
--- arch/x86/xen/enlighten.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
arch/x86/xen/enlighten.c +4 -5
@@ -52,9 +52,6 @@ DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);DEFINE_PER_CPU (uint32_t, xen_vcpu_id);EXPORT_PER_CPU_SYMBOL (xen_vcpu_id); -enum xen_domain_type xen_domain_type =XEN_NATIVE ; -EXPORT_SYMBOL_GPL (xen_domain_type); -unsigned long *machine_to_phys_mapping = (void *)MACH2PHYS_VIRT_START ;EXPORT_SYMBOL (machine_to_phys_mapping);unsigned long machine_to_phys_nr;
@@ -69,9 +66,11 @@ __read_mostly int xen_have_vector_callback;EXPORT_SYMBOL_GPL (xen_have_vector_callback);/* -* NB: needs to live in .data because it's used by xen_prepare_pvh which runs -* before clearing the bss. +* NB: These need to live in .data or alike because they're used by +* xen_prepare_pvh() which runs before clearing the bss. */ +enum xen_domain_type __ro_after_init xen_domain_type =XEN_NATIVE ; +EXPORT_SYMBOL_GPL (xen_domain_type); uint32_t xen_start_flags __section(".data") = 0;EXPORT_SYMBOL (xen_start_flags);
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 8/17 drm/amdgpu/display: fix dependencies for DRM_AMD_DC_SI
In reply to Sasha LevinFrom: Alex Deucher <[email protected]>
[ Upstream commit 4702b34d1de9582df9dfa0e583ea28fff7de29df ]
Depends on DRM_AMDGPU_SI and DRM_AMD_DC
--- drivers/gpu/drm/amd/display/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/Kconfig +2 -0
@@ -25,6 +25,8 @@ config DRM_AMD_DC_HDCP config DRM_AMD_DC_SI bool "AMD DC support for Southern Islands ASICs" + depends on DRM_AMDGPU_SI + depends on DRM_AMD_DC default n help Choose this option to enable new AMD DC support for SI asics
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 7/17 r8152: avoid to resubmit rx immediately
In reply to Sasha LevinFrom: Hayes Wang <[email protected]>
[ Upstream commit baf33d7a75642b4b38a87fdf1cd96b506df4849f ]
For the situation that the disconnect event comes very late when the device is unplugged, the driver would resubmit the RX bulk transfer after getting the callback with -EPROTO immediately and continually. Finally, soft lockup occurs.
This patch avoids to resubmit RX immediately. It uses a workqueue to schedule the RX NAPI. And the NAPI would resubmit the RX. It let the disconnect event have opportunity to stop the submission before soft lockup.
--- drivers/net/usb/r8152.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/net/usb/r8152.c +15 -1
@@ -767,6 +767,7 @@ enum rtl8152_flags {PHY_RESET ,SCHEDULE_TASKLET ,GREEN_ETHERNET , + RX_EPROTO, };#define DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2 0x3082
@@ -1770,6 +1771,14 @@ static void read_bulk_callback(struct urb *urb)rtl_set_unplug (tp);netif_device_detach (tp->netdev);return ; +case -EPROTO : + urb->actual_length =0 ; +spin_lock_irqsave (&tp->rx_lock, flags); +list_add_tail (&agg->list, &tp->rx_done); +spin_unlock_irqrestore (&tp->rx_lock, flags); +set_bit (RX_EPROTO , &tp->flags); +schedule_delayed_work (&tp->schedule,1 ); +return ;case -ENOENT :return ;/* the urb is in unlink state */ case -ETIME :
@@ -2425,6 +2434,7 @@ static int rx_bottom(struct r8152 *tp, int budget)if (list_empty (&tp->rx_done)) goto out1; +clear_bit (RX_EPROTO , &tp->flags);INIT_LIST_HEAD (&rx_queue);spin_lock_irqsave (&tp->rx_lock, flags);list_splice_init (&tp->rx_done, &rx_queue);
@@ -2441,7 +2451,7 @@ static int rx_bottom(struct r8152 *tp, int budget) agg = list_entry(cursor, struct rx_agg, list); urb = agg->urb; -if (urb->actual_length <ETH_ZLEN ) +if (urb->status !=0 || urb->actual_length <ETH_ZLEN ) goto submit; agg_free =rtl_get_free_rx (tp,GFP_ATOMIC );
@@ -6643,6 +6653,10 @@ static void rtl_work_func_t(struct work_struct *work) netif_carrier_ok(tp->netdev))tasklet_schedule (&tp->tx_tl); +if (test_and_clear_bit (RX_EPROTO , &tp->flags) && + !list_empty (&tp->rx_done)) +napi_schedule (&tp->napi); +mutex_unlock (&tp->control); out1:
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 9/17 drm/amdgpu: init iommu after amdkfd device init
In reply to Sasha LevinFrom: Yifan Zhang <[email protected]>
[ Upstream commit 714d9e4574d54596973ee3b0624ee4a16264d700 ]
This patch is to fix clinfo failure in Raven/Picasso:
Number of platforms: 1
Platform Profile: FULL_PROFILE
Platform Version: OpenCL 2.2 AMD-APP (3364.0) Platform Name: AMD Accelerated Parallel Processing Platform Vendor: Advanced Micro Devices, Inc. Platform Extensions: cl_khr_icd cl_amd_event_callback
Platform Name: AMD Accelerated Parallel Processing Number of devices: 0
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 -4
@@ -2342,10 +2342,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)if (r) goto init_failed; - r =amdgpu_amdkfd_resume_iommu (adev); -if (r) - goto init_failed; - r =amdgpu_device_ip_hw_init_phase1 (adev);if (r) goto init_failed;
@@ -2384,6 +2380,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)if (!adev->gmc.xgmi.pending_reset)amdgpu_amdkfd_device_init (adev); + r =amdgpu_amdkfd_resume_iommu (adev); +if (r) + goto init_failed; +amdgpu_fru_get_product_info (adev); init_failed:
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 10/17 xtensa: xtfpga: use CONFIG_USE_OF instead of CONFIG_OF
In reply to Sasha LevinFrom: Max Filippov <[email protected]>
[ Upstream commit f3d7c2cdf6dc0d5402ec29c3673893b3542c5ad1 ]
Use platform data to initialize xtfpga device drivers when CONFIG_USE_OF is not selected. This fixes xtfpga networking when CONFIG_USE_OF is not selected but CONFIG_OF is.
--- arch/xtensa/platforms/xtfpga/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/xtensa/platforms/xtfpga/setup.c +2 -2
@@ -66,7 +66,7 @@ void __init platform_calibrate_ccount(void)#endif -#ifdef CONFIG_OF +#ifdef CONFIG_USE_OF static void __init xtfpga_clk_setup (struct device_node *np) {
@@ -284,4 +284,4 @@ static int __init xtavnet_init(void)*/ arch_initcall (xtavnet_init); -#endif /* CONFIG_OF */ +#endif /* CONFIG_USE_OF */
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 12/17 NFSD: Keep existing listeners on portlist error
In reply to Sasha LevinFrom: Benjamin Coddington <[email protected]>
[ Upstream commit c20106944eb679fa3ab7e686fe5f6ba30fbc51e5 ]
If nfsd has existing listening sockets without any processes, then an error returned from svc_create_xprt() for an additional transport will remove those existing listeners. We're seeing this in practice when userspace attempts to create rpcrdma transports without having the rpcrdma modules present before creating nfsd kernel processes. Fix this by checking for existing sockets before calling nfsd_destroy().
--- fs/nfsd/nfsctl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/nfsd/nfsctl.c +4 -1
@@ -793,7 +793,10 @@ static ssize_t __write_ports_addxprt(char *buf, struct net *net, const struct crsvc_xprt_put (xprt); } out_err: -nfsd_destroy (net); +if (!list_empty (&nn->nfsd_serv->sv_permsocks)) + nn->nfsd_serv->sv_nrthreads--; +else +nfsd_destroy (net);return err; }
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 11/17 xtensa: xtfpga: Try software restart before simulating CPU reset
In reply to Sasha LevinFrom: Guenter Roeck <[email protected]>
[ Upstream commit 012e974501a270d8dfd4ee2039e1fdf7579c907e ]
Rebooting xtensa images loaded with the '-kernel' option in qemu does not work. When executing a reboot command, the qemu session either hangs or experiences an endless sequence of error messages.
Kernel panic - not syncing: Unrecoverable error in exception handler
Reset code jumps to the CPU restart address, but Linux can not recover from there because code and data in the kernel init sections have been discarded and overwritten at this point.
XTFPGA platforms have a means to reset the CPU by writing 0xdead into a specific FPGA IO address. When used in QEMU the kernel image loaded with the '-kernel' option gets restored to its original state allowing the machine to boot successfully.
Use that mechanism to attempt a platform reset. If it does not work, fall back to the existing mechanism.
--- arch/xtensa/platforms/xtfpga/setup.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
arch/xtensa/platforms/xtfpga/setup.c +6 -2
@@ -51,8 +51,12 @@ void platform_power_off(void)void platform_restart (void ) { -/* Flush and reset the mmu, simulate a processor reset, and -* jump to the reset vector. */ +/* Try software reset first. */ +WRITE_ONCE (*(u32 *)XTFPGA_SWRST_VADDR ,0xdead ); + +/* If software reset did not work, flush and reset the mmu, +* simulate a processor reset, and jump to the reset vector. +*/ cpu_reset ();/* control never gets here */ }
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 13/17 powerpc/lib: Add helper to check if offset is within conditional branch range
In reply to Sasha LevinFrom: "Naveen N. Rao" <[email protected]>
[ Upstream commit 4549c3ea3160fa8b3f37dfe2f957657bb265eda9 ]
Add a helper to check if a given offset is within the branch range for a powerpc conditional branch instruction, and update some sites to use the new helper.
--- arch/powerpc/include/asm/code-patching.h | 1 + arch/powerpc/lib/code-patching.c | 7 ++++++- arch/powerpc/net/bpf_jit.h | 7 +------ 3 files changed, 8 insertions(+), 7 deletions(-)
arch/powerpc/include/asm/code-patching.h +1 -0
@@ -23,6 +23,7 @@#define BRANCH_ABSOLUTE 0x2bool is_offset_in_branch_range (long offset); +bool is_offset_in_cond_branch_range (long offset);int create_branch (struct ppc_inst *instr,const u32 *addr,unsigned long target,int flags); int create_cond_branch(struct ppc_inst *instr, const u32 *addr,
arch/powerpc/lib/code-patching.c +6 -1
@@ -228,6 +228,11 @@ bool is_offset_in_branch_range(long offset)return (offset >=-0x2000000 && offset <=0x1fffffc && !(offset &0x3 )); } +bool is_offset_in_cond_branch_range (long offset) +{ +return offset >=-0x8000 && offset <=0x7fff && !(offset &0x3 ); +} +/* * Helper to check if a given instruction is a conditional branch * Derived from the conditional checks in analyse_instr()
@@ -280,7 +285,7 @@ int create_cond_branch(struct ppc_inst *instr, const u32 *addr, offset = offset - (unsigned long )addr;/* Check we can represent the target in the instruction format */ -if (offset <-0x8000 || offset >0x7FFF || offset &0x3 ) +if (!is_offset_in_cond_branch_range (offset))return 1 ;/* Mask out the flags and target, so they don't step on each other. */
arch/powerpc/net/bpf_jit.h +1 -6
@@ -78,11 +78,6 @@#define PPC_FUNC_ADDR (d,i) do { PPC_LI32(d, i); } while(0)#endif -static inline bool is_nearbranch (int offset) -{ -return (offset <32768 ) && (offset >=-32768 ); -} -/* * The fly in the ointment of code size changing from pass to pass is * avoided by padding the short branch case with a NOP. If code size differs
@@ -91,7 +86,7 @@ static inline bool is_nearbranch(int offset)* state. */ #define PPC_BCC (cond, dest) do { \ - if (is_nearbranch((dest) - (ctx->idx * 4))) { \ + if (is_offset_in_cond_branch_range((long)(dest) - (ctx->idx * 4))) { \ PPC_BCC_SHORT(cond, dest); \ EMIT(PPC_RAW_NOP()); \ } else { \
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 14/17 powerpc/bpf: Validate branch ranges
In reply to Sasha LevinFrom: "Naveen N. Rao" <[email protected]>
[ Upstream commit 3832ba4e283d7052b783dab8311df7e3590fed93 ]
Add checks to ensure that we never emit branch instructions with truncated branch offsets.
--- arch/powerpc/net/bpf_jit.h | 26 ++++++++++++++++++++------ arch/powerpc/net/bpf_jit_comp.c | 6 +++++- arch/powerpc/net/bpf_jit_comp32.c | 8 ++++++-- arch/powerpc/net/bpf_jit_comp64.c | 8 ++++++-- 4 files changed, 37 insertions(+), 11 deletions(-)
arch/powerpc/net/bpf_jit.h +20 -6
@@ -24,16 +24,30 @@#define EMIT (instr) PLANT_INSTR(image, ctx->idx, instr)/* Long jump; (unconditional 'branch') */ -#define PPC_JMP (dest) EMIT(PPC_INST_BRANCH | \ - (((dest) - (ctx->idx * 4)) & 0x03fffffc)) +#define PPC_JMP (dest) \ + do { \ + long offset = (long)(dest) - (ctx->idx * 4); \ + if (!is_offset_in_branch_range(offset)) { \ + pr_err_ratelimited("Branch offset 0x%lx (@%u) out of range\n", offset, ctx->idx); \ + return -ERANGE; \ + } \ + EMIT(PPC_INST_BRANCH | (offset & 0x03fffffc)); \ + } while (0) +/* blr; (unconditional 'branch' with link) to absolute address */ #define PPC_BL_ABS (dest) EMIT(PPC_INST_BL | \ (((dest) - (unsigned long)(image + ctx->idx)) & 0x03fffffc))/* "cond" here covers BO:BI fields. */ -#define PPC_BCC_SHORT (cond, dest) EMIT(PPC_INST_BRANCH_COND | \ - (((cond) & 0x3ff) << 16) | \ - (((dest) - (ctx->idx * 4)) & \ - 0xfffc)) +#define PPC_BCC_SHORT (cond, dest) \ + do { \ + long offset = (long)(dest) - (ctx->idx * 4); \ + if (!is_offset_in_cond_branch_range(offset)) { \ + pr_err_ratelimited("Conditional branch offset 0x%lx (@%u) out of range\n", offset, ctx->idx); \ + return -ERANGE; \ + } \ + EMIT(PPC_INST_BRANCH_COND | (((cond) & 0x3ff) << 16) | (offset & 0xfffc)); \ + } while (0) +/* Sign-extended 32-bit immediate load */ #define PPC_LI32 (d, i) do { \ if ((int)(uintptr_t)(i) >= -32768 && \
arch/powerpc/net/bpf_jit_comp.c +5 -1
@@ -210,7 +210,11 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)/* Now build the prologue, body code & epilogue for real. */ cgctx.idx =0 ;bpf_jit_build_prologue (code_base, &cgctx); -bpf_jit_build_body (fp, code_base, &cgctx, addrs, extra_pass); +if (bpf_jit_build_body (fp, code_base, &cgctx, addrs, extra_pass)) { +bpf_jit_binary_free (bpf_hdr); + fp = org_fp; + goto out_addrs; + }bpf_jit_build_epilogue (code_base, &cgctx);if (bpf_jit_enable >1 )
arch/powerpc/net/bpf_jit_comp32.c +6 -2
@@ -200,7 +200,7 @@ void bpf_jit_emit_func_call_rel(u32 *image, struct codegen_context *ctx, u64 fun } } -static void bpf_jit_emit_tail_call (u32 *image,struct codegen_context *ctx,u32 out) +static int bpf_jit_emit_tail_call (u32 *image,struct codegen_context *ctx,u32 out) {/* * By now, the eBPF program has already setup parameters in r3-r6
@@ -261,7 +261,9 @@ static void bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32bpf_jit_emit_common_epilogue (image, ctx);EMIT (PPC_RAW_BCTR ()); +/* out: */ +return 0 ; }/* Assemble the body code between the prologue & epilogue */
@@ -1090,7 +1092,9 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context **/ case BPF_JMP |BPF_TAIL_CALL : ctx->seen |=SEEN_TAILCALL ; -bpf_jit_emit_tail_call (image, ctx, addrs[i +1 ]); + ret =bpf_jit_emit_tail_call (image, ctx, addrs[i +1 ]); +if (ret <0 ) +return ret;break ;default :
arch/powerpc/net/bpf_jit_comp64.c +6 -2
@@ -206,7 +206,7 @@ void bpf_jit_emit_func_call_rel(u32 *image, struct codegen_context *ctx, u64 funEMIT (PPC_RAW_BCTRL ()); } -static void bpf_jit_emit_tail_call (u32 *image,struct codegen_context *ctx,u32 out) +static int bpf_jit_emit_tail_call (u32 *image,struct codegen_context *ctx,u32 out) {/* * By now, the eBPF program has already setup parameters in r3, r4 and r5
@@ -267,7 +267,9 @@ static void bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32bpf_jit_emit_common_epilogue (image, ctx);EMIT (PPC_RAW_BCTR ()); +/* out: */ +return 0 ; }/* Assemble the body code between the prologue & epilogue */
@@ -993,7 +995,9 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context **/ case BPF_JMP |BPF_TAIL_CALL : ctx->seen |=SEEN_TAILCALL ; -bpf_jit_emit_tail_call (image, ctx, addrs[i +1 ]); + ret =bpf_jit_emit_tail_call (image, ctx, addrs[i +1 ]); +if (ret <0 ) +return ret;break ;default :
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 15/17 powerpc/security: Add a helper to query stf_barrier type
In reply to Sasha LevinFrom: "Naveen N. Rao" <[email protected]>
[ Upstream commit 030905920f32e91a52794937f67434ac0b3ea41a ]
Add a helper to return the stf_barrier type for the current processor.
--- arch/powerpc/include/asm/security_features.h | 5 +++++ arch/powerpc/kernel/security.c | 5 +++++ 2 files changed, 10 insertions(+)
arch/powerpc/include/asm/security_features.h +5 -0
@@ -39,6 +39,11 @@ static inline bool security_ftr_enabled(u64 feature)return !!(powerpc_security_features & feature); } +#ifdef CONFIG_PPC_BOOK3S_64 +enum stf_barrier_type stf_barrier_type_get (void ); +#else +static inline enum stf_barrier_type stf_barrier_type_get (void ) {return STF_BARRIER_NONE ; } +#endif // Features indicating support for Spectre/Meltdown mitigations
arch/powerpc/kernel/security.c +5 -0
@@ -263,6 +263,11 @@ static int __init handle_no_stf_barrier(char *p)early_param ("no_stf_barrier" , handle_no_stf_barrier); +enum stf_barrier_type stf_barrier_type_get (void ) +{ +return stf_enabled_flush_types; +} +/* This is the generic flag used by other architectures */ static int __init handle_ssbd (char *p) {
Signature · 1 line
2.33.0
Sasha Levin
maintainerPATCH 16/17 powerpc/bpf: Emit stf barrier instruction sequences for BPF_NOSPEC
In reply to Sasha LevinFrom: "Naveen N. Rao" <[email protected]>
[ Upstream commit b7540d62509453263604a155bf2d5f0ed450cba2 ]
Emit similar instruction sequences to commit a048a07d7f4535 ("powerpc/64s: Add support for a store forwarding barrier at kernel entry/exit") when encountering BPF_NOSPEC.
Mitigations are enabled depending on what the firmware advertises. In particular, we do not gate these mitigations based on current settings, just like in x86. Due to this, we don't need to take any action if mitigations are enabled or disabled at runtime.
--- arch/powerpc/net/bpf_jit64.h | 8 ++--- arch/powerpc/net/bpf_jit_comp64.c | 55 ++++++++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 8 deletions(-)
arch/powerpc/net/bpf_jit64.h +4 -4
@@ -16,18 +16,18 @@* with our redzone usage. * * [ prev sp ] <------------- -* [ nv gpr save area ] 6*8 | +* [ nv gpr save area ] 5*8 | * [ tail_call_cnt ] 8 | -* [ local_tmp_var ] 8 | +* [ local_tmp_var ] 16 | * fp (r31) --> [ ebpf stack space ] upto 512 | * [ frame header ] 32/112 | * sp (r1) ---> [ stack pointer ] -------------- */ /* for gpr non volatile registers BPG_REG_6 to 10 */ -#define BPF_PPC_STACK_SAVE (6*8) +#define BPF_PPC_STACK_SAVE (5*8)/* for bpf JIT code internal usage */ -#define BPF_PPC_STACK_LOCALS 16 +#define BPF_PPC_STACK_LOCALS 24/* stack frame excluding BPF stack, ensure this is quadword aligned */ #define BPF_PPC_STACKFRAME (STACK_FRAME_MIN_SIZE + \ BPF_PPC_STACK_LOCALS + BPF_PPC_STACK_SAVE)
arch/powerpc/net/bpf_jit_comp64.c +51 -4
94 lines not on this page · raw message
Signature · 1 line
2.33.0
Re: [PATCH AUTOSEL 5.14 17/17] firmware: include drivers/firmware/Kconfig unconditionally
In reply to Sasha LevinQuoted 7 lines · Sasha Levin
From: Arnd Bergmann <[email protected]>
[ Upstream commit
951cd3a0866d29cb9c01ebc1d9c17590e598226e]Compile-testing drivers that require access to a firmware layer fails when that firmware symbol is unavailable. This happened twice this week:
This seems *way* too invasive a change for stable. It exposes code to building on entire new architectures.