From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] arm64: Implement pmem API support
Date: Mon, 7 Aug 2017 19:33:39 +0100 [thread overview]
Message-ID: <20170807183338.GC29632@arm.com> (raw)
In-Reply-To: <20170804152542.7h3mbyxnhjwroddc@armageddon.cambridge.arm.com>
On Fri, Aug 04, 2017 at 04:25:42PM +0100, Catalin Marinas wrote:
> Two minor comments below.
>
> On Tue, Jul 25, 2017 at 11:55:42AM +0100, Robin Murphy wrote:
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -960,6 +960,17 @@ config ARM64_UAO
> > regular load/store instructions if the cpu does not implement the
> > feature.
> >
> > +config ARM64_PMEM
> > + bool "Enable support for persistent memory"
> > + select ARCH_HAS_PMEM_API
> > + help
> > + Say Y to enable support for the persistent memory API based on the
> > + ARMv8.2 DCPoP feature.
> > +
> > + The feature is detected at runtime, and the kernel will use DC CVAC
> > + operations if DC CVAP is not supported (following the behaviour of
> > + DC CVAP itself if the system does not define a point of persistence).
>
> Any reason not to have this default y?
>
> > --- a/arch/arm64/mm/cache.S
> > +++ b/arch/arm64/mm/cache.S
> > @@ -172,6 +172,20 @@ ENDPIPROC(__clean_dcache_area_poc)
> > ENDPROC(__dma_clean_area)
> >
> > /*
> > + * __clean_dcache_area_pop(kaddr, size)
> > + *
> > + * Ensure that any D-cache lines for the interval [kaddr, kaddr+size)
> > + * are cleaned to the PoP.
> > + *
> > + * - kaddr - kernel address
> > + * - size - size in question
> > + */
> > +ENTRY(__clean_dcache_area_pop)
> > + dcache_by_line_op cvap, sy, x0, x1, x2, x3
> > + ret
> > +ENDPIPROC(__clean_dcache_area_pop)
> > +
> > +/*
> > * __dma_flush_area(start, size)
> > *
> > * clean & invalidate D / U line
> > diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
> > index a682a0a2a0fa..a461a00ceb3e 100644
> > --- a/arch/arm64/mm/pageattr.c
> > +++ b/arch/arm64/mm/pageattr.c
> > @@ -183,3 +183,21 @@ bool kernel_page_present(struct page *page)
> > }
> > #endif /* CONFIG_HIBERNATION */
> > #endif /* CONFIG_DEBUG_PAGEALLOC */
> > +
> > +#ifdef CONFIG_ARCH_HAS_PMEM_API
> > +#include <asm/cacheflush.h>
> > +
> > +static inline void arch_wb_cache_pmem(void *addr, size_t size)
> > +{
> > + /* Ensure order against any prior non-cacheable writes */
> > + dmb(sy);
> > + __clean_dcache_area_pop(addr, size);
> > +}
>
> Could we keep the dmb() in the actual __clean_dcache_area_pop()
> implementation?
>
> I can do the changes myself if you don't have any objections.
I *think* the DMB can also be reworked to use the outer-shareable domain,
much as we do for the dma_* barriers.
Will
next prev parent reply other threads:[~2017-08-07 18:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-25 10:55 [PATCH 0/6] arm64 pmem support Robin Murphy
2017-07-25 10:55 ` [PATCH 1/6] arm64: mm: Fix set_memory_valid() declaration Robin Murphy
2017-07-25 10:55 ` [PATCH 2/6] arm64: Convert __inval_cache_range() to area-based Robin Murphy
2017-07-25 10:55 ` [PATCH 3/6] arm64: Expose DC CVAP to userspace Robin Murphy
2017-07-25 10:55 ` [PATCH 4/6] arm64: Handle trapped DC CVAP Robin Murphy
2017-07-25 10:55 ` [PATCH 5/6] arm64: Implement pmem API support Robin Murphy
2017-08-04 15:25 ` Catalin Marinas
2017-08-04 17:43 ` Robin Murphy
2017-08-04 18:09 ` Dan Williams
2017-08-04 18:35 ` Robin Murphy
2017-08-04 19:36 ` Dan Williams
2017-08-07 18:33 ` Will Deacon [this message]
2017-07-25 10:55 ` [PATCH 6/6] arm64: uaccess: Implement *_flushcache variants Robin Murphy
2017-08-07 18:32 ` Will Deacon
2017-08-10 10:58 ` Arnd Bergmann
2017-08-10 14:12 ` Catalin Marinas
2017-08-07 18:34 ` [PATCH 0/6] arm64 pmem support Will Deacon
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=20170807183338.GC29632@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).