Re: [PATCH] powerpc: platforms: 52xx: Fix a resource leak in an error handling path

2022-01-29 Thread Anatolij Gustschin
On Sat, 29 Jan 2022 08:16:04 +0100 Christophe JAILLET christophe.jail...@wanadoo.fr wrote: >The error handling path of mpc52xx_lpbfifo_probe() and a request_irq() is >not balanced by a corresponding free_irq(). > >Add the missing call, as already done in the remove function. > >Fixes: 3c9059d79f5e

Re: [PATCH V2] powerpc/perf: Fix power_pmu_disable to call clear_pmi_irq_pending only if PMI is pending

2022-01-29 Thread Michael Ellerman
On Sat, 22 Jan 2022 09:04:29 +0530, Athira Rajeev wrote: > Running selftest with CONFIG_PPC_IRQ_SOFT_MASK_DEBUG enabled in kernel > triggered below warning: > > [ 172.851380] [ cut here ] > [ 172.851391] WARNING: CPU: 8 PID: 2901 at > arch/powerpc/include/asm/hw_irq.h:24

Re: [PATCH] powerpc/fixmap: Fix VM debug warning on unmap

2022-01-29 Thread Michael Ellerman
On Mon, 6 Dec 2021 11:11:51 +, Christophe Leroy wrote: > Unmapping a fixmap entry is done by calling __set_fixmap() > with FIXMAP_PAGE_CLEAR as flags. > > Today, powerpc __set_fixmap() calls map_kernel_page(). > > map_kernel_page() is not happy when called a second time > for the same page. >

Re: (subset) [PATCH 1/3] powerpc/64s/interrupt: Fix decrementer storm

2022-01-29 Thread Michael Ellerman
On Tue, 25 Jan 2022 00:39:28 +1000, Nicholas Piggin wrote: > The decrementer exception can fail to be cleared when the interrupt > returns in the case where the decrementer wraps with the next timer > still beyond decrementer_max. This results in a decrementer interrupt > storm. This is triggerable

Re: [PATCH] KVM: PPC: Book3S HV Nested: Fix nested HFSCR being clobbered with multiple vCPUs

2022-01-29 Thread Michael Ellerman
On Sat, 22 Jan 2022 20:55:30 +1000, Nicholas Piggin wrote: > The L0 is storing HFSCR requested by the L1 for the L2 in struct > kvm_nested_guest when the L1 requests a vCPU enter L2. kvm_nested_guest > is not a per-vCPU structure. Hilarity ensues. > > Fix it by moving the nested hfscr into the vCP

[PATCH V4 00/17] riscv: compat: Add COMPAT mode support for rv64

2022-01-29 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

[PATCH V4 01/17] kconfig: Add SYSVIPC_COMPAT for all architectures

2022-01-29 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 Cc: Christoph Hellwig Cc: Palmer Dabbelt --- arch/arm64/Kconfig | 4 arch/mips/Kconfig| 5

[PATCH V4 02/17] fs: stat: compat: Add __ARCH_WANT_COMPAT_STAT

2022-01-29 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 Cc: Palmer Dabbelt --- arch/arm64/include/asm/unistd.h | 1 + arch/mips/include/asm/unistd.h

[PATCH V4 03/17] asm-generic: compat: Cleanup duplicate definitions

2022-01-29 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 V4 04/17] syscalls: compat: Fix the missing part for __SYSCALL_COMPAT

2022-01-29 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 --- include/uapi/asm-generic/unistd.h | 4 ++-- tools/include/uapi/asm-generic/unis

[PATCH V4 05/17] riscv: Fixup difference with defconfig

2022-01-29 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 V4 06/17] riscv: compat: Add basic compat date type implementation

2022-01-29 Thread guoren
From: Guo Ren Implement asm/compat.h for struct compat_xxx, RLIM_INFINITY, OFF_T_MAX, is_compat_task, compat_user_regset, regset convert. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Arnd Bergmann --- arch/riscv/include/asm/compat.h | 135 +++ arch/riscv/inc

[PATCH V4 07/17] riscv: compat: Re-implement TASK_SIZE for COMPAT_32BIT

2022-01-29 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 V4 08/17] riscv: compat: syscall: Add compat_sys_call_table implementation

2022-01-29 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 Cc: Arnd Bergmann --- arch/riscv/includ

[PATCH V4 09/17] riscv: compat: syscall: Add entry.S implementation

2022-01-29 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 Cc: Arnd Bergmann --- arch/riscv/include/asm/csr.h |

[PATCH V4 10/17] riscv: compat: process: Add UXL_32 support in start_thread

2022-01-29 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 Cc: Arnd Bergmann Cc: Palmer Dabbelt --- arch/riscv/kernel/process.c |

[PATCH V4 11/17] riscv: compat: Add elf.h implementation

2022-01-29 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 --- arch/riscv/include/asm/elf.h | 48 +++- 1 file changed, 47 insertions(+), 1 deletion(

[PATCH V4 12/17] riscv: compat: vdso: Add rv32 VDSO base code implementation

2022-01-29 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 V4 13/17] riscv: compat: vdso: Add setup additional pages implementation

2022-01-29 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 Cc: Arnd Bergmann Cc: Palmer Dabbelt --- arch/r

[PATCH V4 14/17] riscv: compat: signal: Add rt_frame implementation

2022-01-29 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 Cc: Arnd Bergmann Cc: Palmer Dabbelt --- arch/r

[PATCH V4 15/17] riscv: compat: ptrace: Add compat_arch_ptrace implement

2022-01-29 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 V4 16/17] riscv: compat: Add COMPAT Kbuild skeletal support

2022-01-29 Thread guoren
From: Guo Ren Adds initial skeletal COMPAT Kbuild (Runing 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 Cc: Palmer Dabbelt --- arc

[PATCH V4 17/17] KVM: compat: riscv: Prevent KVM_COMPAT from being selected

2022-01-29 Thread guoren
From: Guo Ren Current riscv doesn't support the 32bit KVM API. Let's make it clear by not selecting KVM_COMPAT. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Arnd Bergmann --- virt/kvm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/Kconfig b/virt/kvm

[GIT PULL] Please pull powerpc/linux.git powerpc-5.17-3 tag

2022-01-29 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Linus, Please pull some more powerpc fixes for 5.17: The following changes since commit dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0: Merge tag 'powerpc-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux (2022-01-23 17:52:42

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.17-3 tag

2022-01-29 Thread pr-tracker-bot
The pull request you sent on Sat, 29 Jan 2022 23:38:52 +1100: > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > tags/powerpc-5.17-3 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/d66c1e79b9fcbfc6559ea3c5b1243d590fa04179 Thank you! -- Deet-doot-d

Re: [PATCH 0/3] status: TTY status message request

2022-01-29 Thread Walt Drummond
ACK, will do. On Wed, Jan 26, 2022 at 5:45 AM Greg KH wrote: > > On Mon, Jan 17, 2022 at 08:42:57PM -0800, Walt Drummond wrote: > > This patchset adds TTY status message request feature to the n_tty > > line dicipline. This feature prints a brief message containing basic > > system and process g

[PATCH v3 0/6] Allocate module text and data separately

2022-01-29 Thread Christophe Leroy
This series allow architectures to request having modules data in vmalloc area instead of module area. This is required on powerpc book3s/32 in order to set data non executable, because it is not possible to set executability on page basis, this is done per 256 Mbytes segments. The module area has

[PATCH v3 2/6] modules: Prepare for handling several RB trees

2022-01-29 Thread Christophe Leroy
In order to separate text and data, we need to setup two rb trees. Modify functions to give the tree as a parameter. Signed-off-by: Christophe Leroy --- kernel/module.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/kernel/module.c b

[PATCH v3 3/6] modules: Introduce data_layout

2022-01-29 Thread Christophe Leroy
In order to allow separation of data from text, add another layout, called data_layout. For architectures requesting separation of text and data, only text will go in core_layout and data will go in data_layout. For architectures which keep text and data together, make data_layout an alias of core

[PATCH v3 4/6] modules: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC

2022-01-29 Thread Christophe Leroy
Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC to allow architectures to request having modules data in vmalloc area instead of module area. This is required on powerpc book3s/32 in order to set data non executable, because it is not possible to set executability on page basis, this is done per 256

[PATCH v3 5/6] modules: Remove module_addr_min and module_addr_max

2022-01-29 Thread Christophe Leroy
Replace module_addr_min and module_addr_max by mod_tree.addr_min and mod_tree.addr_max Signed-off-by: Christophe Leroy --- kernel/module.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/kernel/module.c b/kernel/module.c index f3758115ebaa..01fdc9c8a5e2 100644 --- a/

[PATCH v3 6/6] powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx

2022-01-29 Thread Christophe Leroy
book3s/32 and 8xx have a separate area for allocating modules, defined by MODULES_VADDR / MODULES_END. On book3s/32, it is not possible to protect against execution on a page basis. A full 256M segment is either Exec or NoExec. The module area is in an Exec segment while vmalloc area is in a NoExe

[PATCH v3 1/6] modules: Always have struct mod_tree_root

2022-01-29 Thread Christophe Leroy
In order to separate text and data, we need to setup two rb trees. This means that struct mod_tree_root is required even without MODULES_TREE_LOOKUP. Signed-off-by: Christophe Leroy --- kernel/module.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --gi

[PATCH] [Modified for 5.10] powerpc/32s: Fix kasan_init_region() for KASAN

2022-01-29 Thread Christophe Leroy
This is a backport for 5.10 To apply, it also requires commit 37eb7ca91b69 ("powerpc/32s: Allocate one 256k IBAT instead of two consecutives 128k IBATs") (cherry picked from commit d37823c3528e5e0705fc7746bcbc2afffb619259) It has been reported some configuration where the kernel doesn't boot wit

[PATCH] [Modified for 5.16 and 5.15] powerpc/32s: Fix kasan_init_region() for KASAN

2022-01-29 Thread Christophe Leroy
This is a backport for 5.16 and 5.15. To apply, it also requires commit 37eb7ca91b69 ("powerpc/32s: Allocate one 256k IBAT instead of two consecutives 128k IBATs") (cherry picked from commit d37823c3528e5e0705fc7746bcbc2afffb619259) It has been reported some configuration where the kernel doesn'

Re: [BUG] mtd: cfi_cmdset_0002: write regression since v4.17-rc1

2022-01-29 Thread Tokunori Ikegami
Hi Ahmad-san, Thanks for your investigation. The issue is still there with #define FORCE_WORD_WRITE 1: jffs2: Write clean marker to block at 0x000a failed: -5 MTD do_write_oneword_once(): software timeout Which kernel version has been tested about this? Since the buffered writes dis

Re: [PATCH V4 03/17] asm-generic: compat: Cleanup duplicate definitions

2022-01-29 Thread Arnd Bergmann
On Sat, Jan 29, 2022 at 1:17 PM wrote: > > 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 > -

Re: [PATCH V4 06/17] riscv: compat: Add basic compat date type implementation

2022-01-29 Thread Arnd Bergmann
On Sat, Jan 29, 2022 at 1:17 PM wrote: > + > +#define COMPAT_RLIM_INFINITY 0x7fff > > +#define F_GETLK64 12 > +#define F_SETLK64 13 > +#define F_SETLKW64 14 These now come from the generic definitions I think. The flock definitions are just the normal ones, and AFAICT the RLIM

Re: [PATCH V4 08/17] riscv: compat: syscall: Add compat_sys_call_table implementation

2022-01-29 Thread Arnd Bergmann
> 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 > Cc: Arnd Bergmann This all looks really

[powerpc:fixes-test] BUILD SUCCESS fe8a1487c462c9afb7a7da862b0747b1f57229e7

2022-01-29 Thread kernel test robot
randconfig-c002-20220124 arm randconfig-c002-20220129 arm randconfig-c002-20220130 ia64 allmodconfig ia64 allyesconfig m68k allmodconfig m68k

[powerpc:merge] BUILD SUCCESS 33ecb3e590194051dc57eee1125c1d372b14c946

2022-01-29 Thread kernel test robot
config arm footbridge_defconfig arm randconfig-c002-20220127 arm randconfig-c002-20220124 arm randconfig-c002-20220130 arm randconfig-c002-20220129 ia64defconfig ia64 allyesc

[powerpc:next-test] BUILD SUCCESS 2a5e55b339d3a26e0db38d8e5b1824d3581e8d76

2022-01-29 Thread kernel test robot
allyesconfig arm randconfig-c002-20220127 arm randconfig-c002-20220124 arm randconfig-c002-20220129 arm randconfig-c002-20220130 ia64 allmodconfig ia64 allyesconfig m68k

Re: [PATCH V4 06/17] riscv: compat: Add basic compat date type implementation

2022-01-29 Thread Guo Ren
On Sun, Jan 30, 2022 at 5:56 AM Arnd Bergmann wrote: > > On Sat, Jan 29, 2022 at 1:17 PM wrote: > > + > > +#define COMPAT_RLIM_INFINITY 0x7fff > > > > +#define F_GETLK64 12 > > +#define F_SETLK64 13 > > +#define F_SETLKW64 14 > > These now come from the generic definitions I t

Re: [PATCH V4 08/17] riscv: compat: syscall: Add compat_sys_call_table implementation

2022-01-29 Thread Guo Ren
On Sun, Jan 30, 2022 at 6:41 AM Arnd Bergmann wrote: > > > 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 >