All of lore.kernel.org
 help / color / mirror / Atom feed
From: aneesh.kumar@linux.vnet.ibm.com (Aneesh Kumar K.V)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/7] mm: kasan: introduce generic kasan_populate_zero_shadow()
Date: Mon, 10 Aug 2015 11:31:12 +0530	[thread overview]
Message-ID: <87mvxzptqv.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1437756119-12817-3-git-send-email-a.ryabinin@samsung.com>

Andrey Ryabinin <a.ryabinin@samsung.com> writes:

> Introduce generic kasan_populate_zero_shadow(start, end).
> This function maps kasan_zero_page to the [start, end] addresses.
>
> In follow on patches it will be used for ARMv8 (and maybe other
> architectures) and will replace x86_64 specific populate_zero_shadow().
>
> Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>

This assume that we can have shared pgtable_t in generic code ? Is that
true for generic code ? Even if it is we may want to allow some arch to
override this ? On ppc64, we store the hardware hash page table slot
number in pte_t, Hence we won't be able to share pgtable_t. 



> ---
>  arch/x86/mm/kasan_init_64.c |  14 ----
>  include/linux/kasan.h       |   8 +++
>  mm/kasan/Makefile           |   2 +-
>  mm/kasan/kasan_init.c       | 151 ++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 160 insertions(+), 15 deletions(-)
>  create mode 100644 mm/kasan/kasan_init.c
>
> diff --git a/arch/x86/mm/kasan_init_64.c b/arch/x86/mm/kasan_init_64.c
> index e1840f3..812086c 100644
> --- a/arch/x86/mm/kasan_init_64.c
> +++ b/arch/x86/mm/kasan_init_64.c
> @@ -12,20 +12,6 @@
>  extern pgd_t early_level4_pgt[PTRS_PER_PGD];
>  extern struct range pfn_mapped[E820_X_MAX];
>  
> -static pud_t kasan_zero_pud[PTRS_PER_PUD] __page_aligned_bss;
> -static pmd_t kasan_zero_pmd[PTRS_PER_PMD] __page_aligned_bss;
> -static pte_t kasan_zero_pte[PTRS_PER_PTE] __page_aligned_bss;
> -
> -/*

-aneesh

WARNING: multiple messages have this Message-ID (diff)
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Andrey Ryabinin <a.ryabinin@samsung.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	linux-arm-kernel@lists.infradead.org
Cc: Arnd Bergmann <arnd@arndb.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	David Keitel <dkeitel@codeaurora.org>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dmitry Vyukov <dvyukov@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Alexey Klimov <klimov.linux@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org
Subject: Re: [PATCH v4 2/7] mm: kasan: introduce generic kasan_populate_zero_shadow()
Date: Mon, 10 Aug 2015 11:31:12 +0530	[thread overview]
Message-ID: <87mvxzptqv.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1437756119-12817-3-git-send-email-a.ryabinin@samsung.com>

Andrey Ryabinin <a.ryabinin@samsung.com> writes:

> Introduce generic kasan_populate_zero_shadow(start, end).
> This function maps kasan_zero_page to the [start, end] addresses.
>
> In follow on patches it will be used for ARMv8 (and maybe other
> architectures) and will replace x86_64 specific populate_zero_shadow().
>
> Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>

This assume that we can have shared pgtable_t in generic code ? Is that
true for generic code ? Even if it is we may want to allow some arch to
override this ? On ppc64, we store the hardware hash page table slot
number in pte_t, Hence we won't be able to share pgtable_t. 



> ---
>  arch/x86/mm/kasan_init_64.c |  14 ----
>  include/linux/kasan.h       |   8 +++
>  mm/kasan/Makefile           |   2 +-
>  mm/kasan/kasan_init.c       | 151 ++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 160 insertions(+), 15 deletions(-)
>  create mode 100644 mm/kasan/kasan_init.c
>
> diff --git a/arch/x86/mm/kasan_init_64.c b/arch/x86/mm/kasan_init_64.c
> index e1840f3..812086c 100644
> --- a/arch/x86/mm/kasan_init_64.c
> +++ b/arch/x86/mm/kasan_init_64.c
> @@ -12,20 +12,6 @@
>  extern pgd_t early_level4_pgt[PTRS_PER_PGD];
>  extern struct range pfn_mapped[E820_X_MAX];
>  
> -static pud_t kasan_zero_pud[PTRS_PER_PUD] __page_aligned_bss;
> -static pmd_t kasan_zero_pmd[PTRS_PER_PMD] __page_aligned_bss;
> -static pte_t kasan_zero_pte[PTRS_PER_PTE] __page_aligned_bss;
> -
> -/*

-aneesh

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Andrey Ryabinin <a.ryabinin@samsung.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	linux-arm-kernel@lists.infradead.org
Cc: Arnd Bergmann <arnd@arndb.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	David Keitel <dkeitel@codeaurora.org>,
	Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dmitry Vyukov <dvyukov@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Alexey Klimov <klimov.linux@gmail.com>,
	Andrey Ryabinin <a.ryabinin@samsung.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org
Subject: Re: [PATCH v4 2/7] mm: kasan: introduce generic kasan_populate_zero_shadow()
Date: Mon, 10 Aug 2015 11:31:12 +0530	[thread overview]
Message-ID: <87mvxzptqv.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1437756119-12817-3-git-send-email-a.ryabinin@samsung.com>

Andrey Ryabinin <a.ryabinin@samsung.com> writes:

> Introduce generic kasan_populate_zero_shadow(start, end).
> This function maps kasan_zero_page to the [start, end] addresses.
>
> In follow on patches it will be used for ARMv8 (and maybe other
> architectures) and will replace x86_64 specific populate_zero_shadow().
>
> Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>

This assume that we can have shared pgtable_t in generic code ? Is that
true for generic code ? Even if it is we may want to allow some arch to
override this ? On ppc64, we store the hardware hash page table slot
number in pte_t, Hence we won't be able to share pgtable_t. 



> ---
>  arch/x86/mm/kasan_init_64.c |  14 ----
>  include/linux/kasan.h       |   8 +++
>  mm/kasan/Makefile           |   2 +-
>  mm/kasan/kasan_init.c       | 151 ++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 160 insertions(+), 15 deletions(-)
>  create mode 100644 mm/kasan/kasan_init.c
>
> diff --git a/arch/x86/mm/kasan_init_64.c b/arch/x86/mm/kasan_init_64.c
> index e1840f3..812086c 100644
> --- a/arch/x86/mm/kasan_init_64.c
> +++ b/arch/x86/mm/kasan_init_64.c
> @@ -12,20 +12,6 @@
>  extern pgd_t early_level4_pgt[PTRS_PER_PGD];
>  extern struct range pfn_mapped[E820_X_MAX];
>  
> -static pud_t kasan_zero_pud[PTRS_PER_PUD] __page_aligned_bss;
> -static pmd_t kasan_zero_pmd[PTRS_PER_PMD] __page_aligned_bss;
> -static pte_t kasan_zero_pte[PTRS_PER_PTE] __page_aligned_bss;
> -
> -/*

-aneesh


  parent reply	other threads:[~2015-08-10  6:01 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 16:41 [PATCH v4 0/7] KASAN for arm64 Andrey Ryabinin
2015-07-24 16:41 ` Andrey Ryabinin
2015-07-24 16:41 ` Andrey Ryabinin
2015-07-24 16:41 ` [PATCH v4 1/7] x86/kasan: generate KASAN_SHADOW_OFFSET in Makefile Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-27 16:40   ` Catalin Marinas
2015-07-27 16:40     ` Catalin Marinas
2015-07-27 16:40     ` Catalin Marinas
2015-07-27 17:52     ` Andrey Ryabinin
2015-07-27 17:52       ` Andrey Ryabinin
2015-07-27 17:52       ` Andrey Ryabinin
2015-07-24 16:41 ` [PATCH v4 2/7] mm: kasan: introduce generic kasan_populate_zero_shadow() Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-27 14:23   ` Yury
2015-07-27 14:23     ` Yury
2015-07-27 14:23     ` Yury
2015-07-27 17:52     ` Andrey Ryabinin
2015-07-27 17:52       ` Andrey Ryabinin
2015-07-27 17:52       ` Andrey Ryabinin
2015-08-10  6:01   ` Aneesh Kumar K.V [this message]
2015-08-10  6:01     ` Aneesh Kumar K.V
2015-08-10  6:01     ` Aneesh Kumar K.V
2015-08-10 12:00     ` Andrey Ryabinin
2015-08-10 12:00       ` Andrey Ryabinin
2015-08-10 12:00       ` Andrey Ryabinin
2015-07-24 16:41 ` [PATCH v4 3/7] arm64: introduce VA_START macro - the first kernel virtual address Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-24 16:41 ` [PATCH v4 4/7] arm64: move PGD_SIZE definition to pgalloc.h Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-24 16:41 ` [PATCH v4 5/7] arm64: add KASAN support Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-27 15:59   ` Catalin Marinas
2015-07-27 15:59     ` Catalin Marinas
2015-07-27 15:59     ` Catalin Marinas
2015-07-27 17:53     ` Andrey Ryabinin
2015-07-27 17:53       ` Andrey Ryabinin
2015-07-27 17:53       ` Andrey Ryabinin
2015-07-24 16:41 ` [PATCH v4 6/7] ARM64: kasan: print memory assignment Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-24 16:41 ` [PATCH v4 7/7] x86/kasan: switch to generic kasan_populate_zero_shadow() Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-24 16:41   ` Andrey Ryabinin
2015-07-27 16:57   ` Catalin Marinas
2015-07-27 16:57     ` Catalin Marinas
2015-07-27 16:57     ` Catalin Marinas
2015-07-27 17:53     ` Andrey Ryabinin
2015-07-27 17:53       ` Andrey Ryabinin
2015-07-27 17:53       ` Andrey Ryabinin
2015-07-27  8:13 ` [PATCH v4 0/7] KASAN for arm64 Andrey Ryabinin
2015-07-27  8:13   ` Andrey Ryabinin
2015-07-27  8:13   ` Andrey Ryabinin

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=87mvxzptqv.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.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 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.