Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1728330 > unrolled thread
| Started by | Tycho Andersen <tycho@docker.com> |
|---|---|
| First post | 2017-09-07 19:40 +0200 |
| Last post | 2017-09-09 17:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v6 09/11] arm64/mm: disable section/contiguous mappings if XPFO is enabled Tycho Andersen <tycho@docker.com> - 2017-09-07 19:40 +0200
Re: [PATCH v6 09/11] arm64/mm: disable section/contiguous mappings if XPFO is enabled Laura Abbott <labbott@redhat.com> - 2017-09-09 17:40 +0200
| From | Tycho Andersen <tycho@docker.com> |
|---|---|
| Date | 2017-09-07 19:40 +0200 |
| Subject | [PATCH v6 09/11] arm64/mm: disable section/contiguous mappings if XPFO is enabled |
| Message-ID | <un8Wu-3e6-33@gated-at.bofh.it> |
XPFO doesn't support section/contiguous mappings yet, so let's disable it
if XPFO is turned on.
Thanks to Laura Abbot for the simplification from v5, and Mark Rutland for
pointing out we need NO_CONT_MAPPINGS too.
CC: linux-arm-kernel@lists.infradead.org
Signed-off-by: Tycho Andersen <tycho@docker.com>
---
arch/arm64/mm/mmu.c | 2 +-
include/linux/xpfo.h | 4 ++++
mm/xpfo.c | 6 ++++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index f1eb15e0e864..34bb95303cce 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -420,7 +420,7 @@ static void __init map_mem(pgd_t *pgd)
struct memblock_region *reg;
int flags = 0;
- if (debug_pagealloc_enabled())
+ if (debug_pagealloc_enabled() || xpfo_enabled())
flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
/*
diff --git a/include/linux/xpfo.h b/include/linux/xpfo.h
index d37a06c9d62c..1693af1a0293 100644
--- a/include/linux/xpfo.h
+++ b/include/linux/xpfo.h
@@ -43,6 +43,8 @@ void xpfo_temp_map(const void *addr, size_t size, void **mapping,
void xpfo_temp_unmap(const void *addr, size_t size, void **mapping,
size_t mapping_len);
+bool xpfo_enabled(void);
+
#else /* !CONFIG_XPFO */
static inline void xpfo_kmap(void *kaddr, struct page *page) { }
@@ -65,6 +67,8 @@ static inline void xpfo_temp_unmap(const void *addr, size_t size,
}
+static inline bool xpfo_enabled(void) { return false; }
+
#endif /* CONFIG_XPFO */
#endif /* _LINUX_XPFO_H */
diff --git a/mm/xpfo.c b/mm/xpfo.c
index f79075bf7d65..25fba05d01bd 100644
--- a/mm/xpfo.c
+++ b/mm/xpfo.c
@@ -70,6 +70,12 @@ struct page_ext_operations page_xpfo_ops = {
.init = init_xpfo,
};
+bool __init xpfo_enabled(void)
+{
+ return !xpfo_disabled;
+}
+EXPORT_SYMBOL(xpfo_enabled);
+
static inline struct xpfo *lookup_xpfo(struct page *page)
{
struct page_ext *page_ext = lookup_page_ext(page);
--
2.11.0
[toc] | [next] | [standalone]
| From | Laura Abbott <labbott@redhat.com> |
|---|---|
| Date | 2017-09-09 17:40 +0200 |
| Subject | Re: [PATCH v6 09/11] arm64/mm: disable section/contiguous mappings if XPFO is enabled |
| Message-ID | <unQ1s-7gf-33@gated-at.bofh.it> |
| In reply to | #1728330 |
On 09/07/2017 10:36 AM, Tycho Andersen wrote:
> XPFO doesn't support section/contiguous mappings yet, so let's disable it
> if XPFO is turned on.
>
> Thanks to Laura Abbot for the simplification from v5, and Mark Rutland for
> pointing out we need NO_CONT_MAPPINGS too.
>
> CC: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Tycho Andersen <tycho@docker.com>
This should just be folded into the initial arm64 patch
since it basically bugs out otherwise.
Thanks,
Laura
> ---
> arch/arm64/mm/mmu.c | 2 +-
> include/linux/xpfo.h | 4 ++++
> mm/xpfo.c | 6 ++++++
> 3 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> index f1eb15e0e864..34bb95303cce 100644
> --- a/arch/arm64/mm/mmu.c
> +++ b/arch/arm64/mm/mmu.c
> @@ -420,7 +420,7 @@ static void __init map_mem(pgd_t *pgd)
> struct memblock_region *reg;
> int flags = 0;
>
> - if (debug_pagealloc_enabled())
> + if (debug_pagealloc_enabled() || xpfo_enabled())
> flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
>
> /*
> diff --git a/include/linux/xpfo.h b/include/linux/xpfo.h
> index d37a06c9d62c..1693af1a0293 100644
> --- a/include/linux/xpfo.h
> +++ b/include/linux/xpfo.h
> @@ -43,6 +43,8 @@ void xpfo_temp_map(const void *addr, size_t size, void **mapping,
> void xpfo_temp_unmap(const void *addr, size_t size, void **mapping,
> size_t mapping_len);
>
> +bool xpfo_enabled(void);
> +
> #else /* !CONFIG_XPFO */
>
> static inline void xpfo_kmap(void *kaddr, struct page *page) { }
> @@ -65,6 +67,8 @@ static inline void xpfo_temp_unmap(const void *addr, size_t size,
> }
>
>
> +static inline bool xpfo_enabled(void) { return false; }
> +
> #endif /* CONFIG_XPFO */
>
> #endif /* _LINUX_XPFO_H */
> diff --git a/mm/xpfo.c b/mm/xpfo.c
> index f79075bf7d65..25fba05d01bd 100644
> --- a/mm/xpfo.c
> +++ b/mm/xpfo.c
> @@ -70,6 +70,12 @@ struct page_ext_operations page_xpfo_ops = {
> .init = init_xpfo,
> };
>
> +bool __init xpfo_enabled(void)
> +{
> + return !xpfo_disabled;
> +}
> +EXPORT_SYMBOL(xpfo_enabled);
> +
> static inline struct xpfo *lookup_xpfo(struct page *page)
> {
> struct page_ext *page_ext = lookup_page_ext(page);
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web