Re: [PATCH v4 05/15] mm: introduce execmem_alloc() and execmem_free()

2024-04-15 Thread Mark Rutland
On Mon, Apr 15, 2024 at 09:52:41AM +0200, Peter Zijlstra wrote: > On Thu, Apr 11, 2024 at 07:00:41PM +0300, Mike Rapoport wrote: > > +/** > > + * enum execmem_type - types of executable memory ranges > > + * > > + * There are several subsystems that allocate executable memory. > > + *

Re: [PATCH v6 00/18] Transparent Contiguous PTEs for User Mappings

2024-02-15 Thread Mark Rutland
latent issue prior to this series. The other bits also look good to me, so FWIW, for the series as a whole: Acked-by: Mark Rutland Mark.

Re: [PATCH v6 18/18] arm64/mm: Automatically fold contpte mappings

2024-02-15 Thread Mark Rutland
gt; perform the checks when an indiviual PTE is modified via mprotect > (ptep_modify_prot_commit() -> set_pte_at() -> set_ptes(nr=1)) and only > when we are setting the final PTE in a contpte-aligned block. > > Signed-off-by: Ryan Roberts Acked-by: Mark Rutland Mark. &

Re: [PATCH v6 14/18] arm64/mm: Implement new [get_and_]clear_full_ptes() batch APIs

2024-02-15 Thread Mark Rutland
contpte. This significantly reduces unfolding > operations, reducing the number of tlbis that must be issued. > > Tested-by: John Hubbard > Signed-off-by: Ryan Roberts Acked-by: Mark Rutland Mark. > --- > arch/arm64/include/asm/pgtable.h | 67

Re: [PATCH v6 13/18] arm64/mm: Implement new wrprotect_ptes() batch API

2024-02-15 Thread Mark Rutland
tect a whole contpte block without unfolding is > possible thanks to the tightening of the Arm ARM in respect to the > definition and behaviour when 'Misprogramming the Contiguous bit'. See > section D21194 at https://developer.arm.com/documentation/102105/ja-07/ > > Tested-by: Jo

Re: [PATCH v6 12/18] arm64/mm: Wire up PTE_CONT for user mappings

2024-02-15 Thread Mark Rutland
RENT_HUGEPAGE is also enabled. The core-mm depends upon > TRANSPARENT_HUGEPAGE to be able to allocate large folios, so if its not > enabled, then there is no chance of meeting the physical contiguity > requirement for contpte mappings. > > Acked-by: Ard Biesheuvel > Tested-by: John Hubbard

Re: [PATCH v6 11/18] arm64/mm: Split __flush_tlb_range() to elide trailing DSB

2024-02-15 Thread Mark Rutland
been discussed that __flush_tlb_page() may be wrong though. > Regardless, both will be resolved separately if needed. > > Reviewed-by: David Hildenbrand > Tested-by: John Hubbard > Signed-off-by: Ryan Roberts Acked-by: Mark Rutland Mark. > --- > arch/arm64/inclu

Re: [PATCH v6 10/18] arm64/mm: New ptep layer to manage contig bit

2024-02-15 Thread Mark Rutland
ar_young > - ptep_clear_flush_young > - ptep_set_wrprotect > - ptep_set_access_flags > > Tested-by: John Hubbard > Signed-off-by: Ryan Roberts Acked-by: Mark Rutland Mark. > --- > arch/arm64/include/asm/pgtable.h | 83 +--- > arch/arm64/kern

Re: [PATCH v6 09/18] arm64/mm: Convert ptep_clear() to ptep_get_and_clear()

2024-02-15 Thread Mark Rutland
transparent contpte work. We won't have a private version of > ptep_clear() so let's convert it to directly call ptep_get_and_clear(). > > Tested-by: John Hubbard > Signed-off-by: Ryan Roberts Acked-by: Mark Rutland Mark. > --- > arch/arm64/mm/hugetlbpage.c | 2 +- >

Re: [PATCH v6 08/18] arm64/mm: Convert set_pte_at() to set_ptes(..., 1)

2024-02-15 Thread Mark Rutland
nal, since those call sites are acting on behalf of > core-mm and should continue to call into the public set_ptes() rather > than the arch-private __set_ptes(). > > Tested-by: John Hubbard > Signed-off-by: Ryan Roberts Acked-by: Mark Rutland Mark. > --- > arch/arm64/include/

Re: [PATCH v6 07/18] arm64/mm: Convert READ_ONCE(*ptep) to ptep_get(ptep)

2024-02-15 Thread Mark Rutland
be the same. > > This will benefit us when we shortly introduce the transparent contpte > support. In this case, ptep_get() will become more complex so we now > have all the code abstracted through it. > > Tested-by: John Hubbard > Signed-off-by: Ryan Roberts Acked-by: Mark Rut

Re: [PATCH v6 04/18] arm64/mm: Convert pte_next_pfn() to pte_advance_pfn()

2024-02-15 Thread Mark Rutland
On Thu, Feb 15, 2024 at 10:31:51AM +, Ryan Roberts wrote: > Core-mm needs to be able to advance the pfn by an arbitrary amount, so > override the new pte_advance_pfn() API to do so. > > Signed-off-by: Ryan Roberts Acked-by: Mark Rutland Mark. > --- > arch/arm64/include

Re: [PATCH v5 25/25] arm64/mm: Automatically fold contpte mappings

2024-02-13 Thread Mark Rutland
On Fri, Feb 02, 2024 at 08:07:56AM +, Ryan Roberts wrote: > There are situations where a change to a single PTE could cause the > contpte block in which it resides to become foldable (i.e. could be > repainted with the contiguous bit). Such situations arise, for example, > when user space

Re: [PATCH v5 24/25] arm64/mm: __always_inline to improve fork() perf

2024-02-13 Thread Mark Rutland
ch is called by them, as __always_inline. This is worth ~1% on the > fork() microbenchmark with order-0 folios (the common case). > > Signed-off-by: Ryan Roberts I have no strong feelings either way on this, so: Acked-by: Mark Rutland Mark. > --- > arch/arm64/include/asm/pgtable.

Re: [PATCH v5 23/25] arm64/mm: Implement pte_batch_hint()

2024-02-13 Thread Mark Rutland
; > Tested-by: John Hubbard > Signed-off-by: Ryan Roberts Acked-by: Mark Rutland Mark. > --- > arch/arm64/include/asm/pgtable.h | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/arch/arm64/include/asm/pgtable.h > b/arch/arm64/include/asm/pgtable.h > i

Re: [PATCH v5 21/25] arm64/mm: Implement new [get_and_]clear_full_ptes() batch APIs

2024-02-13 Thread Mark Rutland
On Tue, Feb 13, 2024 at 04:48:50PM +, Ryan Roberts wrote: > On 13/02/2024 16:43, Mark Rutland wrote: > > On Fri, Feb 02, 2024 at 08:07:52AM +, Ryan Roberts wrote: > >> +static inline void __clear_full_ptes(struct mm_struct *mm, unsign

Re: [PATCH v5 21/25] arm64/mm: Implement new [get_and_]clear_full_ptes() batch APIs

2024-02-13 Thread Mark Rutland
On Fri, Feb 02, 2024 at 08:07:52AM +, Ryan Roberts wrote: > Optimize the contpte implementation to fix some of the > exit/munmap/dontneed performance regression introduced by the initial > contpte commit. Subsequent patches will solve it entirely. > > During exit(), munmap() or

Re: [PATCH v5 20/25] arm64/mm: Implement new wrprotect_ptes() batch API

2024-02-13 Thread Mark Rutland
On Fri, Feb 02, 2024 at 08:07:51AM +, Ryan Roberts wrote: > Optimize the contpte implementation to fix some of the fork performance > regression introduced by the initial contpte commit. Subsequent patches > will solve it entirely. > > During fork(), any private memory in the parent must be

Re: [PATCH v5 19/25] arm64/mm: Wire up PTE_CONT for user mappings

2024-02-13 Thread Mark Rutland
On Mon, Feb 12, 2024 at 12:59:57PM +, Ryan Roberts wrote: > On 12/02/2024 12:00, Mark Rutland wrote: > > Hi Ryan, [...] > >> +static inline void set_pte(pte_t *ptep, pte_t pte) > >> +{ > >> + /* > >> + * We don't have the mm or

Re: [PATCH v5 19/25] arm64/mm: Wire up PTE_CONT for user mappings

2024-02-12 Thread Mark Rutland
Hi Ryan, Overall this looks pretty good; I have a bunch of minor comments below, and a bigger question on the way ptep_get_lockless() works. On Fri, Feb 02, 2024 at 08:07:50AM +, Ryan Roberts wrote: > With the ptep API sufficiently refactored, we can now introduce a new > "contpte" API

Re: [PATCH v5 00/25] Transparent Contiguous PTEs for User Mappings

2024-02-08 Thread Mark Rutland
On Fri, Feb 02, 2024 at 08:07:31AM +, Ryan Roberts wrote: > Hi All, Hi Ryan, I assume this is the same as your 'features/granule_perf/contpte-lkml_v' branch on https://gitlab.arm.com/linux-arm/linux-rr/ I've taken a quick look, and I have a few initial/superficial comments before digging

Re: [PATCH v10 2/6] arm64: add support for machine check error safe

2024-01-30 Thread Mark Rutland
On Tue, Jan 30, 2024 at 06:57:24PM +0800, Tong Tiangen wrote: > 在 2024/1/30 1:51, Mark Rutland 写道: > > On Mon, Jan 29, 2024 at 09:46:48PM +0800, Tong Tiangen wrote: > > > diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c > > > index 55f6455a8284..312932dc1

Re: [PATCH v10 3/6] arm64: add uaccess to machine check safe

2024-01-30 Thread Mark Rutland
On Tue, Jan 30, 2024 at 07:14:35PM +0800, Tong Tiangen wrote: > 在 2024/1/30 1:43, Mark Rutland 写道: > > On Mon, Jan 29, 2024 at 09:46:49PM +0800, Tong Tiangen wrote: > > Further, this change will also silently fixup unexpected kernel faults if we > > pass bad kernel pointers t

Re: [PATCH v10 5/6] arm64: support copy_mc_[user]_highpage()

2024-01-30 Thread Mark Rutland
On Mon, Jan 29, 2024 at 09:46:51PM +0800, Tong Tiangen wrote: > Currently, many scenarios that can tolerate memory errors when copying page > have been supported in the kernel[1][2][3], all of which are implemented by > copy_mc_[user]_highpage(). arm64 should also support this mechanism. > > Due

Re: [PATCH v10 6/6] arm64: introduce copy_mc_to_kernel() implementation

2024-01-30 Thread Mark Rutland
On Mon, Jan 29, 2024 at 09:46:52PM +0800, Tong Tiangen wrote: > The copy_mc_to_kernel() helper is memory copy implementation that handles > source exceptions. It can be used in memory copy scenarios that tolerate > hardware memory errors(e.g: pmem_read/dax_copy_to_iter). > > Currnently, only x86

Re: [PATCH v10 3/6] arm64: add uaccess to machine check safe

2024-01-29 Thread Mark Rutland
On Mon, Jan 29, 2024 at 09:46:49PM +0800, Tong Tiangen wrote: > If user process access memory fails due to hardware memory error, only the > relevant processes are affected, so it is more reasonable to kill the user > process and isolate the corrupt page than to panic the kernel. > >

Re: [PATCH v10 2/6] arm64: add support for machine check error safe

2024-01-29 Thread Mark Rutland
On Mon, Jan 29, 2024 at 09:46:48PM +0800, Tong Tiangen wrote: > For the arm64 kernel, when it processes hardware memory errors for > synchronize notifications(do_sea()), if the errors is consumed within the > kernel, the current processing is panic. However, it is not optimal. > > Take uaccess

Re: [PATCH v2 02/12] mm: introduce execmem_text_alloc() and jit_text_alloc()

2023-06-26 Thread Mark Rutland
On Mon, Jun 19, 2023 at 10:09:02AM -0700, Andy Lutomirski wrote: > On Sun, Jun 18, 2023, at 1:00 AM, Mike Rapoport wrote: > > On Sat, Jun 17, 2023 at 01:38:29PM -0700, Andy Lutomirski wrote: > >> On Fri, Jun 16, 2023, at 1:50 AM, Mike Rapoport wrote: > >> > From: "Mike Rapoport (IBM)" > >> > > >>

Re: [PATCH v2 02/12] mm: introduce execmem_text_alloc() and jit_text_alloc()

2023-06-26 Thread Mark Rutland
On Sun, Jun 25, 2023 at 07:14:17PM +0300, Mike Rapoport wrote: > On Mon, Jun 19, 2023 at 10:09:02AM -0700, Andy Lutomirski wrote: > > > > On Sun, Jun 18, 2023, at 1:00 AM, Mike Rapoport wrote: > > > On Sat, Jun 17, 2023 at 01:38:29PM -0700, Andy Lutomirski wrote: > > >> On Fri, Jun 16, 2023, at

Re: [PATCH v2 02/12] mm: introduce execmem_text_alloc() and jit_text_alloc()

2023-06-26 Thread Mark Rutland
On Mon, Jun 26, 2023 at 11:54:02AM +0200, Puranjay Mohan wrote: > On Mon, Jun 26, 2023 at 8:13 AM Song Liu wrote: > > > > On Sun, Jun 25, 2023 at 11:07 AM Kent Overstreet > > wrote: > > > > > > On Sun, Jun 25, 2023 at 08:42:57PM +0300, Mike Rapoport wrote: > > > > On Sun, Jun 25, 2023 at

Re: [PATCH v5 15/18] watchdog/perf: Add a weak function for an arch to detect if perf can use NMIs

2023-06-12 Thread Mark Rutland
On Mon, Jun 12, 2023 at 06:55:37AM -0700, Doug Anderson wrote: > Mark, > > On Mon, Jun 12, 2023 at 3:33 AM Mark Rutland wrote: > > > > On Fri, May 19, 2023 at 10:18:39AM -0700, Douglas Anderson wrote: > > > On arm64, NMI support needs to be detected at runt

Re: [PATCH v5 15/18] watchdog/perf: Add a weak function for an arch to detect if perf can use NMIs

2023-06-12 Thread Mark Rutland
On Fri, May 19, 2023 at 10:18:39AM -0700, Douglas Anderson wrote: > On arm64, NMI support needs to be detected at runtime. Add a weak > function to the perf hardlockup detector so that an architecture can > implement it to detect whether NMIs are available. > > Signed-off-by: Douglas Anderson >

Re: [PATCH 00/13] mm: jit/text allocator

2023-06-05 Thread Mark Rutland
On Mon, Jun 05, 2023 at 12:20:40PM +0300, Mike Rapoport wrote: > On Fri, Jun 02, 2023 at 10:35:09AM +0100, Mark Rutland wrote: > > On Thu, Jun 01, 2023 at 02:14:56PM -0400, Kent Overstreet wrote: > > > On Thu, Jun 01, 2023 at 05:12:03PM +0100, Mark Rutland wrote: > > >

Re: [PATCH 00/13] mm: jit/text allocator

2023-06-02 Thread Mark Rutland
On Thu, Jun 01, 2023 at 02:14:56PM -0400, Kent Overstreet wrote: > On Thu, Jun 01, 2023 at 05:12:03PM +0100, Mark Rutland wrote: > > For a while I have wanted to give kprobes its own allocator so that it can > > work > > even with CONFIG_MODULES=n, and so that it doesn't h

Re: [PATCH 00/13] mm: jit/text allocator

2023-06-01 Thread Mark Rutland
Hi Mike, On Thu, Jun 01, 2023 at 01:12:44PM +0300, Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > Hi, > > module_alloc() is used everywhere as a mean to allocate memory for code. > > Beside being semantically wrong, this unnecessarily ties all subsystmes > that need to allocate code,

Re: [PATCH v8 00/10] arm64: Add framework to turn an IPI as NMI

2023-05-10 Thread Mark Rutland
On Wed, May 10, 2023 at 08:28:17AM -0700, Doug Anderson wrote: > Hi, Hi Doug, > On Wed, Apr 19, 2023 at 3:57 PM Douglas Anderson > wrote: > > This is an attempt to resurrect Sumit's old patch series [1] that > > allowed us to use the arm64 pseudo-NMI to get backtraces of CPUs and > > also to

Re: [PATCH v2 0/5] locking: Introduce local{,64}_try_cmpxchg

2023-04-11 Thread Mark Rutland
On Wed, Apr 05, 2023 at 09:37:04AM -0700, Dave Hansen wrote: > On 4/5/23 07:17, Uros Bizjak wrote: > > Add generic and target specific support for local{,64}_try_cmpxchg > > and wire up support for all targets that use local_t infrastructure. > > I feel like I'm missing some context. > > What

Re: [PATCH v2 2/5] locking/generic: Wire up local{,64}_try_cmpxchg

2023-04-11 Thread Mark Rutland
ocal64_try_cmpxchg and > local64_cmpxchg using typed C wrappers that call local_ > family of functions and provide additional checking > of their input arguments. > > Cc: Arnd Bergmann > Signed-off-by: Uros Bizjak Acked-by: Mark Rutland Mark. > --- > include/asm-generic/local.h

Re: [PATCH v2 1/5] locking/atomic: Add generic try_cmpxchg{,64}_local support

2023-04-11 Thread Mark Rutland
t; Cc: Will Deacon > Cc: Peter Zijlstra > Cc: Boqun Feng > Cc: Mark Rutland > Signed-off-by: Uros Bizjak Acked-by: Mark Rutland Mark. > --- > include/linux/atomic/atomic-arch-fallback.h | 24 - > include/linux/atomic/atomic-instrumented.h | 20 +++

Re: [PATCH 01/10] locking/atomic: Add missing cast to try_cmpxchg() fallbacks

2023-04-04 Thread Mark Rutland
On Tue, Apr 04, 2023 at 02:24:38PM +0200, Uros Bizjak wrote: > On Mon, Apr 3, 2023 at 12:19 PM Mark Rutland wrote: > > > > On Sun, Mar 26, 2023 at 09:28:38PM +0200, Uros Bizjak wrote: > > > On Fri, Mar 24, 2023 at 5:33 PM Mark Rutland wrote: > > > > > &

Re: [PATCH 01/10] locking/atomic: Add missing cast to try_cmpxchg() fallbacks

2023-04-03 Thread Mark Rutland
On Sun, Mar 26, 2023 at 09:28:38PM +0200, Uros Bizjak wrote: > On Fri, Mar 24, 2023 at 5:33 PM Mark Rutland wrote: > > > > On Fri, Mar 24, 2023 at 04:14:22PM +0000, Mark Rutland wrote: > > > On Fri, Mar 24, 2023 at 04:43:32PM +0100, Uros Bizjak wrote: > > > >

Re: [PATCH 01/10] locking/atomic: Add missing cast to try_cmpxchg() fallbacks

2023-03-24 Thread Mark Rutland
On Fri, Mar 24, 2023 at 04:14:22PM +, Mark Rutland wrote: > On Fri, Mar 24, 2023 at 04:43:32PM +0100, Uros Bizjak wrote: > > On Fri, Mar 24, 2023 at 3:13 PM Mark Rutland wrote: > > > > > > On Sun, Mar 05, 2023 at 09:56:19PM +0100, Uros Bizjak wrote: > > &

Re: [PATCH 01/10] locking/atomic: Add missing cast to try_cmpxchg() fallbacks

2023-03-24 Thread Mark Rutland
On Fri, Mar 24, 2023 at 04:43:32PM +0100, Uros Bizjak wrote: > On Fri, Mar 24, 2023 at 3:13 PM Mark Rutland wrote: > > > > On Sun, Mar 05, 2023 at 09:56:19PM +0100, Uros Bizjak wrote: > > > Cast _oldp to the type of _ptr to avoid incompatible-pointer-types > > &

Re: [PATCH 01/10] locking/atomic: Add missing cast to try_cmpxchg() fallbacks

2023-03-24 Thread Mark Rutland
> Cc: Boqun Feng > Cc: Mark Rutland > Signed-off-by: Uros Bizjak > --- > include/linux/atomic/atomic-arch-fallback.h | 18 +- > scripts/atomic/gen-atomic-fallback.sh | 2 +- > 2 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a

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

2023-02-15 Thread Mark Rutland
at it calls erroneously returned. We *could* mark cpu_operations::cpu_die() as noreturn, but I'd prefer that we did not so that the compiler doesn't optimize away the BUG() which is there to catch such erroneous returns. That said, could we please add __noreturn to the implementation of cpu_die() in arch/arm6

Re: [PATCH v3 00/51] cpuidle,rcu: Clean up the mess

2023-01-17 Thread Mark Rutland
On Tue, Jan 17, 2023 at 02:21:40PM +, Sudeep Holla wrote: > On Tue, Jan 17, 2023 at 01:16:21PM +0000, Mark Rutland wrote: > > On Tue, Jan 17, 2023 at 11:26:29AM +0100, Peter Zijlstra wrote: > > > On Mon, Jan 16, 2023 at 04:59:04PM +, Mark Rutland wrote: > > >

Re: [PATCH v3 00/51] cpuidle,rcu: Clean up the mess

2023-01-17 Thread Mark Rutland
On Tue, Jan 17, 2023 at 11:26:29AM +0100, Peter Zijlstra wrote: > On Mon, Jan 16, 2023 at 04:59:04PM +0000, Mark Rutland wrote: > > > I'm sorry to have to bear some bad news on that front. :( > > Moo, something had to give.. > > > > IIUC what's happenign here

Re: [PATCH v3 00/51] cpuidle,rcu: Clean up the mess

2023-01-16 Thread Mark Rutland
On Thu, Jan 12, 2023 at 08:43:14PM +0100, Peter Zijlstra wrote: > Hi All! Hi Peter, > The (hopefully) final respin of cpuidle vs rcu cleanup patches. Barring any > objections I'll be queueing these patches in tip/sched/core in the next few > days. I'm sorry to have to bear some bad news on that

Re: [PATCH v2 33/44] ftrace: WARN on rcuidle

2022-10-04 Thread Mark Rutland
On Mon, Sep 19, 2022 at 12:00:12PM +0200, Peter Zijlstra wrote: > CONFIG_GENERIC_ENTRY disallows any and all tracing when RCU isn't > enabled. > > XXX if s390 (the only other GENERIC_ENTRY user as of this writing) > isn't comfortable with this, we could switch to > HAVE_NOINSTR_VALIDATION which

Re: [PATCH -next v5 2/8] arm64: extable: make uaaccess helper use extable type EX_TYPE_UACCESS_ERR_ZERO

2022-06-20 Thread Mark Rutland
On Mon, Jun 20, 2022 at 10:13:41PM +0800, Tong Tiangen wrote: > > > 在 2022/6/20 17:10, Mark Rutland 写道: > > On Mon, Jun 20, 2022 at 10:59:12AM +0800, Tong Tiangen wrote: > > > 在 2022/6/18 20:40, Mark Rutland 写道: > > > The following errors are reported during co

Re: [PATCH -next v5 2/8] arm64: extable: make uaaccess helper use extable type EX_TYPE_UACCESS_ERR_ZERO

2022-06-20 Thread Mark Rutland
On Mon, Jun 20, 2022 at 10:59:12AM +0800, Tong Tiangen wrote: > 在 2022/6/18 20:40, Mark Rutland 写道: > > On Sat, Jun 18, 2022 at 04:42:06PM +0800, Tong Tiangen wrote: > > > > > > diff --git a/arch/arm64/include/asm/asm-extable.h > > > > > > b/arch/arm6

Re: [PATCH -next v5 6/8] arm64: add support for machine check error safe

2022-06-18 Thread Mark Rutland
On Sat, Jun 18, 2022 at 05:18:55PM +0800, Tong Tiangen wrote: > 在 2022/6/17 16:55, Mark Rutland 写道: > > On Sat, May 28, 2022 at 06:50:54AM +, Tong Tiangen wrote: > > > +static bool arm64_do_kernel_sea(unsigned long addr, unsigned int esr, > > > +

Re: [PATCH -next v5 2/8] arm64: extable: make uaaccess helper use extable type EX_TYPE_UACCESS_ERR_ZERO

2022-06-18 Thread Mark Rutland
On Sat, Jun 18, 2022 at 04:42:06PM +0800, Tong Tiangen wrote: > > > > diff --git a/arch/arm64/include/asm/asm-extable.h > > > > b/arch/arm64/include/asm/asm-extable.h > > > > index 56ebe183e78b..9c94ac1f082c 100644 > > > > --- a/arch/arm64/include/asm/asm-extable.h > > > > +++

Re: [PATCH -next v5 7/8] arm64: add uaccess to machine check safe

2022-06-18 Thread Mark Rutland
On Sat, Jun 18, 2022 at 05:27:45PM +0800, Tong Tiangen wrote: > > > 在 2022/6/17 17:06, Mark Rutland 写道: > > On Sat, May 28, 2022 at 06:50:55AM +, Tong Tiangen wrote: > > > If user access fail due to hardware memory error, only the relevant > > > processes

Re: [PATCH -next v5 7/8] arm64: add uaccess to machine check safe

2022-06-17 Thread Mark Rutland
On Sat, May 28, 2022 at 06:50:55AM +, Tong Tiangen wrote: > If user access fail due to hardware memory error, only the relevant > processes are affected, so killing the user process and isolate the > error page with hardware memory errors is a more reasonable choice > than kernel panic. > >

Re: [PATCH -next v5 6/8] arm64: add support for machine check error safe

2022-06-17 Thread Mark Rutland
On Sat, May 28, 2022 at 06:50:54AM +, Tong Tiangen wrote: > During the processing of arm64 kernel hardware memory errors(do_sea()), if > the errors is consumed in the kernel, the current processing is panic. > However, it is not optimal. > > Take uaccess for example, if the uaccess operation

Re: [PATCH -next v5 4/8] arm64: extable: cleanup redundant extable type EX_TYPE_FIXUP

2022-06-17 Thread Mark Rutland
On Sat, May 28, 2022 at 06:50:52AM +, Tong Tiangen wrote: > Currently, extable type EX_TYPE_FIXUP is no place to use, We can safely > remove it. > > Suggested-by: Mark Rutland > Signed-off-by: Tong Tiangen Acked-by: Mark Rutland Mark. > --- > arch/arm64/include/a

Re: [PATCH -next v5 3/8] arm64: extable: move _cond_extable to _cond_uaccess_extable

2022-06-17 Thread Mark Rutland
for clarity. > > Suggested-by: Mark Rutland > Signed-off-by: Tong Tiangen Acked-by: Mark Rutland Mark. > --- > arch/arm64/include/asm/asm-extable.h | 6 +++--- > arch/arm64/include/asm/assembler.h | 4 ++-- > 2 files changed, 5 insertions(+), 5 deletions(-) > >

Re: [PATCH -next v5 2/8] arm64: extable: make uaaccess helper use extable type EX_TYPE_UACCESS_ERR_ZERO

2022-06-17 Thread Mark Rutland
On Sat, May 28, 2022 at 06:50:50AM +, Tong Tiangen wrote: > Currnetly, the extable type used by __arch_copy_from/to_user() is > EX_TYPE_FIXUP. In fact, It is more clearly to use meaningful > EX_TYPE_UACCESS_*. > > Suggested-by: Mark Rutland > Signed-off-by: Tong Tiangen &

Re: [PATCH -next v5 1/8] arm64: extable: add new extable type EX_TYPE_KACCESS_ERR_ZERO support

2022-06-17 Thread Mark Rutland
y > __get/put_kernel_no_fault(). > > This is also to prepare for distinguishing the two types in machine check > safe process. > > Suggested-by: Mark Rutland > Signed-off-by: Tong Tiangen This looks good to me, so modulo one nit below: Acked-by: Mark Rutland > --- > arch/

Re: [PATCH 00/36] cpuidle,rcu: Cleanup the mess

2022-06-14 Thread Mark Rutland
der: "Linuxppc-dev" On Tue, Jun 14, 2022 at 06:58:30PM +0200, Peter Zijlstra wrote: > On Tue, Jun 14, 2022 at 12:19:29PM +0100, Mark Rutland wrote: > > On Wed, Jun 08, 2022 at 04:27:23PM +0200, Peter Zijlstra wrote: > > > Hi All! (omg so many) > > > > Hi Pe

Re: [PATCH 14/36] cpuidle: Fix rcu_idle_*() usage

2022-06-14 Thread Mark Rutland
der: "Linuxppc-dev" On Tue, Jun 14, 2022 at 06:40:53PM +0200, Peter Zijlstra wrote: > On Tue, Jun 14, 2022 at 01:41:13PM +0100, Mark Rutland wrote: > > On Wed, Jun 08, 2022 at 04:27:37PM +0200, Peter Zijlstra wrote: > > > --- a/kernel/time/tick-broadcast.c > >

Re: [PATCH 15/36] cpuidle,cpu_pm: Remove RCU fiddling from cpu_pm_{enter,exit}()

2022-06-14 Thread Mark Rutland
der: "Linuxppc-dev" On Tue, Jun 14, 2022 at 06:42:14PM +0200, Peter Zijlstra wrote: > On Tue, Jun 14, 2022 at 05:13:16PM +0100, Mark Rutland wrote: > > On Wed, Jun 08, 2022 at 04:27:38PM +0200, Peter Zijlstra wrote: > > > All callers should still have RCU enabled. > &g

Re: [PATCH 25/36] time/tick-broadcast: Remove RCU_NONIDLE usage

2022-06-14 Thread Mark Rutland
der: "Linuxppc-dev" On Wed, Jun 08, 2022 at 04:27:48PM +0200, Peter Zijlstra wrote: > No callers left that have already disabled RCU. > > Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mark Rutland Mark. > --- > kernel/time/tick-broadcast-hrtimer.c | 29 +++

Re: [PATCH 23/36] arm64,smp: Remove trace_.*_rcuidle() usage

2022-06-14 Thread Mark Rutland
ter Zijlstra (Intel) [adding Marc since he authored that commit] Makes sense to me: Acked-by: Mark Rutland Mark. > --- > arch/arm64/kernel/smp.c |4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > --- a/arch/arm64/kernel/smp.c > +++ b/arch/arm64/kernel/smp.

Re: [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour

2022-06-14 Thread Mark Rutland
> Signed-off-by: Peter Zijlstra (Intel) Nice! Acked-by: Mark Rutland [arm64] Mark. > --- > arch/alpha/kernel/process.c |1 - > arch/arc/kernel/process.c|3 +++ > arch/arm/kernel/process.c|1 - > arch/arm/mach-gemini/board-dt.c |3 ++-

Re: [PATCH 16/36] rcu: Fix rcu_idle_exit()

2022-06-14 Thread Mark Rutland
disabled, we > can remove these calls. > > Signed-off-by: Peter Zijlstra (Intel) > Acked-by: Paul E. McKenney Acked-by: Mark Rutland Mark. > --- > kernel/rcu/tree.c |9 +++-- > 1 file changed, 3 insertions(+), 6 deletions(-) > > --- a/kernel/rcu/tree.c > +++ b

Re: [PATCH 15/36] cpuidle,cpu_pm: Remove RCU fiddling from cpu_pm_{enter,exit}()

2022-06-14 Thread Mark Rutland
arndb.de>, ulli.kr...@googlemail.com, vgu...@kernel.org, linux-...@vger.kernel.org, j...@joshtriplett.org, rost...@goodmis.org, r...@vger.kernel.org, b...@alien8.de, bc...@quicinc.com, tsbog...@alpha.franken.de, linux-par...@vger.kernel.org, sudeep.ho...@arm.com, shawn...@kernel.org,

Re: [PATCH 14/36] cpuidle: Fix rcu_idle_*() usage

2022-06-14 Thread Mark Rutland
arndb.de>, ulli.kr...@googlemail.com, vgu...@kernel.org, linux-...@vger.kernel.org, j...@joshtriplett.org, rost...@goodmis.org, r...@vger.kernel.org, b...@alien8.de, bc...@quicinc.com, tsbog...@alpha.franken.de, linux-par...@vger.kernel.org, sudeep.ho...@arm.com, shawn...@kernel.org,

Re: [PATCH 00/36] cpuidle,rcu: Cleanup the mess

2022-06-14 Thread Mark Rutland
arndb.de>, ulli.kr...@googlemail.com, vgu...@kernel.org, linux-...@vger.kernel.org, j...@joshtriplett.org, rost...@goodmis.org, r...@vger.kernel.org, b...@alien8.de, bc...@quicinc.com, tsbog...@alpha.franken.de, linux-par...@vger.kernel.org, sudeep.ho...@arm.com, shawn...@kernel.org,

Re: [PATCH 1/2] locking/lockref: Use try_cmpxchg64 in CMPXCHG_LOOP macro

2022-05-26 Thread Mark Rutland
On Thu, May 26, 2022 at 10:14:59PM +1000, Michael Ellerman wrote: > Linus Torvalds writes: > > On Wed, May 25, 2022 at 7:40 AM Uros Bizjak wrote: > >> > >> Use try_cmpxchg64 instead of cmpxchg64 in CMPXCHG_LOOP macro. > >> x86 CMPXCHG instruction returns success in ZF flag, so this > >> change

Re: [PATCH -next v4 3/7] arm64: add support for machine check error safe

2022-05-26 Thread Mark Rutland
On Thu, May 26, 2022 at 11:36:41AM +0800, Tong Tiangen wrote: > > > 在 2022/5/25 16:30, Mark Rutland 写道: > > On Thu, May 19, 2022 at 02:29:54PM +0800, Tong Tiangen wrote: > > > > > > > > > 在 2022/5/13 23:26, Mark Rutland 写道: > > > > On Wed

Re: [PATCH -next v4 3/7] arm64: add support for machine check error safe

2022-05-25 Thread Mark Rutland
On Thu, May 19, 2022 at 02:29:54PM +0800, Tong Tiangen wrote: > > > 在 2022/5/13 23:26, Mark Rutland 写道: > > On Wed, Apr 20, 2022 at 03:04:14AM +, Tong Tiangen wrote: > > > During the processing of arm64 kernel hardware memory errors(do_sea()), if > > > the

Re: [PATCH -next v4 7/7] arm64: add cow to machine check safe

2022-05-13 Thread Mark Rutland
On Wed, Apr 20, 2022 at 03:04:18AM +, Tong Tiangen wrote: > In the cow(copy on write) processing, the data of the user process is > copied, when hardware memory error is encountered during copy, only the > relevant processes are affected, so killing the user process and isolate > the user page

Re: [PATCH -next v4 6/7] arm64: add {get, put}_user to machine check safe

2022-05-13 Thread Mark Rutland
On Wed, Apr 20, 2022 at 03:04:17AM +, Tong Tiangen wrote: > Add {get, put}_user() to machine check safe. > > If get/put fail due to hardware memory error, only the relevant processes > are affected, so killing the user process and isolate the user page with > hardware memory errors is a more

Re: [PATCH -next v4 5/7] arm64: mte: Clean up user tag accessors

2022-05-13 Thread Mark Rutland
its original posting at: https://lore.kernel.org/linux-arm-kernel/38c6d4b5-a3db-5c3e-02e7-39875edb3...@arm.com/ So: Acked-by: Mark Rutland Catalin, are you happy to pick up this patch as a cleanup? Thanks, Mark. > --- > arch/arm64/lib/mte.S | 4 ++-- > 1 file changed, 2 insertions(+),

Re: [PATCH -next v4 4/7] arm64: add copy_{to, from}_user to machine check safe

2022-05-13 Thread Mark Rutland
On Wed, Apr 20, 2022 at 03:04:15AM +, Tong Tiangen wrote: > Add copy_{to, from}_user() to machine check safe. > > If copy fail due to hardware memory error, only the relevant processes are > affected, so killing the user process and isolate the user page with > hardware memory errors is a

Re: [PATCH -next v4 3/7] arm64: add support for machine check error safe

2022-05-13 Thread Mark Rutland
On Wed, Apr 20, 2022 at 03:04:14AM +, Tong Tiangen wrote: > During the processing of arm64 kernel hardware memory errors(do_sea()), if > the errors is consumed in the kernel, the current processing is panic. > However, it is not optimal. > > Take uaccess for example, if the uaccess operation

Re: [PATCH] bug: Use normal relative pointers in 'struct bug_entry'

2022-05-06 Thread Mark Rutland
0.0, and works correctly in testing on both with the LKDTM BUG/WARNING/WARNING_MESSAGE tests, i.e. echo WARNING > /sys/kernel/debug/provoke-crash/DIRECT echo WARNING_MESSAGE > /sys/kernel/debug/provoke-crash/DIRECT echo BUG > /sys/kernel/debug/provoke-crash/DIRECT FWIW: Reviewed-by: Mark

Re: [PATCH RFC 2/8] arm64: stacktrace: Add arch_within_stack_frames

2022-04-19 Thread Mark Rutland
Hi, On Mon, Apr 18, 2022 at 09:22:11PM +0800, He Zhe wrote: > This function checks if the given address range crosses frame boundary. I don't think that's quite true, becuase arm64's procedure call standard (AAPCS64) doesn't give us enough information to determine this without additional

Re: [PATCH RFC 1/8] stacktrace: Change callback prototype to pass more information

2022-04-19 Thread Mark Rutland
On Mon, Apr 18, 2022 at 09:22:10PM +0800, He Zhe wrote: > Currently stack_trace_consume_fn can only have pc of each frame of the > stack. Copying-beyond-the-frame-detection also needs fp of current and > previous frame. Other detection algorithm in the future may need more > information of the

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread Mark Rutland
On Tue, Feb 15, 2022 at 09:30:41AM +, David Laight wrote: > From: Ard Biesheuvel > > Sent: 15 February 2022 08:18 > > > > On Mon, 14 Feb 2022 at 17:37, Arnd Bergmann wrote: > > > > > > From: Arnd Bergmann > > > > > > arm64 has an inline asm implementation of access_ok() that is derived from

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread Mark Rutland
k pointer masking) fell in the noise and really depended on what you were optimizing for. This patch itself is clear, I believe the logic is sound and does not result in a behavioural change, so for this as-is: Acked-by: Mark Rutland As on other replies, I think that if we want to make f

Re: [PATCH 07/14] uaccess: generalize access_ok()

2022-02-15 Thread Mark Rutland
er this simpler version uses > fewer registers, which means it can produce better object code in the > end despite needing a second (statically predicted) branch. > > Signed-off-by: Arnd Bergmann As discussed over IRC, the generic sequence looks good to me, and likewise for the

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread Mark Rutland
On Tue, Feb 15, 2022 at 10:39:46AM +0100, Arnd Bergmann wrote: > On Tue, Feb 15, 2022 at 10:21 AM Ard Biesheuvel wrote: > > On Tue, 15 Feb 2022 at 10:13, Arnd Bergmann wrote: > > > > arm64 also has this leading up to the range check, and I think we'd no > > longer need it: > > > > if

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread Mark Rutland
On Tue, Feb 15, 2022 at 10:21:16AM +0100, Ard Biesheuvel wrote: > On Tue, 15 Feb 2022 at 10:13, Arnd Bergmann wrote: > > > > On Tue, Feb 15, 2022 at 9:17 AM Ard Biesheuvel wrote: > > > On Mon, 14 Feb 2022 at 17:37, Arnd Bergmann wrote: > > > > From: Arnd Bergmann > > > > > > > > > > With

Re: ftrace hangs waiting for rcu

2022-01-28 Thread Mark Rutland
On Fri, Jan 28, 2022 at 05:08:48PM +0100, Sven Schnelle wrote: > Hi Mark, > > Mark Rutland writes: > > > On arm64 I bisected this down to: > > > > 7a30871b6a27de1a ("rcu-tasks: Introduce ->percpu_enqueue_shift for > > dynamic queue selection&q

Re: ftrace hangs waiting for rcu (was: Re: [PATCH] ftrace: Have architectures opt-in for mcount build time sorting)

2022-01-28 Thread Mark Rutland
Hi Sven, On Thu, Jan 27, 2022 at 07:42:35PM +0100, Sven Schnelle wrote: > Mark Rutland writes: > > > * I intermittently see a hang when running the tests. I previously hit that > > when originally trying to bisect this issue (and IIRC that bisected down > > to >

Re: [PATCH] ftrace: Have architectures opt-in for mcount build time sorting

2022-01-27 Thread Mark Rutland
t; > Also update the config to compile in build time sorting in the sorttable > code in scripts/ to depend on CONFIG_BUILDTIME_MCOUNT_SORT. > > Link: > https://lore.kernel.org/all/944d10da-8200-4ba9-8d0a-3bed9aa99...@linux.ibm.com/ > > Cc: Mark Rutland > Cc: Yinan Liu

Re: [powerpc] ftrace warning kernel/trace/ftrace.c:2068 with code-patching selftests

2022-01-27 Thread Mark Rutland
On Thu, Jan 27, 2022 at 08:55:43AM -0500, Steven Rostedt wrote: > On Thu, 27 Jan 2022 13:33:02 + > Mark Rutland wrote: > > > I want to get the regression fixed ASAP, so can we take a simple patch for > > -rc2 > > which disables the build-time sort where it's cu

Re: [powerpc] ftrace warning kernel/trace/ftrace.c:2068 with code-patching selftests

2022-01-27 Thread Mark Rutland
On Thu, Jan 27, 2022 at 02:59:31PM +0100, Ard Biesheuvel wrote: > On Thu, 27 Jan 2022 at 14:24, Mark Rutland wrote: > > > > On Thu, Jan 27, 2022 at 02:07:03PM +0100, Ard Biesheuvel wrote: > > > I suppose that on arm64, we can work around this by passing > > > --a

Re: [powerpc] ftrace warning kernel/trace/ftrace.c:2068 with code-patching selftests

2022-01-27 Thread Mark Rutland
On Thu, Jan 27, 2022 at 02:16:31PM +0100, Sven Schnelle wrote: > Mark Rutland writes: > > > On Thu, Jan 27, 2022 at 07:46:01AM -0500, Steven Rostedt wrote: > >> On Thu, 27 Jan 2022 12:27:04 +0000 > >> Mark Rutland wrote: > >> > >> > Ah, so

Re: [powerpc] ftrace warning kernel/trace/ftrace.c:2068 with code-patching selftests

2022-01-27 Thread Mark Rutland
On Thu, Jan 27, 2022 at 02:07:03PM +0100, Ard Biesheuvel wrote: > On Thu, 27 Jan 2022 at 13:59, Mark Rutland wrote: > > > > On Thu, Jan 27, 2022 at 01:22:17PM +0100, Ard Biesheuvel wrote: > > > On Thu, 27 Jan 2022 at 13:20, Mark Rutland wrote: > > > > On T

Re: [powerpc] ftrace warning kernel/trace/ftrace.c:2068 with code-patching selftests

2022-01-27 Thread Mark Rutland
On Thu, Jan 27, 2022 at 07:46:01AM -0500, Steven Rostedt wrote: > On Thu, 27 Jan 2022 12:27:04 + > Mark Rutland wrote: > > > Ah, so those non-ELF relocations for the mcount_loc table just mean "apply > > the > > KASLR offset here", which is equivalent

Re: [powerpc] ftrace warning kernel/trace/ftrace.c:2068 with code-patching selftests

2022-01-27 Thread Mark Rutland
On Thu, Jan 27, 2022 at 01:22:17PM +0100, Ard Biesheuvel wrote: > On Thu, 27 Jan 2022 at 13:20, Mark Rutland wrote: > > On Thu, Jan 27, 2022 at 01:03:34PM +0100, Ard Biesheuvel wrote: > > > > > These architectures use place-relative extables for the same reason: > &g

Re: [powerpc] ftrace warning kernel/trace/ftrace.c:2068 with code-patching selftests

2022-01-27 Thread Mark Rutland
On Thu, Jan 27, 2022 at 01:04:41PM +0100, Sven Schnelle wrote: > Mark Rutland writes: > > >> Isn't x86 relocatable in some configurations (e.g. for KASLR)? > >> > >> I can't see how the sort works for those cases, because the mcount_loc > >

Re: [powerpc] ftrace warning kernel/trace/ftrace.c:2068 with code-patching selftests

2022-01-27 Thread Mark Rutland
On Thu, Jan 27, 2022 at 01:03:34PM +0100, Ard Biesheuvel wrote: > On Thu, 27 Jan 2022 at 12:47, Mark Rutland wrote: > > > > [adding LKML so this is easier for others to find] > > > > If anyone wants to follow the thread from the start, it's at: > > > > &

Re: [powerpc] ftrace warning kernel/trace/ftrace.c:2068 with code-patching selftests

2022-01-27 Thread Mark Rutland
, but I couldn't spot where, and suspect I'm mistaken. Do you know whether it currently does any boot-time dynamic relocation? Kees, there's an x86_64 relocation question for you at the end. On Wed, Jan 26, 2022 at 02:37:16PM +, Mark Rutland wrote: > Hi, > > Steve pointed me at this th

Re: [powerpc] ftrace warning kernel/trace/ftrace.c:2068 with code-patching selftests

2022-01-26 Thread Mark Rutland
Hi, Steve pointed me at this thread over IRC -- I'm not subscribed to this list so grabbed a copy of the thread thus far via b4. On Tue, Jan 25, 2022 at 11:20:27AM +0800, Yinan Liu wrote: > > Yeah, I think it's time to opt in, instead of opting out. I agree this must be opt-in rather than

Re: [PATCH] of: unmap memory regions in /memreserve node

2021-12-02 Thread Mark Rutland
On Tue, Nov 30, 2021 at 04:43:31PM -0600, Rob Herring wrote: > +linuxppc-dev > > On Wed, Nov 24, 2021 at 09:33:47PM +0800, Calvin Zhang wrote: > > Reserved memory regions in /memreserve node aren't and shouldn't > > be referenced elsewhere. So mark them no-map to skip direct mapping > > for them.

  1   2   3   >