Re: [PATCH 2/2] powerpc/{32,book3e}: kcsan: Extend KCSAN Support

2023-02-15 Thread Christophe Leroy
Le 16/02/2023 à 06:09, Rohan McLure a écrit : > Enable HAVE_ARCH_KCSAN on all powerpc platforms, permitting use of the > kernel concurrency sanitiser through the CONFIG_KCSAN_* kconfig options. > > Boots and passes selftests on 32-bit and 64-bit platforms. See > documentation in

Re: [PATCH 1/2] kcsan: xtensa: Add atomic builtin stubs for 32-bit systems

2023-02-15 Thread Christophe Leroy
Le 16/02/2023 à 06:09, Rohan McLure a écrit : > KCSAN instruments calls to atomic builtins, and will in turn call these > builtins itself. As such, architectures supporting KCSAN must have > compiler support for these atomic primitives. > > Since 32-bit systems are unlikely to have 64-bit

[PATCH] powerpc/pseries: Fix endianness issue when parsing PLPKS secvar flags

2023-02-15 Thread Andrew Donnellan
When a user updates a variable through the PLPKS secvar interface, we take the first 8 bytes of the data written to the update attribute to pass through to the H_PKS_SIGNED_UPDATE hcall as flags. These bytes are always written in big-endian format. Currently, the flags bytes are memcpy()ed into a

[powerpc:next] BUILD SUCCESS b0ae5b6f3c298a005b73556740526c0e24a5633c

2023-02-15 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next branch HEAD: b0ae5b6f3c298a005b73556740526c0e24a5633c powerpc/kexec_file: print error string on usable memory property update failure elapsed time: 1071m configs tested: 85 configs skipped: 3 The following

Re: [PATCH v4 06/10] soc: fsl: cmp1: Add support for QMC

2023-02-15 Thread Christophe Leroy
Le 15/02/2023 à 23:44, Leo Li a écrit : > > >> -Original Message- >> From: Herve Codina >> Sent: Thursday, January 26, 2023 2:32 AM >> To: Herve Codina ; Leo Li >> ; Rob Herring ; Krzysztof >> Kozlowski ; Liam Girdwood >> ; Mark Brown ; Christophe >> Leroy ; Michael Ellerman >> ;

Re: 6.2-rc7 fails building on Talos II: memory.c:(.text+0x2e14): undefined reference to `hash__tlb_flush'

2023-02-15 Thread Christophe Leroy
Le 16/02/2023 à 00:55, Erhard F. a écrit : > Just noticed a build failure on 6.2-rc7 for my Talos 2 (.config attached): > > # make >CALLscripts/checksyscalls.sh >UPD include/generated/utsversion.h >CC init/version-timestamp.o >LD .tmp_vmlinux.kallsyms1 > ld:

[PATCH] powerpc/perf: Add json metric events to present CPI stall cycles in powerpc

2023-02-15 Thread Athira Rajeev
Power10 Performance Monitoring Unit (PMU) provides events to understand stall cycles of different pipeline stages. These events along with completed instructions provides useful metrics for application tuning. Patch implements the json changes to collect counter statistics to present the high

Re: 6.2-rc7 fails building on Talos II: memory.c:(.text+0x2e14): undefined reference to `hash__tlb_flush'

2023-02-15 Thread Benjamin Gray
On Thu, 2023-02-16 at 00:55 +0100, Erhard F. wrote: > Just noticed a build failure on 6.2-rc7 for my Talos 2 (.config > attached): > >  # make >   CALL    scripts/checksyscalls.sh >   UPD include/generated/utsversion.h >   CC  init/version-timestamp.o >   LD  .tmp_vmlinux.kallsyms1 >

[PATCH v3 35/35] mm: separate vma->lock from vm_area_struct

2023-02-15 Thread Suren Baghdasaryan
vma->lock being part of the vm_area_struct causes performance regression during page faults because during contention its count and owner fields are constantly updated and having other parts of vm_area_struct used during page fault handling next to them causes constant cache line bouncing. Fix

[PATCH v3 34/35] mm/mmap: free vm_area_struct without call_rcu in exit_mmap

2023-02-15 Thread Suren Baghdasaryan
call_rcu() can take a long time when callback offloading is enabled. Its use in the vm_area_free can cause regressions in the exit path when multiple VMAs are being freed. Because exit_mmap() is called only after the last mm user drops its refcount, the page fault handlers can't be racing with it.

[PATCH v3 33/35] powerc/mm: try VMA lock-based page fault handling first

2023-02-15 Thread Suren Baghdasaryan
From: Laurent Dufour Attempt VMA lock-based page fault handling first, and fall back to the existing mmap_lock-based handling if that fails. Copied from "x86/mm: try VMA lock-based page fault handling first" Signed-off-by: Laurent Dufour Signed-off-by: Suren Baghdasaryan ---

[PATCH v3 32/35] arm64/mm: try VMA lock-based page fault handling first

2023-02-15 Thread Suren Baghdasaryan
Attempt VMA lock-based page fault handling first, and fall back to the existing mmap_lock-based handling if that fails. Signed-off-by: Suren Baghdasaryan --- arch/arm64/Kconfig| 1 + arch/arm64/mm/fault.c | 36 2 files changed, 37 insertions(+) diff

[PATCH v3 31/35] x86/mm: try VMA lock-based page fault handling first

2023-02-15 Thread Suren Baghdasaryan
Attempt VMA lock-based page fault handling first, and fall back to the existing mmap_lock-based handling if that fails. Signed-off-by: Suren Baghdasaryan --- arch/x86/Kconfig| 1 + arch/x86/mm/fault.c | 36 2 files changed, 37 insertions(+) diff --git

[PATCH v3 30/35] mm: introduce per-VMA lock statistics

2023-02-15 Thread Suren Baghdasaryan
Add a new CONFIG_PER_VMA_LOCK_STATS config option to dump extra statistics about handling page fault under VMA lock. Signed-off-by: Suren Baghdasaryan --- include/linux/vm_event_item.h | 6 ++ include/linux/vmstat.h| 6 ++ mm/Kconfig.debug | 6 ++ mm/memory.c

[PATCH v3 29/35] mm: prevent userfaults to be handled under per-vma lock

2023-02-15 Thread Suren Baghdasaryan
Due to the possibility of handle_userfault dropping mmap_lock, avoid fault handling under VMA lock and retry holding mmap_lock. This can be handled more gracefully in the future. Signed-off-by: Suren Baghdasaryan Suggested-by: Peter Xu --- mm/memory.c | 9 + 1 file changed, 9

[PATCH v3 28/35] mm: prevent do_swap_page from handling page faults under VMA lock

2023-02-15 Thread Suren Baghdasaryan
Due to the possibility of do_swap_page dropping mmap_lock, abort fault handling under VMA lock and retry holding mmap_lock. This can be handled more gracefully in the future. Signed-off-by: Suren Baghdasaryan Reviewed-by: Laurent Dufour --- mm/memory.c | 5 + 1 file changed, 5

[PATCH v3 27/35] mm: add FAULT_FLAG_VMA_LOCK flag

2023-02-15 Thread Suren Baghdasaryan
Add a new flag to distinguish page faults handled under protection of per-vma lock. Signed-off-by: Suren Baghdasaryan Reviewed-by: Laurent Dufour --- include/linux/mm.h | 3 ++- include/linux/mm_types.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v3 26/35] mm: fall back to mmap_lock if vma->anon_vma is not yet set

2023-02-15 Thread Suren Baghdasaryan
When vma->anon_vma is not set, page fault handler will set it by either reusing anon_vma of an adjacent VMA if VMAs are compatible or by allocating a new one. find_mergeable_anon_vma() walks VMA tree to find a compatible adjacent VMA and that requires not only the faulting VMA to be stable but

[PATCH v3 25/35] mm: introduce lock_vma_under_rcu to be used from arch-specific code

2023-02-15 Thread Suren Baghdasaryan
Introduce lock_vma_under_rcu function to lookup and lock a VMA during page fault handling. When VMA is not found, can't be locked or changes after being locked, the function returns NULL. The lookup is performed under RCU protection to prevent the found VMA from being destroyed before the VMA lock

[PATCH v3 24/35] mm: introduce vma detached flag

2023-02-15 Thread Suren Baghdasaryan
Per-vma locking mechanism will search for VMA under RCU protection and then after locking it, has to ensure it was not removed from the VMA tree after we found it. To make this check efficient, introduce a vma->detached flag to mark VMAs which were removed from the VMA tree. Signed-off-by: Suren

[PATCH v3 23/35] mm/mmap: prevent pagefault handler from racing with mmu_notifier registration

2023-02-15 Thread Suren Baghdasaryan
Page fault handlers might need to fire MMU notifications while a new notifier is being registered. Modify mm_take_all_locks to write-lock all VMAs and prevent this race with page fault handlers that would hold VMA locks. VMAs are locked before i_mmap_rwsem and anon_vma to keep the same locking

[PATCH v3 22/35] kernel/fork: assert no VMA readers during its destruction

2023-02-15 Thread Suren Baghdasaryan
Assert there are no holders of VMA lock for reading when it is about to be destroyed. Signed-off-by: Suren Baghdasaryan --- kernel/fork.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/fork.c b/kernel/fork.c index 9141427a98b2..a08cc0e2bfde 100644 --- a/kernel/fork.c +++

[PATCH v3 21/35] mm/mmap: write-lock adjacent VMAs if they can grow into unmapped area

2023-02-15 Thread Suren Baghdasaryan
While unmapping VMAs, adjacent VMAs might be able to grow into the area being unmapped. In such cases write-lock adjacent VMAs to prevent this growth. Signed-off-by: Suren Baghdasaryan --- mm/mmap.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/mmap.c

[PATCH v3 20/35] mm: conditionally write-lock VMA in free_pgtables

2023-02-15 Thread Suren Baghdasaryan
Normally free_pgtables needs to lock affected VMAs except for the case when VMAs were isolated under VMA write-lock. munmap() does just that, isolating while holding appropriate locks and then downgrading mmap_lock and dropping per-VMA locks before freeing page tables. Add a parameter to

[PATCH v3 19/35] mm: write-lock VMAs before removing them from VMA tree

2023-02-15 Thread Suren Baghdasaryan
Write-locking VMAs before isolating them ensures that page fault handlers don't operate on isolated VMAs. Signed-off-by: Suren Baghdasaryan --- mm/mmap.c | 1 + mm/nommu.c | 5 + 2 files changed, 6 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index 0eaa3d1a6cd1..aaa359a147b2 100644

[PATCH v3 18/35] mm/mremap: write-lock VMA while remapping it to a new address range

2023-02-15 Thread Suren Baghdasaryan
Write-lock VMA as locked before copying it and when copy_vma produces a new VMA. Signed-off-by: Suren Baghdasaryan Reviewed-by: Laurent Dufour --- mm/mmap.c | 1 + mm/mremap.c | 1 + 2 files changed, 2 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index f079e5bbcd57..0eaa3d1a6cd1 100644

[PATCH v3 17/35] mm/mmap: write-lock VMA before shrinking or expanding it

2023-02-15 Thread Suren Baghdasaryan
vma_expand and vma_shrink change VMA boundaries. Expansion might also result in freeing of an adjacent VMA. Write-lock affected VMAs to prevent concurrent page faults. Signed-off-by: Suren Baghdasaryan --- mm/mmap.c | 5 + 1 file changed, 5 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c

[PATCH v3 16/35] mm/mmap: write-lock VMAs before merging, splitting or expanding them

2023-02-15 Thread Suren Baghdasaryan
Decisions about whether VMAs can be merged, split or expanded must be made while VMAs are protected from the changes which can affect that decision. For example, merge_vma uses vma->anon_vma in its decision whether the VMA can be merged. Meanwhile, page fault handler changes vma->anon_vma during

[PATCH v3 15/35] mm/khugepaged: write-lock VMA while collapsing a huge page

2023-02-15 Thread Suren Baghdasaryan
Protect VMA from concurrent page fault handler while collapsing a huge page. Page fault handler needs a stable PMD to use PTL and relies on per-VMA lock to prevent concurrent PMD changes. pmdp_collapse_flush(), set_huge_pmd() and collapse_and_free_pmd() can modify a PMD, which will not be detected

[PATCH v3 14/35] mm/mmap: move VMA locking before vma_adjust_trans_huge call

2023-02-15 Thread Suren Baghdasaryan
vma_adjust_trans_huge() modifies the VMA and such modifications should be done after VMA is marked as being written. Therefore move VMA flag modifications before vma_adjust_trans_huge() so that VMA is marked before all these modifications. Signed-off-by: Suren Baghdasaryan --- mm/mmap.c | 3 ++-

[PATCH v3 13/35] mm: mark VMA as being written when changing vm_flags

2023-02-15 Thread Suren Baghdasaryan
Updates to vm_flags have to be done with VMA marked as being written for preventing concurrent page faults or other modifications. Signed-off-by: Suren Baghdasaryan --- include/linux/mm.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/mm.h

[PATCH v3 12/35] mm: add per-VMA lock and helper functions to control it

2023-02-15 Thread Suren Baghdasaryan
Introduce per-VMA locking. The lock implementation relies on a per-vma and per-mm sequence counters to note exclusive locking: - read lock - (implemented by vma_start_read) requires the vma (vm_lock_seq) and mm (mm_lock_seq) sequence counters to differ. If they match then there must be a

[PATCH v3 11/35] mm: move mmap_lock assert function definitions

2023-02-15 Thread Suren Baghdasaryan
Move mmap_lock assert function definitions up so that they can be used by other mmap_lock routines. Signed-off-by: Suren Baghdasaryan --- include/linux/mmap_lock.h | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/linux/mmap_lock.h

[PATCH v3 10/35] mm: rcu safe VMA freeing

2023-02-15 Thread Suren Baghdasaryan
From: Michel Lespinasse This prepares for page faults handling under VMA lock, looking up VMAs under protection of an rcu read lock, instead of the usual mmap read lock. Signed-off-by: Michel Lespinasse Signed-off-by: Suren Baghdasaryan --- include/linux/mm_types.h | 13 ++---

[PATCH v3 09/35] mm: introduce CONFIG_PER_VMA_LOCK

2023-02-15 Thread Suren Baghdasaryan
This configuration variable will be used to build the support for VMA locking during page fault handling. This is enabled on supported architectures with SMP and MMU set. The architecture support is needed since the page fault handler is called from the architecture's page faulting code which

[PATCH v3 08/35] mm: Enable maple tree RCU mode by default.

2023-02-15 Thread Suren Baghdasaryan
From: "Liam R. Howlett" Use the maple tree in RCU mode for VMA tracking. This is necessary for the use of per-VMA locking. RCU mode is enabled by default but disabled when exiting an mm and for the new tree during a fork. Also enable RCU for the tree used in munmap operations to ensure the

[PATCH v3 07/35] maple_tree: Add RCU lock checking to rcu callback functions

2023-02-15 Thread Suren Baghdasaryan
From: "Liam R. Howlett" Dereferencing RCU objects within the RCU callback without the RCU check has caused lockdep to complain. Fix the RCU dereferencing by using the RCU callback lock to ensure the operation is safe. Also stop creating a new lock to use for dereferencing during destruction of

[PATCH v3 06/35] maple_tree: Add smp_rmb() to dead node detection

2023-02-15 Thread Suren Baghdasaryan
From: "Liam R. Howlett" Add an smp_rmb() before reading the parent pointer to ensure that anything read from the node prior to the parent pointer hasn't been reordered ahead of this check. The is necessary for RCU mode. Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by:

[PATCH v3 05/35] maple_tree: Fix write memory barrier of nodes once dead for RCU mode

2023-02-15 Thread Suren Baghdasaryan
From: "Liam R. Howlett" During the development of the maple tree, the strategy of freeing multiple nodes changed and, in the process, the pivots were reused to store pointers to dead nodes. To ensure the readers see accurate pivots, the writers need to mark the nodes as dead and call smp_wmb()

[PATCH v3 04/35] maple_tree: remove extra smp_wmb() from mas_dead_leaves()

2023-02-15 Thread Suren Baghdasaryan
From: Liam Howlett The call to mte_set_dead_node() before the smp_wmb() already calls smp_wmb() so this is not needed. This is an optimization for the RCU mode of the maple tree. Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Liam Howlett Signed-off-by: Suren

[PATCH v3 03/35] maple_tree: Fix freeing of nodes in rcu mode

2023-02-15 Thread Suren Baghdasaryan
From: Liam Howlett The walk to destroy the nodes was not always setting the node type and would result in a destroy method potentially using the values as nodes. Avoid this by setting the correct node types. This is necessary for the RCU mode of the maple tree. Fixes: 54a611b60590 ("Maple

[PATCH v3 02/35] maple_tree: Detect dead nodes in mas_start()

2023-02-15 Thread Suren Baghdasaryan
From: Liam Howlett When initially starting a search, the root node may already be in the process of being replaced in RCU mode. Detect and restart the walk if this is the case. This is necessary for RCU mode of the maple tree. Fixes: 54a611b60590 ("Maple Tree: add new data structure")

[PATCH v3 00/35] Per-VMA locks

2023-02-15 Thread Suren Baghdasaryan
Previous version: v2: https://lore.kernel.org/lkml/20230127194110.533103-1-sur...@google.com/ v1: https://lore.kernel.org/all/20230109205336.3665937-1-sur...@google.com/ RFC: https://lore.kernel.org/all/20220901173516.702122-1-sur...@google.com/ LWN article describing the feature:

[PATCH v3 01/35] maple_tree: Be more cautious about dead nodes

2023-02-15 Thread Suren Baghdasaryan
From: Liam Howlett ma_pivots() and ma_data_end() may be called with a dead node. Ensure to that the node isn't dead before using the returned values. This is necessary for RCU mode of the maple tree. Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Liam Howlett

[PATCH 1/2] kcsan: xtensa: Add atomic builtin stubs for 32-bit systems

2023-02-15 Thread Rohan McLure
KCSAN instruments calls to atomic builtins, and will in turn call these builtins itself. As such, architectures supporting KCSAN must have compiler support for these atomic primitives. Since 32-bit systems are unlikely to have 64-bit compiler builtins, provide a stub for each missing builtin, and

[PATCH 2/2] powerpc/{32,book3e}: kcsan: Extend KCSAN Support

2023-02-15 Thread Rohan McLure
Enable HAVE_ARCH_KCSAN on all powerpc platforms, permitting use of the kernel concurrency sanitiser through the CONFIG_KCSAN_* kconfig options. Boots and passes selftests on 32-bit and 64-bit platforms. See documentation in Documentation/dev-tools/kcsan.rst for more information. Signed-off-by:

linux-next: build warning after merge of the powerpc tree

2023-02-15 Thread Stephen Rothwell
Hi all, After merging the powerpc tree, today's linux-next build (powerpc pseries_le_defconfig) produced this warning: arch/powerpc/kernel/head_64.o: warning: objtool: .text+0x6128: unannotated intra-function call I have no idea what caused this. -- Cheers, Stephen Rothwell

Re: [PATCH v2] usb: fix some spelling mistakes in comment of gadget

2023-02-15 Thread Randy Dunlap
On 2/15/23 17:35, Zhou nan wrote: > usb: Fix spelling mistake in comments of gadget. > > Signed-off-by: Zhou nan Acked-by: Randy Dunlap Thanks. > --- > v2: > - Modify the title and description text. > --- > drivers/usb/gadget/udc/fsl_udc_core.c | 8 > 1 file changed, 4

[PATCH v2] usb: fix some spelling mistakes in comment of gadget

2023-02-15 Thread Zhou nan
usb: Fix spelling mistake in comments of gadget. Signed-off-by: Zhou nan --- v2: - Modify the title and description text. --- drivers/usb/gadget/udc/fsl_udc_core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c

Re: [PATCH v1 5/5] powerpc/epapr: Don't use wrteei on non booke

2023-02-15 Thread Pali Rohár
On Tuesday 20 December 2022 21:21:11 Pali Rohár wrote: > On Monday 19 December 2022 19:46:00 Christophe Leroy wrote: > > wrteei is only for booke. Use the standard mfmsr/ori/mtmsr > > when non booke. > > > > Reported-by: Jan-Benedict Glaw > > Signed-off-by: Christophe Leroy > > --- > > Not sure

[PATCH v8 7/7] powerpc: mm: Support page table check

2023-02-15 Thread Rohan McLure
On creation and clearing of a page table mapping, instrument such calls by invoking page_table_check_pte_set and page_table_check_pte_clear respectively. These calls serve as a sanity check against illegal mappings. Enable ARCH_SUPPORTS_PAGE_TABLE_CHECK for all platforms. Use set_pte internally,

[PATCH v8 6/7] powerpc: mm: Add p{te,md,ud}_user_accessible_page helpers

2023-02-15 Thread Rohan McLure
Add the following helpers for detecting whether a page table entry is a leaf and is accessible to user space. * pte_user_accessible_page * pmd_user_accessible_page * pud_user_accessible_page Also implement missing pud_user definitions for both Book3S/nohash 64-bit systems, and pmd_user for

[PATCH v8 5/7] powerpc: mm: Add common pud_pfn stub for all platforms

2023-02-15 Thread Rohan McLure
Prior to this commit, pud_pfn was implemented with BUILD_BUG as the inline function for 64-bit Book3S systems but is never included, as its invocations in generic code are guarded by calls to pud_devmap which return zero on such systems. A future patch will provide support for page table checks,

[PATCH v8 4/7] powerpc: mm: Implement p{m,u,4}d_leaf on all platforms

2023-02-15 Thread Rohan McLure
The check that a higher-level entry in multi-level pages contains a page translation entry (pte) is performed by p{m,u,4}d_leaf stubs, which may be specialised for each choice of mmu. In a prior commit, we replace uses to the catch-all stubs, p{m,u,4}d_is_leaf with p{m,u,4}d_leaf. Replace the

[PATCH v8 3/7] powerpc: mm: Replace p{u,m,4}d_is_leaf with p{u,m,4}_leaf

2023-02-15 Thread Rohan McLure
Replace occurrences of p{u,m,4}d_is_leaf with p{u,m,4}_leaf, as the latter is the name given to checking that a higher-level entry in multi-level paging contains a page translation entry (pte) throughout all other archs. A future patch will implement p{u,m,4}_leaf stubs on all platforms so that

[PATCH v8 2/7] powerpc/64s: mm: Introduce __pmdp_collapse_flush with mm_struct argument

2023-02-15 Thread Rohan McLure
pmdp_collapse_flush has references in generic code with just three parameters, due to the choice of mm context being implied by the vm_area context parameter. Define __pmdp_collapse_flush to accept an additional mm_struct * parameter, with pmdp_collapse_flush an inline function that unpacks the

[PATCH v8 1/7] powerpc: mm: Separate set_pte, set_pte_at for internal, external use

2023-02-15 Thread Rohan McLure
Produce separate symbols for set_pte, which is to be used in arch/powerpc for reassignment of pte's, and set_pte_at, used in generic code. The reason for this distinction is to support the Page Table Check sanitiser. Having this distinction allows for set_pte_at to instrumented, but set_pte not

[PATCH v8 0/7] Support page table check

2023-02-15 Thread Rohan McLure
Support the page table check sanitiser on all PowerPC platforms. This sanitiser works by serialising assignments, reassignments and clears of page table entries at each level in order to ensure that anonymous mappings have at most one writable consumer, and likewise that file-backed mappings are

RE: [PATCH v4 06/10] soc: fsl: cmp1: Add support for QMC

2023-02-15 Thread Leo Li
> -Original Message- > From: Herve Codina > Sent: Thursday, January 26, 2023 2:32 AM > To: Herve Codina ; Leo Li > ; Rob Herring ; Krzysztof > Kozlowski ; Liam Girdwood > ; Mark Brown ; Christophe > Leroy ; Michael Ellerman > ; Nicholas Piggin ; Qiang Zhao > ; Jaroslav Kysela ; Takashi

Re: [PATCH v2 00/24] cpu,sched: Mark arch_cpu_idle_dead() __noreturn

2023-02-15 Thread Paul E. McKenney
On Mon, Feb 13, 2023 at 11:05:34PM -0800, Josh Poimboeuf wrote: > v2: > - make arch_call_rest_init() and rest_init() __noreturn > - make objtool 'global_returns' work for weak functions > - rebase on tip/objtool/core with dependencies merged in (mingo) > - add acks > > v1.1: > - add __noreturn to

Re: [PATCH v1 3/9] powerpc/47x: Split ppc47x machine in two

2023-02-15 Thread Michael Ellerman
Christophe Leroy writes: > This machine matches two compatibles and sets .pci_irq_fixup > on one of them. > > Split it into two machines, then the probe function can be dropped. That will break the machine initcalls that look for ppc47x:

RE: [PATCH v4 06/10] soc: fsl: cmp1: Add support for QMC

2023-02-15 Thread Leo Li
> -Original Message- > From: Christophe Leroy > Sent: Wednesday, February 15, 2023 10:08 AM > To: Leo Li ; Qiang Zhao > Cc: linuxppc-dev@lists.ozlabs.org; Krzysztof Kozlowski > ; Rob Herring ; > Herve Codina ; linux-arm- > ker...@lists.infradead.org; devicet...@vger.kernel.org; linux-

Re: [PATCH v4 00/18] gpiolib cleanups

2023-02-15 Thread Andy Shevchenko
On Wed, Feb 15, 2023 at 04:52:29PM +0100, Bartosz Golaszewski wrote: > On Wed, Feb 8, 2023 at 6:34 PM Andy Shevchenko > wrote: > > > > These are some older patches Arnd did last year, rebased to > > linux-next-20230208. On top there are Andy's patches regarding > > similar topic. The series

Re: [PATCH v4 00/18] gpiolib cleanups

2023-02-15 Thread Bartosz Golaszewski
On Wed, Feb 8, 2023 at 6:34 PM Andy Shevchenko wrote: > > These are some older patches Arnd did last year, rebased to > linux-next-20230208. On top there are Andy's patches regarding > similar topic. The series starts with Linus Walleij's patches. > > The main goal is to remove some of the legacy

Re: [PATCH v4 01/15] spi: Replace all spi->chip_select and spi->cs_gpiod references with function call

2023-02-15 Thread Mark Brown
On Sat, Feb 11, 2023 at 01:06:32AM +0530, Amit Kumar Mahapatra wrote: > Supporting multi-cs in spi drivers would require the chip_select & cs_gpiod > members of struct spi_device to be an array. But changing the type of these > members to array would break the spi driver functionality. To make the

[PATCH] usb: fix some spelling mistakes in comment

2023-02-15 Thread Zhou nan
Fix typos in comment. Signed-off-by: Zhou nan --- drivers/usb/gadget/udc/fsl_udc_core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index a67873a074b7..da876d09fc01 100644 ---

[PATCH AUTOSEL 6.1 15/24] powerpc: Don't select ARCH_WANTS_NO_INSTR

2023-02-15 Thread Sasha Levin
From: Michael Ellerman [ Upstream commit e33416fca8a2313b8650bd5807aaf34354d39a4c ] Commit 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support") added a select of ARCH_WANTS_NO_INSTR, because it also added some uses of noinstr. However noinstr is always defined, regardless of

Re: [PATCH v2 04/24] arm64/cpu: Mark cpu_die() __noreturn

2023-02-15 Thread Josh Poimboeuf
On Wed, Feb 15, 2023 at 01:09:21PM +, Mark Rutland wrote: > On Tue, Feb 14, 2023 at 09:13:08AM +0100, Philippe Mathieu-Daudé wrote: > > On 14/2/23 08:05, Josh Poimboeuf wrote: > > > cpu_die() doesn't return. Annotate it as such. By extension this also > > > makes arch_cpu_idle_dead()

Re: [PATCH v2 0/8] powerpc/85xx: p2020: Create one unified machine description

2023-02-15 Thread Pali Rohár
On Tuesday 14 February 2023 05:47:08 Christophe Leroy wrote: > Le 13/02/2023 à 21:11, Pali Rohár a écrit : > > On Monday 13 February 2023 19:58:15 Christophe Leroy wrote: > >> Le 09/02/2023 à 01:15, Pali Rohár a écrit : > > This patch moves all p2020 boards from mpc85xx_rdb.c and

Re: [PATCH v1 1/9] powerpc/machdep: Define 'compatible' property in ppc_md and use it

2023-02-15 Thread Nathan Lynch
Christophe Leroy writes: > Most probe functions do nothing else than checking whether > the machine is compatible to a given string. > > Define that string in ppc_md structure and check it directly from > probe_machine() instead of using ppc_md.probe() for that. > > Keep checking in

[PATCH 2/3] powerpc: Fix use of '-mabi=elfv2' with clang

2023-02-15 Thread Nathan Chancellor
'-mabi=elfv2' is not added to clang's invocations when CONFIG_PPC64_ELF_ABI_V2 is enabled, resulting in the generation of elfv1 code, as evidenced by the orphan section warnings/errors: ld.lld: error: vmlinux.a(arch/powerpc/kernel/prom_init.o):(.opd) is being placed in '.opd' ld.lld: error:

[PATCH 3/3] powerpc: Allow CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 with ld.lld 15+

2023-02-15 Thread Nathan Chancellor
Commit 5017b4594672 ("powerpc/64: Option to build big-endian with ELFv2 ABI") restricted the ELFv2 ABI configuration such that it can only be selected when linking with ld.bfd, due to lack of testing with LLVM. ld.lld can link ELFv2 kernels without any issues; in fact, it is the only ABI that

[PATCH 1/3] powerpc/boot: Only use '-mabi=elfv2' with CONFIG_PPC64_BOOT_WRAPPER

2023-02-15 Thread Nathan Chancellor
When CONFIG_PPC64_ELF_ABI_V2 is enabled with clang through CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2, building the powerpc boot wrapper in 32-bit mode (i.e. with CONFIG_PPC64_BOOT_WRAPPER=n) fails with: error: unknown target ABI 'elfv2' The ABI cannot be changed with '-m32'; GCC silently accepts it

[PATCH 0/3] Allow CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 with ld.lld 15+

2023-02-15 Thread Nathan Chancellor
Currently, CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 is not selectable with ld.lld because of an explicit dependency on GNU ld, due to lack of testing with LLVM. Erhard was kind enough to test this option on his hardware with LLVM 15, which ran without any issues. This should not be too surprising, as

Re: [External] [PATCH v2 00/33] Per-VMA locks

2023-02-15 Thread Suren Baghdasaryan
On Wed, Feb 15, 2023 at 9:33 AM Punit Agrawal wrote: > > Suren Baghdasaryan writes: > > > Previous version: > > v1: https://lore.kernel.org/all/20230109205336.3665937-1-sur...@google.com/ > > RFC: https://lore.kernel.org/all/20220901173516.702122-1-sur...@google.com/ > > > > LWN article

Re: [External] [PATCH v2 00/33] Per-VMA locks

2023-02-15 Thread Punit Agrawal
Suren Baghdasaryan writes: > Previous version: > v1: https://lore.kernel.org/all/20230109205336.3665937-1-sur...@google.com/ > RFC: https://lore.kernel.org/all/20220901173516.702122-1-sur...@google.com/ > > LWN article describing the feature: > https://lwn.net/Articles/906852/ > > Per-vma locks

[PATCH] macintosh: windfarm: Use unsigned type for 1-bit bitfields

2023-02-15 Thread Nathan Chancellor
#define to_smu_cpu_power(c) container_of(c, struct smu_cpu_power_sensor, sens) --- base-commit: ceaa837f96adb69c0df0397937cd74991d5d821a change-id: 20230215-windfarm-wsingle-bit-bitfield-constant-conversion-324fed6e2342 Best regards, -- Nathan Chancellor

Re: [PATCH v4 02/10] soc: fsl: cpm1: Add support for TSA

2023-02-15 Thread Christophe Leroy
Hi Li and Qiang, Le 26/01/2023 à 09:32, Herve Codina a écrit : > The TSA (Time Slot Assigner) purpose is to route some > TDM time-slots to other internal serial controllers. > > It is available in some PowerQUICC SoC such as the > MPC885 or MPC866. > > It is also available on some Quicc Engine

Re: [PATCH v4 06/10] soc: fsl: cmp1: Add support for QMC

2023-02-15 Thread Christophe Leroy
Hi Li and Qiang Le 26/01/2023 à 09:32, Herve Codina a écrit : > The QMC (QUICC Multichannel Controller) emulates up to 64 > channels within one serial controller using the same TDM > physical interface routed from the TSA. > > It is available in some PowerQUICC SoC such as the > MPC885 or

Re: [PATCH v2] tools/perf/tests: Change true workload to sleep workload in all metric test for system wide check

2023-02-15 Thread Ian Rogers
On Wed, Feb 15, 2023 at 1:38 AM Kajol Jain wrote: > > Testcase stat_all_metrics.sh fails in powerpc: > > 98: perf all metrics test : FAILED! > > Logs with verbose: > > [command]# ./perf test 98 -vv > 98: perf all metrics test : > --- start --- > test

[PATCH v8 3/3] riscv: Check relocations at compile time

2023-02-15 Thread Alexandre Ghiti
From: Alexandre Ghiti Relocating kernel at runtime is done very early in the boot process, so it is not convenient to check for relocations there and react in case a relocation was not expected. There exists a script in scripts/ that extracts the relocations from vmlinux that is then used at

[PATCH v8 2/3] powerpc: Move script to check relocations at compile time in scripts/

2023-02-15 Thread Alexandre Ghiti
From: Alexandre Ghiti Relocating kernel at runtime is done very early in the boot process, so it is not convenient to check for relocations there and react in case a relocation was not expected. Powerpc architecture has a script that allows to check at compile time for such unexpected

[PATCH v8 1/3] riscv: Introduce CONFIG_RELOCATABLE

2023-02-15 Thread Alexandre Ghiti
From: Alexandre Ghiti This config allows to compile 64b kernel as PIE and to relocate it at any virtual address at runtime: this paves the way to KASLR. Runtime relocation is possible since relocation metadata are embedded into the kernel. Note that relocating at runtime introduces an overhead

[PATCH v8 0/3] Introduce 64b relocatable kernel

2023-02-15 Thread Alexandre Ghiti
After multiple attempts, this patchset is now based on the fact that the 64b kernel mapping was moved outside the linear mapping. The first patch allows to build relocatable kernels but is not selected by default. That patch is a requirement for KASLR. The second and third patches take advantage

[PATCH v1 4/9] powerpc/gamecube|wii : Use machine_device_initcall()

2023-02-15 Thread Christophe Leroy
Instead of checking machine type in the function, use machine_device_initcall(). Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/embedded6xx/gamecube.c | 5 + arch/powerpc/platforms/embedded6xx/wii.c | 5 + 2 files changed, 2 insertions(+), 8 deletions(-) diff --git

[PATCH v1 9/9] powerpc/85xx: Don't check ppc_md.progress in mpc85xx_cds_setup_arch()

2023-02-15 Thread Christophe Leroy
mpc85xx_cds_setup_arch() is not a hot path, creating the string to be printed even when it doesn't get printed at the end is not an problem. Do it at all time. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/85xx/mpc85xx_cds.c | 11 --- 1 file changed, 4 insertions(+), 7

[PATCH v1 7/9] powerpc: Add ppc_md_progress()

2023-02-15 Thread Christophe Leroy
Many places have: if (ppc.md_progress) ppc.md_progress(); Introduce ppc_md_progress() which will embedded the test. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/machdep.h | 6 ++ 1 file changed, 6 insertions(+) diff --git

[PATCH v1 3/9] powerpc/47x: Split ppc47x machine in two

2023-02-15 Thread Christophe Leroy
This machine matches two compatibles and sets .pci_irq_fixup on one of them. Split it into two machines, then the probe function can be dropped. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/44x/ppc476.c | 31 + 1 file changed, 14 insertions(+), 17

[PATCH v1 8/9] powerpc: Use ppc_md_progress()

2023-02-15 Thread Christophe Leroy
Many places have: if (ppc.md_progress) ppc.md_progress(); Use ppc_md_progress() instead. Note that checkpatch complains about using function names, but this is not a function taking format strings, so we leave the function names for now. Signed-off-by: Christophe Leroy

[PATCH v1 6/9] powerpc: Make generic_calibrate_decr() the default

2023-02-15 Thread Christophe Leroy
ppc_md.calibrate_decr() is a mandatory item. Its nullity is never checked so it must be non null on all platforms. Most platforms define generic_calibrate_decr() as their ppc_md.calibrate_decr(). Have time_init() call generic_calibrate_decr() when ppc_md.calibrate_decr() is NULL, and remove

[PATCH v1 1/9] powerpc/machdep: Define 'compatible' property in ppc_md and use it

2023-02-15 Thread Christophe Leroy
Most probe functions do nothing else than checking whether the machine is compatible to a given string. Define that string in ppc_md structure and check it directly from probe_machine() instead of using ppc_md.probe() for that. Keep checking in ppc_md.probe() only for more complex probing.

[PATCH v1 5/9] powerpc/85xx: Fix function naming for p1023_rdb platform

2023-02-15 Thread Christophe Leroy
p1023_rdb platform is a copy of mpc85xx_rdb platform and some of its functions have kept mpc85xx_rdb names. Rename the said functions. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/85xx/p1023_rdb.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v1 2/9] powerpc/platforms: Use 'compatible' property for simple cases

2023-02-15 Thread Christophe Leroy
Use the new 'compatible' property for simple cases. checkpatch complains about the new compatible being undocumented but in reality nothing is new so just ignore it for the time being. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/44x/canyonlands.c | 9 +--

Re: [PATCH v2 04/24] arm64/cpu: Mark cpu_die() __noreturn

2023-02-15 Thread Mark Rutland
On Tue, Feb 14, 2023 at 09:13:08AM +0100, Philippe Mathieu-Daudé wrote: > On 14/2/23 08:05, Josh Poimboeuf wrote: > > cpu_die() doesn't return. Annotate it as such. By extension this also > > makes arch_cpu_idle_dead() noreturn. > > > > Signed-off-by: Josh Poimboeuf > > --- > >

Re: [PATCH v3 03/24] arm: Remove COMMAND_LINE_SIZE from uapi

2023-02-15 Thread Arnd Bergmann
On Wed, Feb 15, 2023, at 13:59, Russell King (Oracle) wrote: > On Tue, Feb 14, 2023 at 08:49:04AM +0100, Alexandre Ghiti wrote: >> From: Palmer Dabbelt >> >> As far as I can tell this is not used by userspace and thus should not >> be part of the user-visible API. >> >> Signed-off-by: Palmer

Re: [PATCH v3 03/24] arm: Remove COMMAND_LINE_SIZE from uapi

2023-02-15 Thread Russell King (Oracle)
On Tue, Feb 14, 2023 at 08:49:04AM +0100, Alexandre Ghiti wrote: > From: Palmer Dabbelt > > As far as I can tell this is not used by userspace and thus should not > be part of the user-visible API. > > Signed-off-by: Palmer Dabbelt Looks good to me. What's the merge plan for this? Thanks.

Re: [PATCH v4 06/10] soc: fsl: cmp1: Add support for QMC

2023-02-15 Thread Christophe Leroy
Le 15/02/2023 à 13:45, kernel test robot a écrit : > Hi Herve, > > I love your patch! Yet something to improve: > > [auto build test ERROR on broonie-sound/for-next] > [also build test ERROR on robh/for-next powerpc/next powerpc/fixes > linus/master v6.2-rc8 next-20230

Re: [PATCH] powerpc/rtas: Drop unused export symbols

2023-02-15 Thread Michael Ellerman
On Fri, 27 Jan 2023 22:12:31 +1100, Michael Ellerman wrote: > Some RTAS symbols are never used by modular code, drop their exports. > > Applied to powerpc/next. [1/1] powerpc/rtas: Drop unused export symbols https://git.kernel.org/powerpc/c/0d7e812fd282bf248b54523cc550a34b77c2e9a2

Re: [PATCH v4 06/10] soc: fsl: cmp1: Add support for QMC

2023-02-15 Thread kernel test robot
Hi Herve, I love your patch! Yet something to improve: [auto build test ERROR on broonie-sound/for-next] [also build test ERROR on robh/for-next powerpc/next powerpc/fixes linus/master v6.2-rc8 next-20230215] [If your patch is applied to the wrong git tree, kindly drop us a note. And when

Re: [PATCH v3 0/5] powerpc: Add KCSAN support

2023-02-15 Thread Michael Ellerman
On Mon, 6 Feb 2023 13:17:56 +1100, Rohan McLure wrote: > Add Kernel Concurrency Sanitiser support for PPC64. Doing so involves > exclusion of a number of compilation units from instrumentation, as was > done with KASAN. > > KCSAN uses watchpoints on memory accesses to enforce the semantics of >

  1   2   >