Re: [PATCH V5 15/21] riscv: compat: Add hw capability check for elf

2022-02-01 Thread Christoph Hellwig
On Tue, Feb 01, 2022 at 11:05:39PM +0800, guo...@kernel.org wrote: > +bool compat_elf_check_arch(Elf32_Ehdr *hdr) > +{ > + if (compat_mode_support && (hdr->e_machine == EM_RISCV)) > + return true; > + else > + return false; > +} This can be simplified to:

Re: [PATCH V5 06/21] asm-generic: compat: Cleanup duplicate definitions

2022-02-01 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH] mm: Merge pte_mkhuge() call into arch_make_huge_pte()

2022-02-01 Thread Mike Rapoport
On Wed, Feb 02, 2022 at 06:25:31AM +, Christophe Leroy wrote: > > > Le 02/02/2022 à 07:18, Mike Rapoport a écrit : > > On Wed, Feb 02, 2022 at 11:08:06AM +0530, Anshuman Khandual wrote: > >> Each call into pte_mkhuge() is invariably followed by arch_make_huge_pte(). > >> Instead

Re: [PATCH v7 0/5] Allow guest access to EFI confidential computing secret area

2022-02-01 Thread Ard Biesheuvel
On Wed, 2 Feb 2022 at 08:10, Matthew Garrett wrote: > > On Wed, Feb 02, 2022 at 08:05:23AM +0100, Greg KH wrote: > > > I see different platform patches trying to stick these blobs in > > different locations and ways to access (securityfs, sysfs, char device > > node), which seems crazy to me.

Re: [PATCH v7 0/5] Allow guest access to EFI confidential computing secret area

2022-02-01 Thread Greg KH
On Wed, Feb 02, 2022 at 06:54:43AM +, Matthew Garrett wrote: > On Wed, Feb 02, 2022 at 07:10:02AM +0100, Greg KH wrote: > > On Wed, Feb 02, 2022 at 04:01:57AM +, Matthew Garrett wrote: > > > We're talking about things that have massively different semantics. > > > > I see lots of

Re: [PATCH] mm: Merge pte_mkhuge() call into arch_make_huge_pte()

2022-02-01 Thread Christophe Leroy
Le 02/02/2022 à 07:18, Mike Rapoport a écrit : > On Wed, Feb 02, 2022 at 11:08:06AM +0530, Anshuman Khandual wrote: >> Each call into pte_mkhuge() is invariably followed by arch_make_huge_pte(). >> Instead arch_make_huge_pte() can accommodate pte_mkhuge() at the beginning. >> This updates

Re: [PATCH] mm: Merge pte_mkhuge() call into arch_make_huge_pte()

2022-02-01 Thread Christophe Leroy
Le 02/02/2022 à 06:38, Anshuman Khandual a écrit : > Each call into pte_mkhuge() is invariably followed by arch_make_huge_pte(). > Instead arch_make_huge_pte() can accommodate pte_mkhuge() at the beginning. > This updates generic fallback stub for arch_make_huge_pte() and available > platforms

Re: [PATCH] mm: Merge pte_mkhuge() call into arch_make_huge_pte()

2022-02-01 Thread Mike Rapoport
On Wed, Feb 02, 2022 at 11:08:06AM +0530, Anshuman Khandual wrote: > Each call into pte_mkhuge() is invariably followed by arch_make_huge_pte(). > Instead arch_make_huge_pte() can accommodate pte_mkhuge() at the beginning. > This updates generic fallback stub for arch_make_huge_pte() and available

Re: [PATCH v7 0/5] Allow guest access to EFI confidential computing secret area

2022-02-01 Thread Greg KH
On Wed, Feb 02, 2022 at 04:01:57AM +, Matthew Garrett wrote: > On Tue, Feb 01, 2022 at 09:24:50AM -0500, James Bottomley wrote: > > On Tue, 2022-02-01 at 14:50 +0100, Greg KH wrote: > > > You all need to work together to come up with a unified place for > > > this and stop making it

[PATCH] mm: Merge pte_mkhuge() call into arch_make_huge_pte()

2022-02-01 Thread Anshuman Khandual
Each call into pte_mkhuge() is invariably followed by arch_make_huge_pte(). Instead arch_make_huge_pte() can accommodate pte_mkhuge() at the beginning. This updates generic fallback stub for arch_make_huge_pte() and available platforms definitions. This makes huge pte creation much cleaner and

[PATCH v2] powerpc/ptdump: Fix sparse warning in hashpagetable.c

2022-02-01 Thread Michael Ellerman
As reported by sparse: arch/powerpc/mm/ptdump/hashpagetable.c:264:29: warning: restricted __be64 degrades to integer arch/powerpc/mm/ptdump/hashpagetable.c:265:49: warning: restricted __be64 degrades to integer arch/powerpc/mm/ptdump/hashpagetable.c:267:36: warning: incorrect type in

[PATCH V2] powerpc/perf: Fix task context setting for trace imc

2022-02-01 Thread Athira Rajeev
Trace IMC (In-Memory collection counters) in powerpc is useful for application level profiling. For trace_imc, presently task context (task_ctx_nr) is set to perf_hw_context. But perf_hw_context is to be used for cpu PMU. So for trace_imc, even though it is per thread PMU, it is preferred to use

Re: [PATCH V5 15/21] riscv: compat: Add hw capability check for elf

2022-02-01 Thread Guo Ren
On Tue, Feb 1, 2022 at 11:07 PM wrote: > > 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 > > Signed-off-by: Guo Ren > Signed-off-by: Guo Ren > Cc: Arnd Bergmann

[PATCH] spi: mpc512x-psc: Fix compile errors

2022-02-01 Thread Linus Walleij
My patch created compilation bugs in the MPC512x-PSC driver. Fix them up. Cc: Uwe Kleine-König Cc: Anatolij Gustschin Cc: linuxppc-dev@lists.ozlabs.org Reported-by: kernel test robot Fixes: 2818824ced4b (" spi: mpc512x-psc: Convert to use GPIO descriptors") Signed-off-by: Linus Walleij ---

Re: [PATCH v7 0/5] Allow guest access to EFI confidential computing secret area

2022-02-01 Thread Dr. David Alan Gilbert
* James Bottomley (j...@linux.ibm.com) wrote: > [cc's added] > On Tue, 2022-02-01 at 14:50 +0100, Greg KH wrote: > > On Tue, Feb 01, 2022 at 12:44:08PM +, Dov Murik wrote: > [...] > > > # ls -la /sys/kernel/security/coco/efi_secret > > > total 0 > > > drwxr-xr-x 2 root root 0 Jun 28 11:55 . >

Re: [PATCH V5 21/21] KVM: compat: riscv: Prevent KVM_COMPAT from being selected

2022-02-01 Thread Guo Ren
On Wed, Feb 2, 2022 at 12:11 AM Anup Patel wrote: > > On Tue, Feb 1, 2022 at 9:31 PM Paolo Bonzini wrote: > > > > On 2/1/22 16:44, Anup Patel wrote: > > > +Paolo > > > > > > On Tue, Feb 1, 2022 at 8:38 PM wrote: > > >> > > >> From: Guo Ren > > >> > > >> Current riscv doesn't support the 32bit

Re: [PATCH 2/3] powerpc/pseries/vas: Add VAS migration handler

2022-02-01 Thread Nathan Lynch
Haren Myneni writes: > On Mon, 2022-01-31 at 10:37 -0600, Nathan Lynch wrote: >> Haren Myneni writes: >> > Since the VAS windows belong to the VAS hardware resource, the >> > hypervisor expects the partition to close them on source partition >> > and reopen them after the partition migrated on

Re: [PATCH V5 21/21] KVM: compat: riscv: Prevent KVM_COMPAT from being selected

2022-02-01 Thread Anup Patel
On Tue, Feb 1, 2022 at 9:31 PM Paolo Bonzini wrote: > > On 2/1/22 16:44, Anup Patel wrote: > > +Paolo > > > > On Tue, Feb 1, 2022 at 8:38 PM wrote: > >> > >> From: Guo Ren > >> > >> Current riscv doesn't support the 32bit KVM API. Let's make it > >> clear by not selecting KVM_COMPAT. > >> > >>

Re: [PATCH V5 21/21] KVM: compat: riscv: Prevent KVM_COMPAT from being selected

2022-02-01 Thread Paolo Bonzini
On 2/1/22 16:44, Anup Patel wrote: +Paolo On Tue, Feb 1, 2022 at 8:38 PM wrote: 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 Cc: Anup Patel This looks

Re: [PATCH V5 21/21] KVM: compat: riscv: Prevent KVM_COMPAT from being selected

2022-02-01 Thread Anup Patel
+Paolo On Tue, Feb 1, 2022 at 8:38 PM wrote: > > 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 > Cc: Anup Patel This looks good to me.

Re: [RFC PATCH 0/2] powerpc/pseries: add support for local secure storage called Platform Keystore(PKS)

2022-02-01 Thread Dave Hansen
On 1/21/22 16:56, Nayna Jain wrote: > Nayna Jain (2): > pseries: define driver for Platform Keystore > pseries: define sysfs interface to expose PKS variables Hi Folks, There another feature that we might want to consider in the naming here: >

[PATCH V5 21/21] KVM: compat: riscv: Prevent KVM_COMPAT from being selected

2022-02-01 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 Cc: Anup Patel --- virt/kvm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

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

2022-02-01 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 Cc: Palmer Dabbelt ---

[PATCH V5 19/21] riscv: compat: ptrace: Add compat_arch_ptrace implement

2022-02-01 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 V5 18/21] riscv: compat: signal: Add rt_frame implementation

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

[PATCH V5 17/21] riscv: compat: vdso: Add setup additional pages implementation

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

[PATCH V5 16/21] riscv: compat: vdso: Add rv32 VDSO base code implementation

2022-02-01 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 V5 15/21] riscv: compat: Add hw capability check for elf

2022-02-01 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 Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Arnd Bergmann Cc: Christoph Hellwig --- arch/riscv/include/asm/elf.h |

[PATCH V5 14/21] riscv: compat: Add elf.h implementation

2022-02-01 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 | 46 +++- 1 file changed, 45 insertions(+), 1

[PATCH V5 13/21] riscv: compat: process: Add UXL_32 support in start_thread

2022-02-01 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 V5 12/21] riscv: compat: syscall: Add entry.S implementation

2022-02-01 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 Cc: Palmer Dabbelt ---

[PATCH V5 11/21] riscv: compat: syscall: Add compat_sys_call_table implementation

2022-02-01 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 Cc: Palmer Dabbelt

[PATCH V5 10/21] riscv: compat: Re-implement TASK_SIZE for COMPAT_32BIT

2022-02-01 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 V5 09/21] riscv: compat: Add basic compat data type implementation

2022-02-01 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 Cc: Arnd Bergmann Cc: Palmer Dabbelt ---

[PATCH V5 08/21] riscv: Fixup difference with defconfig

2022-02-01 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 V5 07/21] syscalls: compat: Fix the missing part for __SYSCALL_COMPAT

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

[PATCH V5 06/21] asm-generic: compat: Cleanup duplicate definitions

2022-02-01 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 V5 05/21] fs: stat: compat: Add __ARCH_WANT_COMPAT_STAT

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

[PATCH V5 04/21] kconfig: Add SYSVIPC_COMPAT for all architectures

2022-02-01 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 Cc: Palmer Dabbelt --- arch/arm64/Kconfig | 4

[PATCH V5 03/21] compat: consolidate the compat_flock{, 64} definition

2022-02-01 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 V5 02/21] uapi: always define F_GETLK64/F_SETLK64/F_SETLKW64 in fcntl.h

2022-02-01 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 V5 01/21] uapi: simplify __ARCH_FLOCK{,64}_PAD a little

2022-02-01 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 V5 00/21] riscv: compat: Add COMPAT mode support for rv64

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

Re: [PATCH v7 0/5] Allow guest access to EFI confidential computing secret area

2022-02-01 Thread James Bottomley
On Tue, 2022-02-01 at 15:41 +0100, Greg KH wrote: > On Tue, Feb 01, 2022 at 09:24:50AM -0500, James Bottomley wrote: > > [cc's added] > > On Tue, 2022-02-01 at 14:50 +0100, Greg KH wrote: [...] > > > You all need to work together to come up with a unified place for > > > this and stop making it

Re: [PATCH v7 0/5] Allow guest access to EFI confidential computing secret area

2022-02-01 Thread Greg KH
On Tue, Feb 01, 2022 at 09:24:50AM -0500, James Bottomley wrote: > [cc's added] > On Tue, 2022-02-01 at 14:50 +0100, Greg KH wrote: > > On Tue, Feb 01, 2022 at 12:44:08PM +, Dov Murik wrote: > [...] > > > # ls -la /sys/kernel/security/coco/efi_secret > > > total 0 > > > drwxr-xr-x 2 root root

Re: [PATCH v7 0/5] Allow guest access to EFI confidential computing secret area

2022-02-01 Thread James Bottomley
[cc's added] On Tue, 2022-02-01 at 14:50 +0100, Greg KH wrote: > On Tue, Feb 01, 2022 at 12:44:08PM +, Dov Murik wrote: [...] > > # ls -la /sys/kernel/security/coco/efi_secret > > total 0 > > drwxr-xr-x 2 root root 0 Jun 28 11:55 . > > drwxr-xr-x 3 root root 0 Jun 28 11:54 .. > > -r--r- 1

Re: [PATCH V4 16/17] riscv: compat: Add COMPAT Kbuild skeletal support

2022-02-01 Thread Guo Ren
On Tue, Feb 1, 2022 at 7:48 PM Arnd Bergmann wrote: > > On Tue, Feb 1, 2022 at 11:26 AM Guo Ren wrote: > > > > Hi Arnd & Christoph, > > > > The UXL field controls the value of XLEN for U-mode, termed UXLEN, > > which may differ from the > > value of XLEN for S-mode, termed SXLEN. The encoding of

Re: [RFC PATCH 0/2] powerpc/pseries: add support for local secure storage called Platform Keystore(PKS)

2022-02-01 Thread Greg KH
On Mon, Jan 24, 2022 at 11:25:17AM +1100, Daniel Axtens wrote: > Hi Greg, > > > Ok, this is like the 3rd or 4th different platform-specific proposal for > > this type of functionality. I think we need to give up on > > platform-specific user/kernel apis on this (random sysfs/securityfs > > files

Re: [PATCH] powerpc/xive: Add some error handling code to 'xive_spapr_init()'

2022-02-01 Thread Christophe Leroy
Le 01/02/2022 à 13:32, Christophe JAILLET a écrit : > Le 01/02/2022 à 12:31, Christophe Leroy a écrit : >> Hi, >> >> Le 01/08/2019 à 13:09, Christophe JAILLET a écrit : >>> 'xive_irq_bitmap_add()' can return -ENOMEM. >>> In this case, we should free the memory already allocated and return >>>

Re: [PATCH v2] powerpc/xive: Add some error handling code to 'xive_spapr_init()'

2022-02-01 Thread Cédric Le Goater
On 2/1/22 13:31, Christophe JAILLET wrote: 'xive_irq_bitmap_add()' can return -ENOMEM. In this case, we should free the memory already allocated and return 'false' to the caller. Also add an error path which undoes the 'tima = ioremap(...)' Signed-off-by: Christophe JAILLET Reviewed-by:

Re: [PATCH] powerpc/xive: Add some error handling code to 'xive_spapr_init()'

2022-02-01 Thread Christophe JAILLET
Le 01/02/2022 à 12:31, Christophe Leroy a écrit : Hi, Le 01/08/2019 à 13:09, Christophe JAILLET a écrit : 'xive_irq_bitmap_add()' can return -ENOMEM. In this case, we should free the memory already allocated and return 'false' to the caller. Also add an error path which undoes the 'tima =

[PATCH v2] powerpc/xive: Add some error handling code to 'xive_spapr_init()'

2022-02-01 Thread Christophe JAILLET
'xive_irq_bitmap_add()' can return -ENOMEM. In this case, we should free the memory already allocated and return 'false' to the caller. Also add an error path which undoes the 'tima = ioremap(...)' Signed-off-by: Christophe JAILLET --- NOT compile tested (I don't have a cross compiler and won't

Re: [PATCH] powerpc/kasan: Fix early region not updated correctly

2022-02-01 Thread Christophe Leroy
Le 29/12/2021 à 04:52, Chen Jingwen a écrit : > The shadow's page table is not updated when PTE_RPN_SHIFT is 24 > and PAGE_SHIFT is 12. It not only causes false positives but > also false negative as shown the following text. > > Fix it by bringing the logic of kasan_early_shadow_page_entry

Re: [PATCH] powerpc/ptdump: Fix sparse warning in hashpagetable.c

2022-02-01 Thread Michael Ellerman
Christophe Leroy writes: > arch/powerpc/mm/ptdump/hashpagetable.c:264:29: warning: restricted __be64 > degrades to integer > arch/powerpc/mm/ptdump/hashpagetable.c:265:49: warning: restricted __be64 > degrades to integer > arch/powerpc/mm/ptdump/hashpagetable.c:267:36: warning: incorrect

Re: microwatt booting linux-5.7 under verilator

2022-02-01 Thread Luke Kenneth Casson Leighton
On Tue, Feb 1, 2022 at 11:53 AM Michael Ellerman wrote: > If you build with CONFIG_RELOCATABLE=y and CONFIG_RELOCATABLE_TEST=y the > kernel will run wherever you load it (must be 64K aligned), without > copying itself down to zero first. That will save you a few cycles. ahh, thank you :) l.

Re: [Oops][next-20220128] 5.17.0-rc1 kernel panics on my powerpc box

2022-02-01 Thread Michael Ellerman
Andy Shevchenko writes: > On Mon, Jan 31, 2022 at 12:30:14PM +0530, Abdul Haleem wrote: >> Greeting's >> >> Today's linux-next kernel failed to boot 5.17.0-rc1-next-20220128 with >> kernel Oops on PowerVM LPAR >> >> dmesg: >> Started hybrid virtual network scan and config. >> Started VDO

Re: [PATCH v3] powerpc: Fix virt_addr_valid() check

2022-02-01 Thread Christophe Leroy
Le 27/01/2022 à 13:37, Kefeng Wang a écrit : > When run ethtool eth0 on PowerPC64, the BUG occurred, > >usercopy: Kernel memory exposure attempt detected from SLUB object not in > SLUB page?! (offset 0, size 1048)! >kernel BUG at mm/usercopy.c:99 >... >usercopy_abort+0x64/0xa0

Re: microwatt booting linux-5.7 under verilator

2022-02-01 Thread Michael Ellerman
Nicholas Piggin writes: > Excerpts from lkcl's message of January 31, 2022 2:19 pm: >> >> On January 31, 2022 3:31:41 AM UTC, Nicholas Piggin >> wrote: >>>Hi Luke, >>> >>>Interesting to read about the project, thanks for the post. >> >> no problem. it's been i think 18 years since i last did

Re: [PATCH V4 16/17] riscv: compat: Add COMPAT Kbuild skeletal support

2022-02-01 Thread Arnd Bergmann
On Tue, Feb 1, 2022 at 11:26 AM Guo Ren wrote: > > Hi Arnd & Christoph, > > The UXL field controls the value of XLEN for U-mode, termed UXLEN, > which may differ from the > value of XLEN for S-mode, termed SXLEN. The encoding of UXL is the > same as that of the MXL > field of misa, shown in Table

Re: powerpc: Set crashkernel offset to mid of RMA region

2022-02-01 Thread Michael Ellerman
Sourabh Jain writes: > On large config LPARs (having 192 and more cores), Linux fails to boot > due to insufficient memory in the first memblock. It is due to the > memory reservation for the crash kernel which starts at 128MB offset of > the first memblock. This memory reservation for the crash

Re: [PATCH] powerpc/xive: Add some error handling code to 'xive_spapr_init()'

2022-02-01 Thread Christophe Leroy
Hi, Le 01/08/2019 à 13:09, Christophe JAILLET a écrit : 'xive_irq_bitmap_add()' can return -ENOMEM. In this case, we should free the memory already allocated and return 'false' to the caller. Also add an error path which undoes the 'tima = ioremap(...)' This old patch doesn't apply, if it is

Re: [PATCH 1/2] powerpc: reserve memory for capture kernel after hugepages init

2022-02-01 Thread Christophe Leroy
Le 27/06/2019 à 21:21, Hari Bathini a écrit : Sometimes, memory reservation for KDump/FADump can overlap with memory marked for hugepages. This overlap leads to error, hang in KDump case and copy error reported by f/w in case of FADump, while trying to capture dump. Report error while setting

Re: consolidate the compat fcntl definitions v2

2022-02-01 Thread Christophe Leroy
Hi Christoph, Le 31/01/2022 à 07:49, Christoph Hellwig a écrit : > Hi all, > > currenty the compat fcnt definitions are duplicate for all compat > architectures, and the native fcntl64 definitions aren't even usable > from userspace due to a bogus CONFIG_64BIT ifdef. This series tries > to sort

Re: microwatt booting linux-5.7 under verilator

2022-02-01 Thread Luke Kenneth Casson Leighton
On Tue, Feb 1, 2022 at 6:27 AM Nicholas Piggin wrote: > Not sure of the details on that. Is it memcpy()ing out of ROM or RAM to > RAM? Is this in the arch boot code? (I don't know very well). RAM to RAM. arch/powerpc/boot/main.c: if (uncompressed_image) { memcpy(addr, vmlinuz_addr

Re: powerpc: Set crashkernel offset to mid of RMA region

2022-02-01 Thread Hari Bathini
On 28/01/22 3:34 pm, Sourabh Jain wrote: On large config LPARs (having 192 and more cores), Linux fails to boot due to insufficient memory in the first memblock. It is due to the memory reservation for the crash kernel which starts at 128MB offset of the first memblock. This memory

[RESEND PATCH v2] powerpc/fadump: register for fadump as early as possible

2022-02-01 Thread Hari Bathini
Crash recovery (fadump) is setup in the userspace by some service. This service rebuilds initrd with dump capture capability, if it is not already dump capture capable before proceeding to register for firmware assisted dump (echo 1 > /sys/kernel/fadump/registered). But arming the kernel with

Re: [PATCH V4 16/17] riscv: compat: Add COMPAT Kbuild skeletal support

2022-02-01 Thread Guo Ren
Hi Arnd & Christoph, The UXL field controls the value of XLEN for U-mode, termed UXLEN, which may differ from the value of XLEN for S-mode, termed SXLEN. The encoding of UXL is the same as that of the MXL field of misa, shown in Table 3.1. Here is the patch. (We needn't exception helper, because

Re: [PATCH RFC v1] drivers/base/node: consolidate node device subsystem initialization in node_dev_init()

2022-02-01 Thread David Hildenbrand
On 31.01.22 10:40, Oscar Salvador wrote: > On Mon, Jan 31, 2022 at 08:48:54AM +0100, David Hildenbrand wrote: >> Hi Oscar, > > Hi David :-), > >> Right, and the idea is that the online state of nodes (+ node/zone >> ranges) already has to be known at that point in time, because >> otherwise,

Re: [PATCH RFC v1] drivers/base/node: consolidate node device subsystem initialization in node_dev_init()

2022-02-01 Thread Anatoly Pugachev
On Mon, Jan 31, 2022 at 2:11 PM David Hildenbrand wrote: > > ... and call node_dev_init() after memory_dev_init() from driver_init(), > so before any of the existing arch/subsys calls. All online nodes should > be known at that point. > > This is in line with memory_dev_init(), which initializes

Re: [PATCH V4 16/17] riscv: compat: Add COMPAT Kbuild skeletal support

2022-02-01 Thread Arnd Bergmann
On Tue, Feb 1, 2022 at 10:13 AM Guo Ren wrote: > On Tue, Feb 1, 2022 at 3:45 PM Christoph Hellwig wrote: > > On Mon, Jan 31, 2022 at 09:50:58PM +0800, Guo Ren wrote: > > > On Mon, Jan 31, 2022 at 8:26 PM Christoph Hellwig > > > wrote: > > > > > > > > Given that most rv64 implementations can't

Re: Build regressions/improvements in v5.17-rc2

2022-02-01 Thread Geert Uytterhoeven
On Mon, 31 Jan 2022, Geert Uytterhoeven wrote: JFYI, when comparing v5.17-rc2[1] to v5.17-rc1[3], the summaries are: - build errors: +1/-3 + error: arch/powerpc/kvm/book3s_64_entry.o: relocation truncated to fit: R_PPC64_REL14 (stub) against symbol `system_reset_common' defined in .text

Re: [PATCH V4 16/17] riscv: compat: Add COMPAT Kbuild skeletal support

2022-02-01 Thread Guo Ren
On Tue, Feb 1, 2022 at 3:45 PM Christoph Hellwig wrote: > > On Mon, Jan 31, 2022 at 09:50:58PM +0800, Guo Ren wrote: > > On Mon, Jan 31, 2022 at 8:26 PM Christoph Hellwig > > wrote: > > > > > > Given that most rv64 implementations can't run in rv32 mode, what is the > > > failure mode if