Re: [PATCH kernel v2] powerpc/boot: Stop using RELACOUNT

2022-04-05 Thread Alexey Kardashevskiy
On 4/6/22 14:58, Gabriel Paubert wrote: On Wed, Apr 06, 2022 at 02:01:48PM +1000, Alexey Kardashevskiy wrote: So far the RELACOUNT tag from the ELF header was containing the exact number of R_PPC_RELATIVE/R_PPC64_RELATIVE relocations. However the LLVM's recent change [1] make it equal-or-less

Re: [PATCH] cxl/ocxl: Prepare cleanup of powerpc's asm/prom.h

2022-04-05 Thread Andrew Donnellan
On 6/4/22 16:52, Christophe Leroy wrote: Thanks. Can you take the patch through your tree ? We don't have a tree of our own, we rely on mpe to take it through powerpc. -- Andrew Donnellan OzLabs, ADL Canberra a...@linux.ibm.com IBM Australia Limited

Re: [PATCH] cxl/ocxl: Prepare cleanup of powerpc's asm/prom.h

2022-04-05 Thread Christophe Leroy
Le 06/04/2022 à 08:43, Andrew Donnellan a écrit : > On 2/4/22 20:52, Christophe Leroy wrote: >> powerpc's asm/prom.h brings some headers that it doesn't >> need itself. >> >> In order to clean it up, first add missing headers in >> users of asm/prom.h >> >> Signed-off-by: Christophe Leroy > > U

Re: [PATCH] cxl/ocxl: Prepare cleanup of powerpc's asm/prom.h

2022-04-05 Thread Andrew Donnellan
On 2/4/22 20:52, Christophe Leroy wrote: powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy Untested because I don't have your actual patch to change prom.h, but noth

[PATCH v2 5/5] powerpc/8xx: Use kmalloced data structure instead of global static

2022-04-05 Thread Christophe Leroy
Use a kmalloced data structure to store interrupt controller internal data instead of static global variables. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/8xx/cpm1-ic.c | 48 +--- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/

[PATCH v2 3/5] powerpc/8xx: Convert CPM1 interrupt controller to platform_device

2022-04-05 Thread Christophe Leroy
In the same logic as commit be7ecbd240b2 ("soc: fsl: qe: convert QE interrupt controller to platform_device"), convert CPM1 interrupt controller to platform_device. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/8xx/cpm1-ic.c| 90 ++--- arch/powerpc/platforms/

[PATCH v2 4/5] powerpc/8xx: Remove mpc8xx_pics_init()

2022-04-05 Thread Christophe Leroy
mpc8xx_pics_init() is now only a trampoline to mpc8xx_pic_init(). Remove mpc8xx_pics_init() and use mpc8xx_pic_init() directly. Signed-off-by: Christophe Leroy --- v2: Add missing header (pic.h) and change mpc8xx_pic_init() to void. --- arch/powerpc/platforms/8xx/adder875.c| 3 ++- arc

[PATCH v2 2/5] powerpc/8xx: Convert CPM1 error interrupt handler to platform driver

2022-04-05 Thread Christophe Leroy
Add CPM error interrupt as a standalone platform driver, to simplify the init of CPM interrupt handler. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/8xx/cpm1-ic.c | 73 +--- 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/arch/powerpc/platfor

[PATCH v2 1/5] powerpc/8xx: Move CPM interrupt controller into a dedicated file

2022-04-05 Thread Christophe Leroy
CPM interrupt controller is quite standalone. Move it into a dedicated file. It will help for next step which will change it to a platform driver. This is pure code move, checkpatch report is ignored at this point, except one parenthesis alignment which would remain at the end of the series. All o

Re: [PATCH kernel v2] powerpc/boot: Stop using RELACOUNT

2022-04-05 Thread Gabriel Paubert
On Wed, Apr 06, 2022 at 02:01:48PM +1000, Alexey Kardashevskiy wrote: > So far the RELACOUNT tag from the ELF header was containing the exact > number of R_PPC_RELATIVE/R_PPC64_RELATIVE relocations. However the LLVM's > recent change [1] make it equal-or-less than the actual number which > makes it

[PATCH kernel] KVM: PPC: Fix TCE handling for VFIO

2022-04-05 Thread Alexey Kardashevskiy
At the moment the IOMMU page size in a pseries VM is 16MB (the biggest allowed by LoPAPR), this page size is used for an emulated TCE table. If there is a passed though PCI device, that there are hardware IOMMU tables with equal or smaller IOMMU page sizes so one emulated IOMMU pages is backed by p

[PATCH kernel v2] powerpc/boot: Stop using RELACOUNT

2022-04-05 Thread Alexey Kardashevskiy
So far the RELACOUNT tag from the ELF header was containing the exact number of R_PPC_RELATIVE/R_PPC64_RELATIVE relocations. However the LLVM's recent change [1] make it equal-or-less than the actual number which makes it useless. This replaces RELACOUNT in zImage loader with a pair of RELASZ and

Re: [PATCH v2 1/2] powerpc/powernv: Get L1D flush requirements from device-tree

2022-04-05 Thread Russell Currey
On Tue, 2022-04-05 at 02:49 +, Joel Stanley wrote: > I booted both patches in this series on a power10 powernv machine, > applied on top of v5.18-rc1: > > $ dmesg |grep -i flush > [    0.00] rfi-flush: fallback displacement flush available > [    0.00] rfi-flush: patched 12 locations

rcu_sched self-detected stall on CPU

2022-04-05 Thread Miguel Ojeda
Hi PPC/RCU, While merging v5.18-rc1 changes I noticed our CI PPC runs broke. I reproduced the problem in v5.18-rc1 as well as next-20220405, under both QEMU 4.2.1 and 6.1.0, with `-smp 2`; but I cannot reproduce it in v5.17 from a few tries. Sadly, the problem is not deterministic although it is

Re: cleanup swiotlb initialization v8

2022-04-05 Thread Boris Ostrovsky
On 4/4/22 1:05 AM, Christoph Hellwig wrote: Hi all, this series tries to clean up the swiotlb initialization, including that of swiotlb-xen. To get there is also removes the x86 iommu table infrastructure that massively obsfucates the initialization path. Git tree: git://git.infradead.

Re: [PATCH] ASoC: fsl_sai: fix 1:1 bclk:mclk ratio support

2022-04-05 Thread Sascha Hauer
On Tue, Apr 05, 2022 at 05:57:31PM +0200, Ahmad Fatoum wrote: > Refactoring in commit a50b7926d015 ("ASoC: fsl_sai: implement 1:1 > bclk:mclk ratio support") led to the bypass never happening > as (ratio = 1) was caught in the existing if (ratio & 1) continue; > check. The correct check sequence in

Re: [PATCH] pci: hotplug: Prepare cleanup of powerpc's asm/prom.h

2022-04-05 Thread Bjorn Helgaas
On Sat, Apr 02, 2022 at 12:11:56PM +0200, Christophe Leroy wrote: > powerpc's asm/prom.h brings some headers that it doesn't > need itself. > > In order to clean it up, first add missing headers in > users of asm/prom.h > > Signed-off-by: Christophe Leroy I tidied the subject line to match prev

[PATCH] ASoC: fsl_sai: fix 1:1 bclk:mclk ratio support

2022-04-05 Thread Ahmad Fatoum
Refactoring in commit a50b7926d015 ("ASoC: fsl_sai: implement 1:1 bclk:mclk ratio support") led to the bypass never happening as (ratio = 1) was caught in the existing if (ratio & 1) continue; check. The correct check sequence instead is: - skip all ratios lower than one and higher than 512 - sk

Re: [PATCH] powerpc/pseries/vas: use default_groups in kobj_type

2022-04-05 Thread Greg Kroah-Hartman
On Thu, Mar 31, 2022 at 11:39:45PM +1100, Michael Ellerman wrote: > Greg Kroah-Hartman writes: > > There are currently 2 ways to create a set of sysfs files for a > > kobj_type, through the default_attrs field, and the default_groups > > field. Move the pseries vas sysfs code to use default_group

[PATCH 5/5] powerpc/8xx: Use kmalloced data structure instead of global static

2022-04-05 Thread Christophe Leroy
Use a kmalloced data structure to store interrupt controller internal data instead of static global variables. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/8xx/cpm1-ic.c | 48 +--- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/

[PATCH 3/5] powerpc/8xx: Convert CPM1 interrupt controller to platform_device

2022-04-05 Thread Christophe Leroy
In the same logic as commit be7ecbd240b2 ("soc: fsl: qe: convert QE interrupt controller to platform_device"), convert CPM1 interrupt controller to platform_device. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/8xx/cpm1-ic.c| 90 ++--- arch/powerpc/platforms/

[PATCH 1/5] powerpc/8xx: Move CPM interrupt controller into a dedicated file

2022-04-05 Thread Christophe Leroy
CPM interrupt controller is quite standalone. Move it into a dedicated file. It will help for next step which will change it to a platform driver. This is pure code move, checkpatch report is ignored at this point, except one parenthesis alignment which would remain at the end of the series. All o

[PATCH 2/5] powerpc/8xx: Convert CPM1 error interrupt handler to platform driver

2022-04-05 Thread Christophe Leroy
Add CPM error interrupt as a standalone platform driver, to simplify the init of CPM interrupt handler. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/8xx/cpm1-ic.c | 73 +--- 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/arch/powerpc/platfor

[PATCH 4/5] powerpc/8xx: Remove mpc8xx_pics_init()

2022-04-05 Thread Christophe Leroy
mpc8xx_pics_init() is now only a trampoline to mpc8xx_pic_init(). Remove mpc8xx_pics_init() and use mpc8xx_pic_init() directly. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/8xx/adder875.c| 2 +- arch/powerpc/platforms/8xx/ep88xc.c | 2 +- arch/powerpc/platforms/

[PATCH 5.10 425/599] tty: hvc: fix return value of __setup handler

2022-04-05 Thread Greg Kroah-Hartman
From: Randy Dunlap [ Upstream commit 53819a0d97aace1425bb042829e3446952a9e8a9 ] __setup() handlers should return 1 to indicate that the boot option has been handled or 0 to indicate that it was not handled. Add a pr_warn() message if the option value is invalid and then always return 1. Link: l

[PATCH 5.15 640/913] tty: hvc: fix return value of __setup handler

2022-04-05 Thread Greg Kroah-Hartman
From: Randy Dunlap [ Upstream commit 53819a0d97aace1425bb042829e3446952a9e8a9 ] __setup() handlers should return 1 to indicate that the boot option has been handled or 0 to indicate that it was not handled. Add a pr_warn() message if the option value is invalid and then always return 1. Link: l

[PATCH 5.16 0704/1017] tty: hvc: fix return value of __setup handler

2022-04-05 Thread Greg Kroah-Hartman
From: Randy Dunlap [ Upstream commit 53819a0d97aace1425bb042829e3446952a9e8a9 ] __setup() handlers should return 1 to indicate that the boot option has been handled or 0 to indicate that it was not handled. Add a pr_warn() message if the option value is invalid and then always return 1. Link: l

[PATCH 5.17 0779/1126] tty: hvc: fix return value of __setup handler

2022-04-05 Thread Greg Kroah-Hartman
From: Randy Dunlap [ Upstream commit 53819a0d97aace1425bb042829e3446952a9e8a9 ] __setup() handlers should return 1 to indicate that the boot option has been handled or 0 to indicate that it was not handled. Add a pr_warn() message if the option value is invalid and then always return 1. Link: l

Re: [PATCH v2 1/2] powerpc/powernv: Get L1D flush requirements from device-tree

2022-04-05 Thread Joel Stanley
On Tue, 5 Apr 2022 at 06:13, Michael Ellerman wrote: > > Joel Stanley writes: > > On Mon, 4 Apr 2022 at 10:15, Russell Currey wrote: > >> > >> The device-tree properties no-need-l1d-flush-msr-pr-1-to-0 and > >> no-need-l1d-flush-kernel-on-user-access are the equivalents of > >> H_CPU_BEHAV_NO_L1

[PATCH V12 20/20] riscv: compat: Add COMPAT Kbuild skeletal support

2022-04-05 Thread guoren
From: Guo Ren Adds initial skeletal COMPAT Kbuild (Running 32bit U-mode on 64bit S-mode) support. - Setup kconfig & dummy functions for compiling. - Implement compat_start_thread by the way. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Tested-by: Heiko Stuebner

[PATCH V12 19/20] riscv: compat: ptrace: Add compat_arch_ptrace implement

2022-04-05 Thread guoren
From: Guo Ren Now, you can use native gdb on riscv64 for rv32 app debugging. $ uname -a Linux buildroot 5.16.0-rc4-00036-gbef6b82fdf23-dirty #53 SMP Mon Dec 20 23:06:53 CST 2021 riscv64 GNU/Linux $ cat /proc/cpuinfo processor : 0 hart: 0 isa : rv64imafdcsuh mmu

[PATCH V12 18/20] riscv: compat: signal: Add rt_frame implementation

2022-04-05 Thread guoren
From: Guo Ren Implement compat_setup_rt_frame for sigcontext save & restore. The main process is the same with signal, but the rv32 pt_regs' size is different from rv64's, so we needs convert them. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Palmer Dabbelt Tested-by: Heiko Stue

[PATCH V12 17/20] riscv: compat: vdso: Add setup additional pages implementation

2022-04-05 Thread guoren
From: Guo Ren Reconstruct __setup_additional_pages() by appending vdso info pointer argument to meet compat_vdso_info requirement. And change vm_special_mapping *dm, *cm initialization into static. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Palmer Dabbelt Tested-by: Heiko Stue

[PATCH V12 16/20] riscv: compat: vdso: Add COMPAT_VDSO base code implementation

2022-04-05 Thread guoren
From: Guo Ren There is no vgettimeofday supported in rv32 that makes simple to generate rv32 vdso code which only needs riscv64 compiler. Other architectures need change compiler or -m (machine parameter) to support vdso32 compiling. If rv32 support vgettimeofday (which cause C compile) in future

[PATCH V12 15/20] riscv: compat: Add hw capability check for elf

2022-04-05 Thread guoren
From: Guo Ren Detect hardware COMPAT (32bit U-mode) capability in rv64. If not support COMPAT mode in hw, compat_elf_check_arch would return false by compat_binfmt_elf.c Add CLASS to enhance (compat_)elf_check_arch to distinguish 32BIT/64BIT elf. Signed-off-by: Guo Ren Signed-off-by: Guo Ren

[PATCH V12 14/20] riscv: compat: Add elf.h implementation

2022-04-05 Thread guoren
From: Guo Ren Implement necessary type and macro for compat elf. See the code comment for detail. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Tested-by: Heiko Stuebner --- arch/riscv/include/asm/elf.h | 41 +++- 1 file changed, 40

[PATCH V12 13/20] riscv: compat: process: Add UXL_32 support in start_thread

2022-04-05 Thread guoren
From: Guo Ren If the current task is in COMPAT mode, set SR_UXL_32 in status for returning userspace. We need CONFIG _COMPAT to prevent compiling errors with rv32 defconfig. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Tested-by: Heiko Stuebner Cc: Arnd Bergmann Cc: Palmer Dabbelt --- arc

[PATCH V12 12/20] riscv: compat: syscall: Add entry.S implementation

2022-04-05 Thread guoren
From: Guo Ren Implement the entry of compat_sys_call_table[] in asm. Ref to riscv-privileged spec 4.1.1 Supervisor Status Register (sstatus): BIT[32:33] = UXL[1:0]: - 1:32 - 2:64 - 3:128 Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Palmer Dabbelt Tested-by: Heiko Stuebner

[PATCH V12 11/20] riscv: compat: syscall: Add compat_sys_call_table implementation

2022-04-05 Thread guoren
From: Guo Ren Implement compat sys_call_table and some system call functions: truncate64, ftruncate64, fallocate, pread64, pwrite64, sync_file_range, readahead, fadvise64_64 which need argument translation. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Tested-by: He

[PATCH V12 10/20] riscv: compat: Support TASK_SIZE for compat mode

2022-04-05 Thread guoren
From: Guo Ren Make TASK_SIZE from const to dynamic detect TIF_32BIT flag function. Refer to arm64 to implement DEFAULT_MAP_WINDOW_64 for efi-stub. Limit 32-bit compatible process in 0-2GB virtual address range (which is enough for real scenarios), because it could avoid address sign extend probl

[PATCH V12 09/20] riscv: compat: Add basic compat data type implementation

2022-04-05 Thread guoren
From: Guo Ren Implement riscv asm/compat.h for struct compat_xxx, is_compat_task, compat_user_regset, regset convert. The rv64 compat.h has inherited most of the structs from the generic one. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Tested-by: Heiko Stuebner Cc: Arnd Bergmann Cc: Palme

[PATCH V12 08/20] riscv: Fixup difference with defconfig

2022-04-05 Thread guoren
From: Guo Ren Let's follow the origin patch's spirit: The only difference between rv32_defconfig and defconfig is that rv32_defconfig has CONFIG_ARCH_RV32I=y. This is helpful to compare rv64-compat-rv32 v.s. rv32-linux. Fixes: 1b937e8faa87ccfb ("RISC-V: Add separate defconfig for 32bit system

[PATCH V12 07/20] syscalls: compat: Fix the missing part for __SYSCALL_COMPAT

2022-04-05 Thread guoren
From: Guo Ren Make "uapi asm unistd.h" could be used for architectures' COMPAT mode. The __SYSCALL_COMPAT is first used in riscv. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Tested-by: Heiko Stuebner --- include/uapi/asm-generic/u

[PATCH V12 06/20] asm-generic: compat: Cleanup duplicate definitions

2022-04-05 Thread guoren
From: Guo Ren There are 7 64bit architectures that support Linux COMPAT mode to run 32bit applications. A lot of definitions are duplicate: - COMPAT_USER_HZ - COMPAT_RLIM_INFINITY - COMPAT_OFF_T_MAX - __compat_uid_t, __compat_uid_t - compat_dev_t - compat_ipc_pid_t - struct compat_flock -

[PATCH V12 05/20] fs: stat: compat: Add __ARCH_WANT_COMPAT_STAT

2022-04-05 Thread guoren
From: Guo Ren RISC-V doesn't neeed compat_stat, so using __ARCH_WANT_COMPAT_STAT to exclude unnecessary SYSCALL functions. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Tested-by: Heiko Stuebner Acked-by: Helge Deller # parisc Cc:

[PATCH V12 04/20] arch: Add SYSVIPC_COMPAT for all architectures

2022-04-05 Thread guoren
From: Guo Ren The existing per-arch definitions are pretty much historic cruft. Move SYSVIPC_COMPAT into init/Kconfig. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Acked-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Tested-by: Heiko Stuebner Acked-by: Helge Deller # parisc Cc: Palmer

[PATCH V12 03/20] compat: consolidate the compat_flock{, 64} definition

2022-04-05 Thread guoren
From: Christoph Hellwig Provide a single common definition for the compat_flock and compat_flock64 structures using the same tricks as for the native variants. Another extra define is added for the packing required on x86. Signed-off-by: Christoph Hellwig Signed-off-by: Guo Ren Reviewed-by: A

[PATCH V12 02/20] uapi: always define F_GETLK64/F_SETLK64/F_SETLKW64 in fcntl.h

2022-04-05 Thread guoren
From: Christoph Hellwig The F_GETLK64/F_SETLK64/F_SETLKW64 fcntl opcodes are only implemented for the 32-bit syscall APIs, but are also needed for compat handling on 64-bit kernels. Consolidate them in unistd.h instead of definining the internal compat definitions in compat.h, which is rather er

[PATCH V12 01/20] uapi: simplify __ARCH_FLOCK{,64}_PAD a little

2022-04-05 Thread guoren
From: Christoph Hellwig Don't bother to define the symbols empty, just don't use them. That makes the intent a little more clear. Remove the unused HAVE_ARCH_STRUCT_FLOCK64 define and merge the 32-bit mips struct flock into the generic one. Add a new __ARCH_FLOCK_EXTRA_SYSID macro following the

[PATCH V12 00/20] riscv: Add COMPAT mode support for 64BIT

2022-04-05 Thread guoren
From: Guo Ren Currently, most 64-bit architectures (x86, parisc, powerpc, arm64, s390, mips, sparc) have supported COMPAT mode. But they all have history issues and can't use standard linux unistd.h. RISC-V would be first standard __SYSCALL_COMPAT user of include/uapi/asm-generic /unistd.h. The