[PATCH] powerpc/pseries/vas: Hold mmap_mutex after mmap lock during window close

2023-06-22 Thread Haren Myneni
VAS mmap (coproc_mmap()) and its fault handler (vas_mmap_fault()) are called after holding mmap lock and acquire mmap_mutex to update VAS window status. The migration / DLPAR window close can hang while trying to acquire mmap lock if it is issued at the same time with the user space ioctl mmap or V

Re: [6.4-rc6] Crash during a kexec operation (tpm_amd_is_rng_defective)

2023-06-22 Thread Linux regression tracking (Thorsten Leemhuis)
Hi, Thorsten here, the Linux kernel's regression tracker. Top-posting for once, to make this easily accessible to everyone. As Linus will likely release 6.4 on this or the following Sunday a quick question: is there any hope this regression might be fixed any time soon? Doesn't look like it, as it

Re: [6.4.0-rc7-next-20230620] Boot failure on IBM Power LPAR

2023-06-22 Thread Sachin Sant
>> The problem was introduced in 6.4.0-rc7-next-20230619. I tried git bisect, >> but unsure of the >> result reported by it. Bisect points to following patch >> >> # git bisect bad >> 70c94cc2eefd4f98d222834cbe7512804977c2d4 is the first bad commit >> commit 70c94cc2eefd4f98d222834cbe7512804977

Re: [PATCH] powerpc: Move arch_trigger_cpumask_backtrace from nmi.h to irq.h

2023-06-22 Thread Petr Mladek
On Wed 2023-06-21 16:48:19, Douglas Anderson wrote: > The powerpc architecture was the only one that defined > arch_trigger_cpumask_backtrace() in asm/nmi.h instead of > asm/irq.h. Move it to be consistent. > > This fixes compile time errors introduced by commit 7ca8fe94aa92 > ("watchdog/hardlocku

Re: [PATCH 01/10] cpu/SMT: Move SMT prototypes into cpu_smt.h

2023-06-22 Thread Thomas Gleixner
On Thu, Jun 15 2023 at 17:46, Laurent Dufour wrote: > From: Michael Ellerman > > A subsequent patch would like to use the cpuhp_smt_control enum as part > of the interface between generic and arch code. This still has the 'patch' and 'arch' style which I pointed out before. It seems you fixed it

Re: [PATCH 07/10] cpu/SMT: Allow enabling partial SMT states via sysfs

2023-06-22 Thread Thomas Gleixner
On Thu, Jun 15 2023 at 17:46, Laurent Dufour wrote: > > - if (ctrlval != cpu_smt_control) { > + orig_threads = cpu_smt_num_threads; > + cpu_smt_num_threads = num_threads; > + > + if (num_threads > orig_threads) { > + ret = cpuhp_smt_enable(); > + } else if (num_thr

[PATCH v2] powerpc/ptrace: Split gpr32_set_common

2023-06-22 Thread Christophe Leroy
objtool report the following warning: arch/powerpc/kernel/ptrace/ptrace-view.o: warning: objtool: gpr32_set_common+0x23c (.text+0x860): redundant UACCESS disable gpr32_set_common() conditionnaly opens and closes UACCESS based on whether kbuf point is NULL or not. This is wackelig. Split gp

[PATCH v2 01/14] powerpc/kuap: Avoid unnecessary reads of MD_AP

2023-06-22 Thread Christophe Leroy
A disassembly of interrupt_exit_kernel_prepare() shows a useless read of MD_AP register. This is shown by r9 being re-used immediately without doing anything with the value read. c000e0e0: 60 00 00 00 nop c000e0e4: ===> 7d 3a c2 a6 mfmd_ap r9< c000e0e8: 7d 20 00

[PATCH v2 00/14] powerpc/objtool: uaccess validation for PPC32 (v2)

2023-06-22 Thread Christophe Leroy
This series adds UACCESS validation for PPC32. It includes half a dozen of changes to objtool core. It is almost mature, performs code analysis for all PPC32, only missing marking of UACCESS enable/disable for book3s/32. Most object files are correctly decoded, only a few 'unreachable instruction

[PATCH v2 02/14] powerpc/kuap: Avoid useless jump_label on empty function

2023-06-22 Thread Christophe Leroy
Disassembly of interrupt_enter_prepare() shows a pointless nop before the mftb c000abf0 : c000abf0: 81 23 00 84 lwz r9,132(r3) c000abf4: 71 29 40 00 andi. r9,r9,16384 c000abf8: 41 82 00 28 beq-c000ac20 c000abfc: ===> 60 00 00 00 nop <

[PATCH v2 07/14] objtool: Allow an architecture to disable objtool on ASM files

2023-06-22 Thread Christophe Leroy
Supporting objtool on ASM files requires quite an effort. Features like UACCESS validation don't require ASM files validation. In order to allow architectures to enable objtool validation without spending unnecessary effort on cleaning up ASM files, provide an option to disable objtool validation

[PATCH v2 06/14] Revert "powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto"

2023-06-22 Thread Christophe Leroy
This reverts commit 1e688dd2a3d6759d416616ff07afc4bb836c4213. That commit aimed at optimising the code around generation of WARN_ON/BUG_ON but this leads to a lot of dead code erroneously generated by GCC. That dead code becomes a problem when we start using objtool validation because objtool wil

[PATCH v2 08/14] objtool: Fix JUMP_ENTRY_SIZE for bi-arch like powerpc

2023-06-22 Thread Christophe Leroy
struct jump_entry { s32 code; s32 target; long key; }; It means that the size of the third argument depends on whether we are building a 32 bits or 64 bits kernel. Therefore JUMP_ENTRY_SIZE must depend on elf_class_addrsize(elf). To

[PATCH v2 04/14] powerpc/kuap: Make disabling KUAP at boottime impossible except on book3s/64

2023-06-22 Thread Christophe Leroy
It is possible to disable KUAP at boottime with 'nosmap' parameter. That is implemented with jump_label hence adds a 'nop' in front of each open/close of userspace access. >From a security point of view it makes sence to disallow disabling KUAP. And on processors like the 8xx where 'nop' is not s

[PATCH v2 05/14] powerpc/kuap: KUAP enabling/disabling functions must be __always_inline

2023-06-22 Thread Christophe Leroy
Objtool reports following warnings: arch/powerpc/kernel/signal_32.o: warning: objtool: __prevent_user_access.constprop.0+0x4 (.text+0x4): redundant UACCESS disable arch/powerpc/kernel/signal_32.o: warning: objtool: user_access_begin+0x2c (.text+0x4c): return with UACCESS enabled

[PATCH v2 09/14] objtool: Add INSN_RETURN_CONDITIONAL

2023-06-22 Thread Christophe Leroy
Most functions have an unconditional return at the end, like this one: : 0: 81 22 04 d0 lwz r9,1232(r2) 4: 38 60 00 00 li r3,0 8: 2c 09 00 00 cmpwi r9,0 c: 4d 82 00 20 beqlr <== Conditional re

[PATCH v2 03/14] powerpc/kuap: Refactor static branch for disabling kuap

2023-06-22 Thread Christophe Leroy
All but book3s/64 use a static branch key for disabling kuap. book3s/64 uses a memory feature. Refactor all targets except book3s/64. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/kup.h | 7 --- arch/powerpc/include/asm/book3s/64/kup.h | 1 + arch/powerpc/

[PATCH v2 10/14] objtool: Add support for relative switch tables

2023-06-22 Thread Christophe Leroy
On powerpc, switch tables are relative, than means the address of the table is added to the value of the entry in order to get the pointed address: (r10 is the table address, r4 the index in the table) lis r10,0 <== Load r10 with upper part of .rodata address R_PPC_

[PATCH v2 11/14] objtool: Remove too strict constraint in jump table search

2023-06-22 Thread Christophe Leroy
In code there is often a pattern like: load jump table address do some test conditional jump to label1: do something unconditional jump to label2: label1: do something else read jump table dynamic jump label2: do other job her

[PATCH v2 12/14] objtool: Add support for more complex UACCESS control

2023-06-22 Thread Christophe Leroy
On x86, UACCESS is controlled by two instructions: STAC and CLAC. STAC instruction enables UACCESS while CLAC disables UACCESS. This is simple enough for objtool to locate UACCESS enable and disable. But on powerpc it is a bit more complex, the same instruction is used for enabling and disabling U

[PATCH v2 14/14] powerpc: Implement UACCESS validation on PPC32

2023-06-22 Thread Christophe Leroy
In order to implement UACCESS validation, objtool support for powerpc needs to be enhanced to decode more instructions. It also requires implementation of switch tables finding. On PPC32 it is similar to x86, switch tables are anonymous in .rodata, the difference is that the value is relative to i

[PATCH v2 13/14] powerpc/bug: Annotate reachable after warning trap

2023-06-22 Thread Christophe Leroy
This commit is copied from commit bfb1a7c91fb7 ("x86/bug: Merge annotate_reachable() into _BUG_FLAGS() asm") 'twi 31,0,0' is a BUG instruction, which is by default a dead end. But the same instruction is used for WARNINGs and the execution resumes with the following instruction. Mark it reachable

[PATCH] powerpc/64e: Fix obtool warnings in exceptions-64e.S

2023-06-22 Thread Michael Ellerman
Since commit aec0ba7472a7 ("powerpc/64: Use -mprofile-kernel for big endian ELFv2 kernels"), this file is checked by objtool. Fix warnings such as: arch/powerpc/kernel/idle_64e.o: warning: objtool: .text+0x20: unannotated intra-function call arch/powerpc/kernel/exceptions-64e.o: warning: objt

Re: [PATCH 01/79] fs: add ctime accessors infrastructure

2023-06-22 Thread Jeff Layton
On Thu, 2023-06-22 at 09:46 +0900, Damien Le Moal wrote: > On 6/21/23 23:45, Jeff Layton wrote: > > struct timespec64 has unused bits in the tv_nsec field that can be used > > for other purposes. In future patches, we're going to change how the > > inode->i_ctime is accessed in certain inodes in or

Re: [PATCH v2 08/14] objtool: Fix JUMP_ENTRY_SIZE for bi-arch like powerpc

2023-06-22 Thread Peter Zijlstra
On Thu, Jun 22, 2023 at 12:54:30PM +0200, Christophe Leroy wrote: > struct jump_entry { > s32 code; > s32 target; > long key; > }; > > It means that the size of the third argument depends on > whether we are building a 32 bits or 64 bits kernel

Re: [PATCH v2 09/14] objtool: Add INSN_RETURN_CONDITIONAL

2023-06-22 Thread Peter Zijlstra
On Thu, Jun 22, 2023 at 12:54:31PM +0200, Christophe Leroy wrote: > Most functions have an unconditional return at the end, like > this one: > > : > 0: 81 22 04 d0 lwz r9,1232(r2) > 4: 38 60 00 00 li r3,0 > 8: 2c 09 00 00 cmpwi

Re: [PATCH v2 10/14] objtool: Add support for relative switch tables

2023-06-22 Thread Peter Zijlstra
On Thu, Jun 22, 2023 at 12:54:32PM +0200, Christophe Leroy wrote: > On powerpc, switch tables are relative, than means the address of the > table is added to the value of the entry in order to get the pointed > address: (r10 is the table address, r4 the index in the table) > > lis r10,0

Re: [PATCH v2 11/14] objtool: Remove too strict constraint in jump table search

2023-06-22 Thread Peter Zijlstra
On Thu, Jun 22, 2023 at 12:54:33PM +0200, Christophe Leroy wrote: > In code there is often a pattern like: > > load jump table address > do some test > conditional jump to label1: > do something > unconditional jump to label2: > label1: > do something else >

Re: [PATCH v2 12/14] objtool: Add support for more complex UACCESS control

2023-06-22 Thread Peter Zijlstra
On Thu, Jun 22, 2023 at 12:54:34PM +0200, Christophe Leroy wrote: > On x86, UACCESS is controlled by two instructions: STAC and CLAC. > STAC instruction enables UACCESS while CLAC disables UACCESS. > This is simple enough for objtool to locate UACCESS enable and > disable. > > But on powerpc it is

Re: [PATCH v2 14/14] powerpc: Implement UACCESS validation on PPC32

2023-06-22 Thread Peter Zijlstra
On Thu, Jun 22, 2023 at 12:54:36PM +0200, Christophe Leroy wrote: > diff --git a/tools/objtool/check.c b/tools/objtool/check.c > index f850ab892ad5..8ac5711a055f 100644 > --- a/tools/objtool/check.c > +++ b/tools/objtool/check.c > @@ -218,6 +218,7 @@ static bool __dead_end_function(struct objtool_

[GIT PULL] Please pull powerpc/linux.git powerpc-6.4-5 tag

2023-06-22 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Linus, Please pull one more powerpc fix for 6.4: The following change since commit 719dfd5925e186e09a2a6f23016936ac436f3d78: powerpc/xmon: Use KSYM_NAME_LEN in array size (2023-05-30 16:46:56 +1000) is available in the git repository at:

Re: [PATCH] powerpc/64e: Fix obtool warnings in exceptions-64e.S

2023-06-22 Thread Christophe Leroy
Le 22/06/2023 à 13:24, Michael Ellerman a écrit : > Since commit aec0ba7472a7 ("powerpc/64: Use -mprofile-kernel for big > endian ELFv2 kernels"), this file is checked by objtool. Fix warnings > such as: > >arch/powerpc/kernel/idle_64e.o: warning: objtool: .text+0x20: unannotated > intra-fu

Re: [PATCH 07/10] cpu/SMT: Allow enabling partial SMT states via sysfs

2023-06-22 Thread Michael Ellerman
Thomas Gleixner writes: > On Thu, Jun 15 2023 at 17:46, Laurent Dufour wrote: >> >> -if (ctrlval != cpu_smt_control) { >> +orig_threads = cpu_smt_num_threads; >> +cpu_smt_num_threads = num_threads; >> + >> +if (num_threads > orig_threads) { >> +ret = cpuhp_smt_enable(

Re: [6.4-rc6] Crash during a kexec operation (tpm_amd_is_rng_defective)

2023-06-22 Thread Michael Ellerman
"Linux regression tracking (Thorsten Leemhuis)" writes: > Hi, Thorsten here, the Linux kernel's regression tracker. Top-posting > for once, to make this easily accessible to everyone. > > As Linus will likely release 6.4 on this or the following Sunday a quick > question: is there any hope this r

Bad linux-next merge? (was Re: [6.4.0-rc7-next-20230620] Boot failure on IBM Power LPAR)

2023-06-22 Thread Michael Ellerman
Sachin Sant writes: >>> The problem was introduced in 6.4.0-rc7-next-20230619. I tried git bisect, >>> but unsure of the >>> result reported by it. Bisect points to following patch >>> >>> # git bisect bad >>> 70c94cc2eefd4f98d222834cbe7512804977c2d4 is the first bad commit >>> commit 70c94cc2ee

Re: [PATCH v2 0/2] send tlb_remove_table_smp_sync IPI only to necessary CPUs

2023-06-22 Thread ypodemsk
On Wed, 2023-06-21 at 09:43 +0200, Peter Zijlstra wrote: > On Tue, Jun 20, 2023 at 05:46:16PM +0300, Yair Podemsky wrote: > > Currently the tlb_remove_table_smp_sync IPI is sent to all CPUs > > indiscriminately, this causes unnecessary work and delays notable > > in > > real-time use-cases and isol

Re: [PATCH v2 2/2] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to MM CPUs

2023-06-22 Thread ypodemsk
On Wed, 2023-06-21 at 10:42 -0700, Dave Hansen wrote: > On 6/20/23 07:46, Yair Podemsky wrote: > > -void tlb_remove_table_sync_one(void) > > +#ifdef CONFIG_ARCH_HAS_CPUMASK_BITS > > +#define REMOVE_TABLE_IPI_MASK mm_cpumask(mm) > > +#else > > +#define REMOVE_TABLE_IPI_MASK cpu_online_mask > > +#end

Re: [PATCH v2 2/2] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to MM CPUs

2023-06-22 Thread Dave Hansen
On 6/22/23 06:14, ypode...@redhat.com wrote: > I will send a new version with the local variable as you suggested > soon. > As for the config name, what about CONFIG_ARCH_HAS_MM_CPUMASK? The confusing part about that name is that mm_cpumask() and mm->cpu_bitmap[] are defined unconditionally. So,

Re: [PATCH v2 0/2] send tlb_remove_table_smp_sync IPI only to necessary CPUs

2023-06-22 Thread Marcelo Tosatti
On Wed, Jun 21, 2023 at 09:43:37AM +0200, Peter Zijlstra wrote: > On Tue, Jun 20, 2023 at 05:46:16PM +0300, Yair Podemsky wrote: > > Currently the tlb_remove_table_smp_sync IPI is sent to all CPUs > > indiscriminately, this causes unnecessary work and delays notable in > > real-time use-cases and i

Re: [PATCH v2 2/2] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to MM CPUs

2023-06-22 Thread ypodemsk
On Wed, 2023-06-21 at 11:02 -0700, Nadav Amit wrote: > > On Jun 20, 2023, at 7:46 AM, Yair Podemsky > > wrote: > > > > @@ -1525,7 +1525,7 @@ static void collapse_and_free_pmd(struct > > mm_struct *mm, struct vm_area_struct *v > > addr + HPAGE_PMD_SIZE); > > mmu_not

Re: [PATCH 11/14] init: consolidate prototypes in linux/init.h

2023-06-22 Thread Palmer Dabbelt
On Wed, 17 May 2023 06:10:59 PDT (-0700), a...@kernel.org wrote: From: Arnd Bergmann The init/main.c file contains some extern declarations for functions defined in architecture code, and it defines some other functions that are called from architecture code with a custom prototype. Both of tho

Re: [PATCH] powerpc: Move arch_trigger_cpumask_backtrace from nmi.h to irq.h

2023-06-22 Thread Andrew Morton
On Thu, 22 Jun 2023 10:40:11 +0200 Petr Mladek wrote: > On Wed 2023-06-21 16:48:19, Douglas Anderson wrote: > > The powerpc architecture was the only one that defined > > arch_trigger_cpumask_backtrace() in asm/nmi.h instead of > > asm/irq.h. Move it to be consistent. > > > > This fixes compile

Re: [PATCH v2 14/14] powerpc: Implement UACCESS validation on PPC32

2023-06-22 Thread kernel test robot
Hi Christophe, kernel test robot noticed the following build warnings: [auto build test WARNING on powerpc/next] [also build test WARNING on powerpc/fixes masahiroy-kbuild/for-next masahiroy-kbuild/fixes linus/master v6.4-rc7] [cannot apply to next-20230622] [If your patch is applied to the

Re: [PATCH v2 14/14] powerpc: Implement UACCESS validation on PPC32

2023-06-22 Thread kernel test robot
Hi Christophe, kernel test robot noticed the following build warnings: [auto build test WARNING on powerpc/next] [also build test WARNING on powerpc/fixes masahiroy-kbuild/for-next masahiroy-kbuild/fixes linus/master v6.4-rc7] [cannot apply to next-20230622] [If your patch is applied to the

[PATCH v5 01/33] mm: Add PAGE_TYPE_OP folio functions

2023-06-22 Thread Vishal Moola (Oracle)
No folio equivalents for page type operations have been defined, so define them for later folio conversions. Also changes the Page##uname macros to take in const struct page* since we only read the memory here. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- include/linu

[PATCH v5 00/33] Split ptdesc from struct page

2023-06-22 Thread Vishal Moola (Oracle)
The MM subsystem is trying to shrink struct page. This patchset introduces a memory descriptor for page table tracking - struct ptdesc. This patchset introduces ptdesc, splits ptdesc from struct page, and converts many callers of page table constructor/destructors to use ptdescs. Ptdesc is a foun

[PATCH v5 02/33] s390: Use _pt_s390_gaddr for gmap address tracking

2023-06-22 Thread Vishal Moola (Oracle)
s390 uses page->index to keep track of page tables for the guest address space. In an attempt to consolidate the usage of page fields in s390, replace _pt_pad_2 with _pt_s390_gaddr to replace page->index in gmap. Since page->_pt_s390_gaddr aliases with mapping, ensure its set to NULL before freein

[PATCH v5 03/33] pgtable: Create struct ptdesc

2023-06-22 Thread Vishal Moola (Oracle)
Currently, page table information is stored within struct page. As part of simplifying struct page, create struct ptdesc for page table information. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- include/linux/pgtable.h | 68 + 1 f

[PATCH v5 04/33] mm: add utility functions for ptdesc

2023-06-22 Thread Vishal Moola (Oracle)
Introduce utility functions setting the foundation for ptdescs. These will also assist in the splitting out of ptdesc from struct page. Functions that focus on the descriptor are prefixed with ptdesc_* while functions that focus on the pagetable are prefixed with pagetable_*. pagetable_alloc() is

[PATCH v5 05/33] mm: Convert pmd_pgtable_page() to pmd_ptdesc()

2023-06-22 Thread Vishal Moola (Oracle)
Converts pmd_pgtable_page() to pmd_ptdesc() and all its callers. This removes some direct accesses to struct page, working towards splitting out struct ptdesc from struct page. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- include/linux/mm.h | 8 1 file changed

[PATCH v5 06/33] mm: Convert ptlock_alloc() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
This removes some direct accesses to struct page, working towards splitting out struct ptdesc from struct page. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- include/linux/mm.h | 6 +++--- mm/memory.c| 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) di

[PATCH v5 07/33] mm: Convert ptlock_ptr() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
This removes some direct accesses to struct page, working towards splitting out struct ptdesc from struct page. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- arch/x86/xen/mmu_pv.c | 2 +- include/linux/mm.h| 14 +++--- 2 files changed, 8 insertions(+), 8 de

[PATCH v5 08/33] mm: Convert pmd_ptlock_init() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
This removes some direct accesses to struct page, working towards splitting out struct ptdesc from struct page. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- include/linux/mm.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/

[PATCH v5 09/33] mm: Convert ptlock_init() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
This removes some direct accesses to struct page, working towards splitting out struct ptdesc from struct page. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- include/linux/mm.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/li

[PATCH v5 10/33] mm: Convert pmd_ptlock_free() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
This removes some direct accesses to struct page, working towards splitting out struct ptdesc from struct page. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- include/linux/mm.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/

[PATCH v5 11/33] mm: Convert ptlock_free() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
This removes some direct accesses to struct page, working towards splitting out struct ptdesc from struct page. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- include/linux/mm.h | 10 +- mm/memory.c| 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(

[PATCH v5 12/33] mm: Create ptdesc equivalents for pgtable_{pte,pmd}_page_{ctor,dtor}

2023-06-22 Thread Vishal Moola (Oracle)
Create pagetable_pte_ctor(), pagetable_pmd_ctor(), pagetable_pte_dtor(), and pagetable_pmd_dtor() and make the original pgtable constructor/destructors wrappers. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- include/linux/mm.h | 56 ++

[PATCH v5 13/33] powerpc: Convert various functions to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
In order to split struct ptdesc from struct page, convert various functions to use ptdescs. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- arch/powerpc/mm/book3s64/mmu_context.c | 10 +++--- arch/powerpc/mm/book3s64/pgtable.c | 32 +- arch/powerpc/mm/

[PATCH v5 14/33] x86: Convert various functions to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
In order to split struct ptdesc from struct page, convert various functions to use ptdescs. Some of the functions use the *get*page*() helper functions. Convert these to use pagetable_alloc() and ptdesc_address() instead to help standardize page tables further. Signed-off-by: Vishal Moola (Oracle

[PATCH v5 15/33] s390: Convert various gmap functions to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
In order to split struct ptdesc from struct page, convert various functions to use ptdescs. Some of the functions use the *get*page*() helper functions. Convert these to use pagetable_alloc() and ptdesc_address() instead to help standardize page tables further. Since we're now using pagetable_fre

[PATCH v5 16/33] s390: Convert various pgalloc functions to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
As part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents, convert various page table functions to use ptdescs. Some of the functions use the *get*page*() helper functions. Convert these to use pagetable_alloc() and ptdesc_address() instead to help standardize p

[PATCH v5 17/33] mm: Remove page table members from struct page

2023-06-22 Thread Vishal Moola (Oracle)
The page table members are now split out into their own ptdesc struct. Remove them from struct page. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- include/linux/mm_types.h | 14 -- include/linux/pgtable.h | 3 --- 2 files changed, 17 deletions(-) diff --g

[PATCH v5 18/33] pgalloc: Convert various functions to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
As part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents, convert various page table functions to use ptdescs. Some of the functions use the *get*page*() helper functions. Convert these to use pagetable_alloc() and ptdesc_address() instead to help standardize p

[PATCH v5 19/33] arm: Convert various functions to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
As part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents, convert various page table functions to use ptdescs. late_alloc() also uses the __get_free_pages() helper function. Convert this to use pagetable_alloc() and ptdesc_address() instead to help standardize

[PATCH v5 20/33] arm64: Convert various functions to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
As part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents, convert various page table functions to use ptdescs. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) Acked-by: Catalin Marinas --- arch/arm64/include/asm/tlb.h | 14 --

[PATCH v5 21/33] csky: Convert __pte_free_tlb() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
Part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents. Signed-off-by: Vishal Moola (Oracle) Acked-by: Guo Ren Acked-by: Mike Rapoport (IBM) --- arch/csky/include/asm/pgalloc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/csky

[PATCH v5 22/33] hexagon: Convert __pte_free_tlb() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
Part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- arch/hexagon/include/asm/pgalloc.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/hexagon/include/

[PATCH v5 23/33] loongarch: Convert various functions to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
As part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents, convert various page table functions to use ptdescs. Some of the functions use the *get*page*() helper functions. Convert these to use pagetable_alloc() and ptdesc_address() instead to help standardize p

[PATCH v5 24/33] m68k: Convert various functions to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
As part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents, convert various page table functions to use ptdescs. Some of the functions use the *get*page*() helper functions. Convert these to use pagetable_alloc() and ptdesc_address() instead to help standardize p

[PATCH v5 25/33] mips: Convert various functions to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
As part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents, convert various page table functions to use ptdescs. Some of the functions use the *get*page*() helper functions. Convert these to use pagetable_alloc() and ptdesc_address() instead to help standardize p

[PATCH v5 26/33] nios2: Convert __pte_free_tlb() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
Part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- arch/nios2/include/asm/pgalloc.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/nios2/include/asm/

[PATCH v5 27/33] openrisc: Convert __pte_free_tlb() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
Part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- arch/openrisc/include/asm/pgalloc.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/openrisc/includ

[PATCH v5 28/33] riscv: Convert alloc_{pmd, pte}_late() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
As part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents, convert various page table functions to use ptdescs. Some of the functions use the *get*page*() helper functions. Convert these to use pagetable_alloc() and ptdesc_address() instead to help standardize p

[PATCH v5 29/33] sh: Convert pte_free_tlb() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
Part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents. Also cleans up some spacing issues. Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Geert Uytterhoeven Acked-by: John Paul Adrian Glaubitz Acked-by: Mike Rapoport (IBM) --- arch/sh/include/asm/pgallo

[PATCH v5 30/33] sparc64: Convert various functions to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
As part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents, convert various page table functions to use ptdescs. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- arch/sparc/mm/init_64.c | 17 + 1 file changed, 9 insertions

[PATCH v5 31/33] sparc: Convert pgtable_pte_page_{ctor, dtor}() to ptdesc equivalents

2023-06-22 Thread Vishal Moola (Oracle)
Part of the conversions to replace pgtable pte constructor/destructors with ptdesc equivalents. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- arch/sparc/mm/srmmu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/sparc/mm/srmmu.c b/arch/spar

[PATCH v5 32/33] um: Convert {pmd, pte}_free_tlb() to use ptdescs

2023-06-22 Thread Vishal Moola (Oracle)
Part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents. Also cleans up some spacing issues. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- arch/um/include/asm/pgalloc.h | 18 +- 1 file changed, 9 insertions(+), 9 deleti

[PATCH v5 33/33] mm: Remove pgtable_{pmd, pte}_page_{ctor, dtor}() wrappers

2023-06-22 Thread Vishal Moola (Oracle)
These functions are no longer necessary. Remove them and cleanup Documentation referencing them. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- Documentation/mm/split_page_table_lock.rst| 12 +-- .../zh_CN/mm/split_page_table_lock.rst| 14 ++--

Re: [PATCH 15/17] perf tests task_analyzer: fix bad substitution ${$1}

2023-06-22 Thread Namhyung Kim
Hello Aditya, On Wed, Jun 21, 2023 at 11:43 AM Aditya Gupta wrote: > > Hello Namhyung, > > On 21/06/23 20:53, Namhyung Kim wrote: > > Hello Aditya, > > > > On Wed, Jun 21, 2023 at 3:05 AM Aditya Gupta wrote: > >> Hello Namhyung, > >> > >> On 21/06/23 06:18, Namhyung Kim wrote: > >>> ... > >>> >

Re: [PATCH v5 26/33] nios2: Convert __pte_free_tlb() to use ptdescs

2023-06-22 Thread Dinh Nguyen
On 6/22/23 15:57, Vishal Moola (Oracle) wrote: Part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- arch/nios2/include/asm/pgalloc.h | 8 1 file changed, 4 insertions(+)

Re: [PATCH 15/17] perf tests task_analyzer: fix bad substitution ${$1}

2023-06-22 Thread Namhyung Kim
Ok, I found two problems. On Thu, Jun 22, 2023 at 2:33 PM Namhyung Kim wrote: > > Hello Aditya, > > On Wed, Jun 21, 2023 at 11:43 AM Aditya Gupta wrote: > > > > Hello Namhyung, > > > > On 21/06/23 20:53, Namhyung Kim wrote: > > > Hello Aditya, > > > > > > On Wed, Jun 21, 2023 at 3:05 AM Aditya G

Re: [PATCH] powerpc/64e: Fix obtool warnings in exceptions-64e.S

2023-06-22 Thread Michael Ellerman
Christophe Leroy writes: > Le 22/06/2023 à 13:24, Michael Ellerman a écrit : >> Since commit aec0ba7472a7 ("powerpc/64: Use -mprofile-kernel for big >> endian ELFv2 kernels"), this file is checked by objtool. Fix warnings >> such as: >> >>arch/powerpc/kernel/idle_64e.o: warning: objtool: .tex

Re: [6.4-rc6] Crash during a kexec operation (tpm_amd_is_rng_defective)

2023-06-22 Thread Limonciello, Mario
On 6/22/2023 7:36 AM, Michael Ellerman wrote: "Linux regression tracking (Thorsten Leemhuis)" writes: Hi, Thorsten here, the Linux kernel's regression tracker. Top-posting for once, to make this easily accessible to everyone. As Linus will likely release 6.4 on this or the following Sunday

Re: [PATCH v2 12/13] s390/kexec: refactor for kernel/Kconfig.kexec

2023-06-22 Thread Alexander Gordeev
On Wed, Jun 21, 2023 at 12:10:49PM -0500, Eric DeVolder wrote: Hi Eric, ... > > > NOTE: The original Kconfig has a KEXEC_SIG which depends on > > > MODULE_SIG_FORMAT. However, attempts to keep the MODULE_SIG_FORMAT > > > dependency (using the strategy outlined in this series, and other > > > techni

Re: [PATCH v2 12/13] s390/kexec: refactor for kernel/Kconfig.kexec

2023-06-22 Thread Eric DeVolder
On 6/22/23 11:24, Alexander Gordeev wrote: On Wed, Jun 21, 2023 at 12:10:49PM -0500, Eric DeVolder wrote: Hi Eric, ... NOTE: The original Kconfig has a KEXEC_SIG which depends on MODULE_SIG_FORMAT. However, attempts to keep the MODULE_SIG_FORMAT dependency (using the strategy outlined in this

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.4-5 tag

2023-06-22 Thread pr-tracker-bot
The pull request you sent on Thu, 22 Jun 2023 21:59:45 +1000: > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > tags/powerpc-6.4-5 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/e7758c0ddbc48fec149baea667d2abc85229a997 Thank you! -- Deet-doot-do

Re: [6.4-rc6] Crash during a kexec operation (tpm_amd_is_rng_defective)

2023-06-22 Thread Sachin Sant
> On 22-Jun-2023, at 8:08 PM, Limonciello, Mario > wrote: > > > On 6/22/2023 7:36 AM, Michael Ellerman wrote: >> "Linux regression tracking (Thorsten Leemhuis)" >> writes: >>> Hi, Thorsten here, the Linux kernel's regression tracker. Top-posting >>> for once, to make this easily accessible

[PATCH v2] powerpc: Move arch_trigger_cpumask_backtrace from nmi.h to irq.h

2023-06-22 Thread Douglas Anderson
The powerpc architecture was the only one that defined arch_trigger_cpumask_backtrace() in asm/nmi.h instead of asm/irq.h. Move it to be consistent. This fixes compile time errors introduced by commit 7ca8fe94aa92 ("watchdog/hardlockup: define HARDLOCKUP_DETECTOR_ARCH"). That commit caused to sto

Re: [PATCH v2 2/2] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to MM CPUs

2023-06-22 Thread Yang Shi
On Wed, Jun 21, 2023 at 11:02 AM Nadav Amit wrote: > > > > > On Jun 20, 2023, at 7:46 AM, Yair Podemsky wrote: > > > > @@ -1525,7 +1525,7 @@ static void collapse_and_free_pmd(struct mm_struct > > *mm, struct vm_area_struct *v > > addr + HPAGE_PMD_SIZE); > > mm

Re: [PATCH 01/17] powerpc/ftrace: Fix dropping weak symbols with older toolchains

2023-06-22 Thread Christophe Leroy
Le 19/06/2023 à 11:47, Naveen N Rao a écrit : > The minimum level of gcc supported for building the kernel is v5.1. > v5.x releases of gcc emitted a three instruction sequence for > -mprofile-kernel: > mflrr0 > std r0, 16(r1) > bl _mcount > > It is only with the v6

Re: [PATCH 02/17] powerpc/module: Remove unused .ftrace.tramp section

2023-06-22 Thread Christophe Leroy
Le 19/06/2023 à 11:47, Naveen N Rao a écrit : > .ftrace.tramp section is not used for any purpose. This code was added > all the way back in the original commit introducing support for dynamic > ftrace on ppc64 modules. Remove it. > > Signed-off-by: Naveen N Rao Reviewed-by: Christophe Leroy

Re: [PATCH 03/17] powerpc64/ftrace: Move ELFv1 and -pg support code into a separate file

2023-06-22 Thread Christophe Leroy
Le 19/06/2023 à 11:47, Naveen N Rao a écrit : > ELFv1 support is deprecated and on the way out. Pre -mprofile-kernel > ftrace support (-pg only) is very limited and is retained primarily for > clang builds. It won't be necessary once clang lands support for > -fpatchable-function-entry. > > Copy

Re: [PATCH 04/17] powerpc/ftrace: Simplify function_graph support in ftrace.c

2023-06-22 Thread Christophe Leroy
Le 19/06/2023 à 11:47, Naveen N Rao a écrit : > Since we now support DYNAMIC_FTRACE_WITH_ARGS across ppc32 and ppc64 > ELFv2, we can simplify function_graph tracer support code in ftrace.c > > Signed-off-by: Naveen N Rao Reviewed-by: Christophe Leroy > --- > arch/powerpc/kernel/trace/ftrac

Re: [PATCH 05/17] powerpc/ftrace: Use FTRACE_REGS_ADDR to identify the correct ftrace trampoline

2023-06-22 Thread Christophe Leroy
Le 19/06/2023 à 11:47, Naveen N Rao a écrit : > Instead of keying off DYNAMIC_FTRACE_WITH_REGS, use FTRACE_REGS_ADDR to > identify the proper ftrace trampoline address to use. > > Signed-off-by: Naveen N Rao Reviewed-by: Christophe Leroy > --- > arch/powerpc/kernel/trace/ftrace.c | 7 +

Re: [PATCH 06/17] powerpc/ftrace: Extend ftrace support for large kernels to ppc32

2023-06-22 Thread Christophe Leroy
Le 19/06/2023 à 11:47, Naveen N Rao a écrit : > Commit 67361cf8071286 ("powerpc/ftrace: Handle large kernel configs") > added ftrace support for ppc64 kernel images with a text section larger > than 32MB. The approach itself isn't specific to ppc64, so extend the > same to also work on ppc32. >

Re: [PATCH 07/17] powerpc/ftrace: Consolidate ftrace support into fewer files

2023-06-22 Thread Christophe Leroy
Le 19/06/2023 à 11:47, Naveen N Rao a écrit : > ftrace_low.S has just the _mcount stub and return_to_handler(). Merge > this back into ftrace_mprofile.S and ftrace_64_pg.S to keep all ftrace > code together, and to allow those to evolve independently. > > ftrace_mprofile.S is also not an entirel

Re: [PATCH 08/17] powerpc/ftrace: Refactor ftrace_modify_code()

2023-06-22 Thread Christophe Leroy
Le 19/06/2023 à 11:47, Naveen N Rao a écrit : > Split up ftrace_modify_code() into a few helpers for future use. Also > update error messages accordingly. > > Signed-off-by: Naveen N Rao Reviewed-by: Christophe Leroy > --- > arch/powerpc/kernel/trace/ftrace.c | 51 +

Re: [PATCH 09/17] powerpc/ftrace: Stop re-purposing linker generated long branches for ftrace

2023-06-22 Thread Christophe Leroy
Le 19/06/2023 à 11:47, Naveen N Rao a écrit : > Commit 67361cf8071286 ("powerpc/ftrace: Handle large kernel configs") > added ftrace support for ppc64 kernel images with a text section larger > than 32MB. The patch did two things: > 1. Add stubs at the end of .text to branch into ftrace_[regs_]ca

Re: [PATCH 10/17] powerpc/ftrace: Add separate ftrace_init_nop() with additional validation

2023-06-22 Thread Christophe Leroy
Le 19/06/2023 à 11:47, Naveen N Rao a écrit : > Currently, we validate instructions around the ftrace location every > time we have to enable/disable ftrace. Introduce ftrace_init_nop() to > instead perform all the validation during ftrace initialization. This > allows us to simply patch the nece

Re: [PATCH 11/17] powerpc/ftrace: Simplify ftrace_make_nop()

2023-06-22 Thread Christophe Leroy
Le 19/06/2023 à 11:47, Naveen N Rao a écrit : > Now that we validate the ftrace location during initialization in > ftrace_init_nop(), we can simplify ftrace_make_nop() to patch-in the nop > without worrying about the instructions surrounding the ftrace location. > Note that we continue to ensure

  1   2   >