From: ross.zwisler@linux.intel.com (Ross Zwisler)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 24/24] pmem: convert to generic memremap
Date: Mon, 03 Aug 2015 11:21:27 -0600 [thread overview]
Message-ID: <1438622487.9404.2.camel@linux.intel.com> (raw)
In-Reply-To: <20150730165553.33962.20257.stgit@dwillia2-desk3.amr.corp.intel.com>
On Thu, 2015-07-30 at 12:55 -0400, Dan Williams wrote:
> Update memremap_pmem() to query the architecture for the mapping type of
> the given persistent memory range and then pass those flags to generic
> memremap(). arch_memremap_pmem_flags() is provided an address range to
> evaluate in the event an arch has a need for different mapping types by
> address range. For example the ACPI NFIT carries EFI mapping types in
> its memory range description table.
>
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> arch/x86/include/asm/io.h | 2 +-
> arch/x86/mm/ioremap.c | 16 ++++++++++------
> include/linux/pmem.h | 26 +++++++++++++++-----------
> 3 files changed, 26 insertions(+), 18 deletions(-)
>
> diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
> index 1a9d44ee9ed0..26c81b01419c 100644
> --- a/arch/x86/include/asm/io.h
> +++ b/arch/x86/include/asm/io.h
> @@ -245,7 +245,7 @@ static inline void flush_write_buffers(void)
> #endif
> }
>
> -void __pmem *arch_memremap_pmem(resource_size_t offset, size_t size);
> +unsigned long arch_memremap_pmem_flags(resource_size_t offset, size_t size);
> #endif /* __KERNEL__ */
>
> extern void native_io_delay(void);
> diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
> index ffbfcf2e701b..5a41e3e4ea1e 100644
> --- a/arch/x86/mm/ioremap.c
> +++ b/arch/x86/mm/ioremap.c
> @@ -205,6 +205,16 @@ err_free_memtype:
> return NULL;
> }
>
> +unsigned long arch_memremap_pmem_flags(resource_size_t offset, size_t size)
> +{
> + /*
> + * TODO: check the mapping type provided by platform firmware,
> + * per range.
> + */
> + return MEMREMAP_WB;
> +}
> +EXPORT_SYMBOL(arch_memremap_pmem_flags);
I'm not sure that the architecture code has the right information to be able
to tell the caller what the correct mapping is.
I think what you are ultimately looking for is the "Address Range Memory
Mapping Attribute" found in the System Physical Address Range Structure of the
NFIT, right? (ACPI 6.0, table 5-128) How can we get to that structure from
nfit-independent architecture code like arch_memremap_pmem_flags()? It seems
like that if we want to make the mapping type dynamic we should get the flags
from ND when the SPA range is provided by ND, and provide a reasonable default
(WB, it seems) when we are dealing with legacy PMEM? If PMEM had the flag
from whatever source, it could then pass it in to memremap_pmem(), and get a
mapping of the appropriate caching.
Another option of course is to just ignore the mapping attribute in the NFIT
like we've been doing, and just say "we know WB will be good enough", and
remove the TODO.
next prev parent reply other threads:[~2015-08-03 17:21 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-30 16:53 [PATCH v3 00/24] replace ioremap_{cache|wt} with memremap Dan Williams
2015-07-30 16:53 ` [PATCH v3 01/24] mm: enhance region_is_ram() to region_intersects() Dan Williams
2015-07-30 20:42 ` Luis R. Rodriguez
2015-07-30 20:44 ` Dan Williams
2015-07-30 20:54 ` Luis R. Rodriguez
2015-07-30 20:59 ` Dan Williams
2015-07-30 21:10 ` Luis R. Rodriguez
2015-07-30 20:58 ` Luis R. Rodriguez
2015-07-30 16:53 ` [PATCH v3 02/24] arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead Dan Williams
2015-07-30 16:53 ` [PATCH v3 03/24] cleanup IORESOURCE_CACHEABLE vs ioremap() Dan Williams
2015-07-30 16:54 ` [PATCH v3 04/24] intel_iommu: fix leaked ioremap mapping Dan Williams
2015-08-03 14:26 ` Joerg Roedel
2015-07-30 16:54 ` [PATCH v3 05/24] arch: introduce memremap() Dan Williams
2015-07-30 21:02 ` Luis R. Rodriguez
2015-07-30 21:11 ` Dan Williams
2015-07-30 16:54 ` [PATCH v3 06/24] arm: switch from ioremap_cache to memremap Dan Williams
2015-07-30 16:54 ` [PATCH v3 07/24] x86: " Dan Williams
2015-07-30 16:54 ` [PATCH v3 08/24] gma500: switch from acpi_os_ioremap " Dan Williams
2015-07-30 16:54 ` [PATCH v3 09/24] i915: " Dan Williams
2015-07-30 16:54 ` [PATCH v3 10/24] acpi: switch from ioremap_cache " Dan Williams
2015-07-30 16:54 ` [PATCH v3 11/24] toshiba laptop: replace ioremap_cache with ioremap Dan Williams
2015-07-30 16:54 ` [PATCH v3 12/24] memconsole: fix __iomem mishandling, switch to memremap Dan Williams
2015-07-30 16:54 ` [PATCH v3 13/24] visorbus: switch from ioremap_cache " Dan Williams
2015-08-06 0:27 ` Greg Kroah-Hartman
2015-07-30 16:54 ` [PATCH v3 14/24] intel-iommu: " Dan Williams
2015-07-30 16:55 ` [PATCH v3 15/24] libnvdimm, pmem: push call to ioremap_cache out of line Dan Williams
2015-07-30 16:55 ` [PATCH v3 16/24] pxa2xx-flash: switch from ioremap_cache to memremap Dan Williams
2015-07-30 16:55 ` [PATCH v3 17/24] sfi: " Dan Williams
2015-07-30 16:55 ` [PATCH v3 18/24] fbdev: switch from ioremap_wt " Dan Williams
2015-07-30 16:55 ` [PATCH v3 19/24] pmem: " Dan Williams
2015-07-30 16:55 ` [PATCH v3 20/24] arch: kill ioremap_cached() Dan Williams
2015-07-30 16:55 ` [PATCH v3 21/24] arch: kill ioremap_fullcache() Dan Williams
2015-07-30 16:55 ` [PATCH v3 22/24] arch: remove ioremap_cache, replace with arch_memremap Dan Williams
2015-07-30 16:55 ` [PATCH v3 23/24] arch: remove ioremap_wt, optionally " Dan Williams
2015-07-30 16:55 ` [PATCH v3 24/24] pmem: convert to generic memremap Dan Williams
2015-08-03 17:21 ` Ross Zwisler [this message]
2015-08-03 18:01 ` Dan Williams
2015-08-04 16:53 ` Ross Zwisler
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=1438622487.9404.2.camel@linux.intel.com \
--to=ross.zwisler@linux.intel.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).