Re: [PATCH v6 0/6] Allocate module text and data separately

2022-03-22 Thread Luis Chamberlain
On Wed, Feb 23, 2022 at 01:02:10PM +0100, Christophe Leroy wrote: > This series applies on top of my series "miscellanuous cleanups" v4. Queued onto modules-testing! BTW I just had to rebase the change with the kdb changes, it was a trivial change. Luis

[PATCH] ibmvscsis: increase INITIAL_SRP_LIMIT to 1024

2022-03-22 Thread Tyrel Datwyler
The adapter request_limit is hardcoded to be INITIAL_SRP_LIMIT which is currently an arbitrary value of 800. Increase this value to 1024 which better matches the characteristics of the typical IBMi Initiator that supports 32 LUNs and a queue depth of 32. This change also has the secondary benefit

Re: [PATCH] Docs: admin/kernel-parameters: edit a few boot options

2022-03-22 Thread Rafael J. Wysocki
On Mon, Mar 21, 2022 at 2:22 AM Randy Dunlap wrote: > > Clean up some of admin-guide/kernel-parameters.txt: > > a. "smt" should be "smt=" (S390) > b. add "smt-enabled" for POWERPC > c. Sparc supports the vdso= boot option > d. make the tp_printk options (2) formatting similar to other options >

Re: [PATCH] Docs: admin/kernel-parameters: edit a few boot options

2022-03-22 Thread Randy Dunlap
On 3/22/22 10:41, Rafael J. Wysocki wrote: > On Mon, Mar 21, 2022 at 2:22 AM Randy Dunlap wrote: >> Clean up some of admin-guide/kernel-parameters.txt: >> >> a. "smt" should be "smt=" (S390) >> b. add "smt-enabled" for POWERPC >> c. Sparc supports the vdso= boot option >> d. make the tp_printk

Re: [PATCH V9 00/20] riscv: compat: Add COMPAT Kbuild skeletal support

2022-03-22 Thread Palmer Dabbelt
On Tue, 22 Mar 2022 07:39:43 PDT (-0700), guo...@kernel.org wrote: 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

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

2022-03-22 Thread Alexey Kardashevskiy
On 3/22/22 13:12, Michael Ellerman wrote: Alexey Kardashevskiy writes: 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

[PATCH] powerpc/powernv: Get more flushing requirements from device-tree

2022-03-22 Thread Russell Currey
The device-tree properties no-need-l1d-flush-msr-pr-1-to-0, no-need-l1d-flush-kernel-on-user-access and no-need-store-drain-on-priv-state-switch are the equivalents of H_CPU_BEHAV_NO_L1D_FLUSH_ENTRY, H_CPU_BEHAV_NO_L1D_FLUSH_UACCESS and H_CPU_BEHAV_NO_STF_BARRIER from the H_GET_CPU_CHARACTERISTICS

Re: [PATCH v1 4/7] arm64/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-03-22 Thread David Hildenbrand
On 21.03.22 19:27, Catalin Marinas wrote: > On Mon, Mar 21, 2022 at 05:44:05PM +, Will Deacon wrote: >> On Mon, Mar 21, 2022 at 04:07:48PM +0100, David Hildenbrand wrote: >>> So the example you gave cannot possibly have that bit set. From what I >>> understand, it should be fine. But I have no

Re: [PATCH 2/2] powerpc/papr_scm: Fix build failure when CONFIG_PERF_EVENTS is not set

2022-03-22 Thread kajoljain
On 3/22/22 03:09, Dan Williams wrote: > On Fri, Mar 18, 2022 at 4:42 AM Kajol Jain wrote: >> >> The following build failure occures when CONFIG_PERF_EVENTS is not set >> as generic pmu functions are not visible in that scenario. >> >> arch/powerpc/platforms/pseries/papr_scm.c:372:35: error:

Re: [PATCH 2/2] powerpc/papr_scm: Fix build failure when CONFIG_PERF_EVENTS is not set

2022-03-22 Thread kajoljain
On 3/22/22 07:15, Dan Williams wrote: > On Mon, Mar 21, 2022 at 2:39 PM Dan Williams wrote: >> >> On Fri, Mar 18, 2022 at 4:42 AM Kajol Jain wrote: >>> >>> The following build failure occures when CONFIG_PERF_EVENTS is not set >>> as generic pmu functions are not visible in that scenario. >>>

Re: [PATCH 2/2] powerpc/papr_scm: Fix build failure when CONFIG_PERF_EVENTS is not set

2022-03-22 Thread Dan Williams
On Tue, Mar 22, 2022 at 7:30 AM kajoljain wrote: > > > > On 3/22/22 03:09, Dan Williams wrote: > > On Fri, Mar 18, 2022 at 4:42 AM Kajol Jain wrote: > >> > >> The following build failure occures when CONFIG_PERF_EVENTS is not set > >> as generic pmu functions are not visible in that scenario. >

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

2022-03-22 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 V9 04/20] kconfig: Add SYSVIPC_COMPAT for all architectures

2022-03-22 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 Cc: Palmer Dabbelt --- arch/arm64/Kconfig

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

2022-03-22 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

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

2022-03-22 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 ---

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

2022-03-22 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:

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

2022-03-22 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 ---

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

2022-03-22 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 V9 14/20] riscv: compat: Add elf.h implementation

2022-03-22 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,

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

2022-03-22 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

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

2022-03-22 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

[PATCH v1 1/4] powerpc/code-patching: Don't call is_vmalloc_or_module_addr() without CONFIG_MODULES

2022-03-22 Thread Christophe Leroy
If CONFIG_MODULES is not set, there is no point in checking whether text is in module area. This reduced the time needed to activate/deactivate ftrace by more than 10% on an 8xx. Signed-off-by: Christophe Leroy --- arch/powerpc/lib/code-patching.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v1 4/4] powerpc/code-patching: Use jump_label to check if poking_init() is done

2022-03-22 Thread Christophe Leroy
It's only during early startup that poking_init() is not done yet, for instance when calling ftrace_init(). Once poking_init() has been called there must be a poking area, no need to check it everytime patch_instruction() is called. ftrace activation time is reduced by 7% with the change on an

[PATCH v1 0/4] Kill the time spent in patch_instruction()

2022-03-22 Thread Christophe Leroy
This series reduces by 70% the time required to activate ftrace on an 8xx with CONFIG_STRICT_KERNEL_RWX. Measure is performed in function ftrace_replace_code() using mftb() around the loop. With the series, - Without CONFIG_STRICT_KERNEL_RWX, 416000 TB ticks are measured. - With

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

2022-03-22 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:

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

2022-03-22 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

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

2022-03-22 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

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

2022-03-22 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 V9 05/20] fs: stat: compat: Add __ARCH_WANT_COMPAT_STAT

2022-03-22 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 Cc: Palmer Dabbelt ---

[PATCH V9 10/20] riscv: compat: Re-implement TASK_SIZE for COMPAT_32BIT

2022-03-22 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

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

2022-03-22 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:

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

2022-03-22 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 V9 16/20] riscv: compat: vdso: Add COMPAT_VDSO base code implementation

2022-03-22 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

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

2022-03-22 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 V9 20/20] riscv: compat: Add COMPAT Kbuild skeletal support

2022-03-22 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 v1 3/4] powerpc/code-patching: Use jump_label for testing freed initmem

2022-03-22 Thread Christophe Leroy
Once init is done, initmem is freed forever so no need to test system_state at every call to patch_instruction(). Use jump_label. This reduces by 2% the time needed to activate ftrace on an 8xx. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h | 2 ++

[PATCH v1 2/4] powerpc/code-patching: Speed up page mapping/unmapping

2022-03-22 Thread Christophe Leroy
Since commit 591b4b268435 ("powerpc/code-patching: Pre-map patch area") the patch area is premapped so intermediate page tables are already allocated. Use __set_pte_at() directly instead of the heavy map_kernel_page(), at for unmapping just do a pte_clear() followed by a flush. __set_pte_at()