All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miles Chen <miles.chen@mediatek.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Minchan Kim <minchan@kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-mediatek@lists.infradead.org>, <wsd_upstream@mediatek.com>,
	Will Deacon <will.deacon@arm.com>,
	Steve Capper <steve.capper@linaro.org>,
	Suren Baghdasaryan <surenb@google.com>
Subject: Re: [PATCH v2 3/4] arm: mm: introduce L_PTE_SPECIAL
Date: Sun, 1 Nov 2020 20:48:52 +0800	[thread overview]
Message-ID: <1604234932.13617.0.camel@mtkswgap22> (raw)
In-Reply-To: <20201027091151.GK1551@shell.armlinux.org.uk>

On Tue, 2020-10-27 at 09:11 +0000, Russell King - ARM Linux admin wrote:
> On Tue, Oct 27, 2020 at 03:45:12PM +0800, Miles Chen wrote:
> > On Fri, 2020-10-23 at 11:08 +0100, Russell King - ARM Linux admin wrote:
> > > On Fri, Oct 23, 2020 at 05:14:36PM +0800, Miles Chen wrote:
> > > > From: Minchan Kim <minchan@kernel.org>
> > > > 
> > > > This patch introduces L_PTE_SPECIAL and pte functions for supporting
> > > > get_user_pages_fast.
> > > > 
> > > > Cc: Russell King <linux@armlinux.org.uk>
> > > > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > > > Cc: Will Deacon <will.deacon@arm.com>
> > > > Cc: Steve Capper <steve.capper@linaro.org>
> > > > Cc: Minchan Kim <minchan@kernel.org>
> > > > Cc: Suren Baghdasaryan <surenb@google.com>
> > > > Signed-off-by: Minchan Kim <minchan@kernel.org>
> > > > Signed-off-by: Miles Chen <miles.chen@mediatek.com>
> > > > ---
> > > >  arch/arm/Kconfig                      |  4 ++--
> > > >  arch/arm/include/asm/pgtable-2level.h |  1 +
> > > >  arch/arm/include/asm/pgtable-3level.h |  6 ------
> > > >  arch/arm/include/asm/pgtable.h        | 13 +++++++++++++
> > > >  4 files changed, 16 insertions(+), 8 deletions(-)
> > > > 
> > > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > > > index c18fa9d382b7..1f75864b7c7a 100644
> > > > --- a/arch/arm/Kconfig
> > > > +++ b/arch/arm/Kconfig
> > > > @@ -13,7 +13,7 @@ config ARM
> > > >  	select ARCH_HAS_KCOV
> > > >  	select ARCH_HAS_MEMBARRIER_SYNC_CORE
> > > >  	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
> > > > -	select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
> > > > +	select ARCH_HAS_PTE_SPECIAL if (ARM_LPAE || CPU_V7 || CPU_V6 || CPUV6K)
> > > >  	select ARCH_HAS_PHYS_TO_DMA
> > > >  	select ARCH_HAS_SETUP_DMA_OPS
> > > >  	select ARCH_HAS_SET_MEMORY
> > > > @@ -82,7 +82,7 @@ config ARM
> > > >  	select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
> > > >  	select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
> > > >  	select HAVE_EXIT_THREAD
> > > > -	select HAVE_FAST_GUP if ARM_LPAE
> > > > +	select HAVE_FAST_GUP if (ARM_LPAE || CPU_V7 || CPU_V6 || CPUV6K)
> > > >  	select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
> > > >  	select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG
> > > >  	select HAVE_FUNCTION_TRACER if !XIP_KERNEL
> > > > diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h
> > > > index cdcd55cca37d..385e7a32394e 100644
> > > > --- a/arch/arm/include/asm/pgtable-2level.h
> > > > +++ b/arch/arm/include/asm/pgtable-2level.h
> > > > @@ -117,6 +117,7 @@
> > > >  #define L_PTE_VALID		(_AT(pteval_t, 1) << 0)		/* Valid */
> > > >  #define L_PTE_PRESENT		(_AT(pteval_t, 1) << 0)
> > > >  #define L_PTE_YOUNG		(_AT(pteval_t, 1) << 1)
> > > > +#define L_PTE_SPECIAL		(_AT(pteval_t, 1) << 5)
> > > 
> > > How does this work?  Bits 2 through 5 are already in use for the memory
> > > type.
> > > 
> > > Repurposing this bit means that L_PTE_MT_DEV_NONSHARED,
> > > L_PTE_MT_DEV_WC, L_PTE_MT_DEV_CACHED and L_PTE_MT_VECTORS clash with
> > > it.
> > 
> > Thanks for the comment.
> > The idea is to re-order the memory type table in [1] (patch v2/4) and
> > use bit 5 for L_PTE_SPECIAL.
> 
> Thanks, I know what you are trying to achieve. I don't think it's
> possible without breaking the kernel on some CPUs and configurations.
> 
Got it. Thanks for your review.


Miles

WARNING: multiple messages have this Message-ID (diff)
From: Miles Chen <miles.chen@mediatek.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Steve Capper <steve.capper@linaro.org>,
	wsd_upstream@mediatek.com,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org, Minchan Kim <minchan@kernel.org>,
	linux-mediatek@lists.infradead.org,
	Suren Baghdasaryan <surenb@google.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 3/4] arm: mm: introduce L_PTE_SPECIAL
Date: Sun, 1 Nov 2020 20:48:52 +0800	[thread overview]
Message-ID: <1604234932.13617.0.camel@mtkswgap22> (raw)
In-Reply-To: <20201027091151.GK1551@shell.armlinux.org.uk>

On Tue, 2020-10-27 at 09:11 +0000, Russell King - ARM Linux admin wrote:
> On Tue, Oct 27, 2020 at 03:45:12PM +0800, Miles Chen wrote:
> > On Fri, 2020-10-23 at 11:08 +0100, Russell King - ARM Linux admin wrote:
> > > On Fri, Oct 23, 2020 at 05:14:36PM +0800, Miles Chen wrote:
> > > > From: Minchan Kim <minchan@kernel.org>
> > > > 
> > > > This patch introduces L_PTE_SPECIAL and pte functions for supporting
> > > > get_user_pages_fast.
> > > > 
> > > > Cc: Russell King <linux@armlinux.org.uk>
> > > > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > > > Cc: Will Deacon <will.deacon@arm.com>
> > > > Cc: Steve Capper <steve.capper@linaro.org>
> > > > Cc: Minchan Kim <minchan@kernel.org>
> > > > Cc: Suren Baghdasaryan <surenb@google.com>
> > > > Signed-off-by: Minchan Kim <minchan@kernel.org>
> > > > Signed-off-by: Miles Chen <miles.chen@mediatek.com>
> > > > ---
> > > >  arch/arm/Kconfig                      |  4 ++--
> > > >  arch/arm/include/asm/pgtable-2level.h |  1 +
> > > >  arch/arm/include/asm/pgtable-3level.h |  6 ------
> > > >  arch/arm/include/asm/pgtable.h        | 13 +++++++++++++
> > > >  4 files changed, 16 insertions(+), 8 deletions(-)
> > > > 
> > > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > > > index c18fa9d382b7..1f75864b7c7a 100644
> > > > --- a/arch/arm/Kconfig
> > > > +++ b/arch/arm/Kconfig
> > > > @@ -13,7 +13,7 @@ config ARM
> > > >  	select ARCH_HAS_KCOV
> > > >  	select ARCH_HAS_MEMBARRIER_SYNC_CORE
> > > >  	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
> > > > -	select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
> > > > +	select ARCH_HAS_PTE_SPECIAL if (ARM_LPAE || CPU_V7 || CPU_V6 || CPUV6K)
> > > >  	select ARCH_HAS_PHYS_TO_DMA
> > > >  	select ARCH_HAS_SETUP_DMA_OPS
> > > >  	select ARCH_HAS_SET_MEMORY
> > > > @@ -82,7 +82,7 @@ config ARM
> > > >  	select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
> > > >  	select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
> > > >  	select HAVE_EXIT_THREAD
> > > > -	select HAVE_FAST_GUP if ARM_LPAE
> > > > +	select HAVE_FAST_GUP if (ARM_LPAE || CPU_V7 || CPU_V6 || CPUV6K)
> > > >  	select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
> > > >  	select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG
> > > >  	select HAVE_FUNCTION_TRACER if !XIP_KERNEL
> > > > diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h
> > > > index cdcd55cca37d..385e7a32394e 100644
> > > > --- a/arch/arm/include/asm/pgtable-2level.h
> > > > +++ b/arch/arm/include/asm/pgtable-2level.h
> > > > @@ -117,6 +117,7 @@
> > > >  #define L_PTE_VALID		(_AT(pteval_t, 1) << 0)		/* Valid */
> > > >  #define L_PTE_PRESENT		(_AT(pteval_t, 1) << 0)
> > > >  #define L_PTE_YOUNG		(_AT(pteval_t, 1) << 1)
> > > > +#define L_PTE_SPECIAL		(_AT(pteval_t, 1) << 5)
> > > 
> > > How does this work?  Bits 2 through 5 are already in use for the memory
> > > type.
> > > 
> > > Repurposing this bit means that L_PTE_MT_DEV_NONSHARED,
> > > L_PTE_MT_DEV_WC, L_PTE_MT_DEV_CACHED and L_PTE_MT_VECTORS clash with
> > > it.
> > 
> > Thanks for the comment.
> > The idea is to re-order the memory type table in [1] (patch v2/4) and
> > use bit 5 for L_PTE_SPECIAL.
> 
> Thanks, I know what you are trying to achieve. I don't think it's
> possible without breaking the kernel on some CPUs and configurations.
> 
Got it. Thanks for your review.


Miles
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Miles Chen <miles.chen@mediatek.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Steve Capper <steve.capper@linaro.org>,
	wsd_upstream@mediatek.com,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org, Minchan Kim <minchan@kernel.org>,
	linux-mediatek@lists.infradead.org,
	Suren Baghdasaryan <surenb@google.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 3/4] arm: mm: introduce L_PTE_SPECIAL
Date: Sun, 1 Nov 2020 20:48:52 +0800	[thread overview]
Message-ID: <1604234932.13617.0.camel@mtkswgap22> (raw)
In-Reply-To: <20201027091151.GK1551@shell.armlinux.org.uk>

On Tue, 2020-10-27 at 09:11 +0000, Russell King - ARM Linux admin wrote:
> On Tue, Oct 27, 2020 at 03:45:12PM +0800, Miles Chen wrote:
> > On Fri, 2020-10-23 at 11:08 +0100, Russell King - ARM Linux admin wrote:
> > > On Fri, Oct 23, 2020 at 05:14:36PM +0800, Miles Chen wrote:
> > > > From: Minchan Kim <minchan@kernel.org>
> > > > 
> > > > This patch introduces L_PTE_SPECIAL and pte functions for supporting
> > > > get_user_pages_fast.
> > > > 
> > > > Cc: Russell King <linux@armlinux.org.uk>
> > > > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > > > Cc: Will Deacon <will.deacon@arm.com>
> > > > Cc: Steve Capper <steve.capper@linaro.org>
> > > > Cc: Minchan Kim <minchan@kernel.org>
> > > > Cc: Suren Baghdasaryan <surenb@google.com>
> > > > Signed-off-by: Minchan Kim <minchan@kernel.org>
> > > > Signed-off-by: Miles Chen <miles.chen@mediatek.com>
> > > > ---
> > > >  arch/arm/Kconfig                      |  4 ++--
> > > >  arch/arm/include/asm/pgtable-2level.h |  1 +
> > > >  arch/arm/include/asm/pgtable-3level.h |  6 ------
> > > >  arch/arm/include/asm/pgtable.h        | 13 +++++++++++++
> > > >  4 files changed, 16 insertions(+), 8 deletions(-)
> > > > 
> > > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > > > index c18fa9d382b7..1f75864b7c7a 100644
> > > > --- a/arch/arm/Kconfig
> > > > +++ b/arch/arm/Kconfig
> > > > @@ -13,7 +13,7 @@ config ARM
> > > >  	select ARCH_HAS_KCOV
> > > >  	select ARCH_HAS_MEMBARRIER_SYNC_CORE
> > > >  	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
> > > > -	select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
> > > > +	select ARCH_HAS_PTE_SPECIAL if (ARM_LPAE || CPU_V7 || CPU_V6 || CPUV6K)
> > > >  	select ARCH_HAS_PHYS_TO_DMA
> > > >  	select ARCH_HAS_SETUP_DMA_OPS
> > > >  	select ARCH_HAS_SET_MEMORY
> > > > @@ -82,7 +82,7 @@ config ARM
> > > >  	select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
> > > >  	select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
> > > >  	select HAVE_EXIT_THREAD
> > > > -	select HAVE_FAST_GUP if ARM_LPAE
> > > > +	select HAVE_FAST_GUP if (ARM_LPAE || CPU_V7 || CPU_V6 || CPUV6K)
> > > >  	select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
> > > >  	select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG
> > > >  	select HAVE_FUNCTION_TRACER if !XIP_KERNEL
> > > > diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h
> > > > index cdcd55cca37d..385e7a32394e 100644
> > > > --- a/arch/arm/include/asm/pgtable-2level.h
> > > > +++ b/arch/arm/include/asm/pgtable-2level.h
> > > > @@ -117,6 +117,7 @@
> > > >  #define L_PTE_VALID		(_AT(pteval_t, 1) << 0)		/* Valid */
> > > >  #define L_PTE_PRESENT		(_AT(pteval_t, 1) << 0)
> > > >  #define L_PTE_YOUNG		(_AT(pteval_t, 1) << 1)
> > > > +#define L_PTE_SPECIAL		(_AT(pteval_t, 1) << 5)
> > > 
> > > How does this work?  Bits 2 through 5 are already in use for the memory
> > > type.
> > > 
> > > Repurposing this bit means that L_PTE_MT_DEV_NONSHARED,
> > > L_PTE_MT_DEV_WC, L_PTE_MT_DEV_CACHED and L_PTE_MT_VECTORS clash with
> > > it.
> > 
> > Thanks for the comment.
> > The idea is to re-order the memory type table in [1] (patch v2/4) and
> > use bit 5 for L_PTE_SPECIAL.
> 
> Thanks, I know what you are trying to achieve. I don't think it's
> possible without breaking the kernel on some CPUs and configurations.
> 
Got it. Thanks for your review.


Miles
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-11-01 12:48 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23  9:14 [PATCH v2 0/4] arm: support get_user_pages_fast Miles Chen
2020-10-23  9:14 ` Miles Chen
2020-10-23  9:14 ` Miles Chen
2020-10-23  9:14 ` [PATCH v2 1/4] arm: mm: use strict p[gum]d types Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23  9:14 ` [PATCH v2 2/4] arm: mm: reordering memory type table Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23 10:16   ` Russell King - ARM Linux admin
2020-10-23 10:16     ` Russell King - ARM Linux admin
2020-10-23 10:16     ` Russell King - ARM Linux admin
2020-10-27  8:03     ` Miles Chen
2020-10-27  8:03       ` Miles Chen
2020-10-27  8:03       ` Miles Chen
2020-10-23  9:14 ` [PATCH v2 3/4] arm: mm: introduce L_PTE_SPECIAL Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23 10:08   ` Russell King - ARM Linux admin
2020-10-23 10:08     ` Russell King - ARM Linux admin
2020-10-23 10:08     ` Russell King - ARM Linux admin
2020-10-27  7:45     ` Miles Chen
2020-10-27  7:45       ` Miles Chen
2020-10-27  7:45       ` Miles Chen
2020-10-27  9:11       ` Russell King - ARM Linux admin
2020-10-27  9:11         ` Russell King - ARM Linux admin
2020-10-27  9:11         ` Russell King - ARM Linux admin
2020-11-01 12:48         ` Miles Chen [this message]
2020-11-01 12:48           ` Miles Chen
2020-11-01 12:48           ` Miles Chen
2020-10-23  9:14 ` [PATCH v2 4/4] arm: replace vector mem type with read-only type Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23  9:14   ` Miles Chen
2020-10-23 10:12   ` Russell King - ARM Linux admin
2020-10-23 10:12     ` Russell King - ARM Linux admin
2020-10-23 10:12     ` Russell King - ARM Linux admin
2020-10-27  7:41     ` Miles Chen
2020-10-27  7:41       ` Miles Chen
2020-10-27  7:41       ` Miles Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1604234932.13617.0.camel@mtkswgap22 \
    --to=miles.chen@mediatek.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=minchan@kernel.org \
    --cc=steve.capper@linaro.org \
    --cc=surenb@google.com \
    --cc=will.deacon@arm.com \
    --cc=wsd_upstream@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.