From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Daniel Axtens <dja@axtens.net>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linuxppc-dev@lists.ozlabs.org, kasan-dev@googlegroups.com,
aneesh.kumar@linux.ibm.com, bsingharora@gmail.com
Cc: Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH v6 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support
Date: Wed, 12 Feb 2020 07:35:32 +0100 [thread overview]
Message-ID: <224745f3-db66-fe46-1459-d1d41867b4f3@c-s.fr> (raw)
In-Reply-To: <20200212054724.7708-5-dja@axtens.net>
Le 12/02/2020 à 06:47, Daniel Axtens a écrit :
> diff --git a/arch/powerpc/include/asm/kasan.h b/arch/powerpc/include/asm/kasan.h
> index fbff9ff9032e..2911fdd3a6a0 100644
> --- a/arch/powerpc/include/asm/kasan.h
> +++ b/arch/powerpc/include/asm/kasan.h
> @@ -2,6 +2,8 @@
> #ifndef __ASM_KASAN_H
> #define __ASM_KASAN_H
>
> +#include <asm/page.h>
> +
> #ifdef CONFIG_KASAN
> #define _GLOBAL_KASAN(fn) _GLOBAL(__##fn)
> #define _GLOBAL_TOC_KASAN(fn) _GLOBAL_TOC(__##fn)
> @@ -14,29 +16,41 @@
>
> #ifndef __ASSEMBLY__
>
> -#include <asm/page.h>
> -
> #define KASAN_SHADOW_SCALE_SHIFT 3
>
> #define KASAN_SHADOW_START (KASAN_SHADOW_OFFSET + \
> (PAGE_OFFSET >> KASAN_SHADOW_SCALE_SHIFT))
>
> +#ifdef CONFIG_KASAN_SHADOW_OFFSET
> #define KASAN_SHADOW_OFFSET ASM_CONST(CONFIG_KASAN_SHADOW_OFFSET)
> +#endif
>
> +#ifdef CONFIG_PPC32
> #define KASAN_SHADOW_END 0UL
>
> -#define KASAN_SHADOW_SIZE (KASAN_SHADOW_END - KASAN_SHADOW_START)
> +#ifdef CONFIG_KASAN
> +void kasan_late_init(void);
> +#else
> +static inline void kasan_late_init(void) { }
> +#endif
> +
> +#endif
> +
> +#ifdef CONFIG_PPC_BOOK3S_64
> +#define KASAN_SHADOW_END (KASAN_SHADOW_OFFSET + \
> + (RADIX_VMEMMAP_END >> KASAN_SHADOW_SCALE_SHIFT))
> +
> +static inline void kasan_late_init(void) { }
> +#endif
>
> #ifdef CONFIG_KASAN
> void kasan_early_init(void);
> void kasan_mmu_init(void);
> void kasan_init(void);
> -void kasan_late_init(void);
> #else
> static inline void kasan_init(void) { }
> static inline void kasan_mmu_init(void) { }
> -static inline void kasan_late_init(void) { }
> #endif
Why modify all this kasan_late_init() stuff ?
This function is only called from kasan init_32.c, it is never called by
PPC64, so you should not need to modify anything at all.
Christophe
WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Daniel Axtens <dja@axtens.net>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linuxppc-dev@lists.ozlabs.org, kasan-dev@googlegroups.com,
aneesh.kumar@linux.ibm.com, bsingharora@gmail.com
Subject: Re: [PATCH v6 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support
Date: Wed, 12 Feb 2020 07:35:32 +0100 [thread overview]
Message-ID: <224745f3-db66-fe46-1459-d1d41867b4f3@c-s.fr> (raw)
In-Reply-To: <20200212054724.7708-5-dja@axtens.net>
Le 12/02/2020 à 06:47, Daniel Axtens a écrit :
> diff --git a/arch/powerpc/include/asm/kasan.h b/arch/powerpc/include/asm/kasan.h
> index fbff9ff9032e..2911fdd3a6a0 100644
> --- a/arch/powerpc/include/asm/kasan.h
> +++ b/arch/powerpc/include/asm/kasan.h
> @@ -2,6 +2,8 @@
> #ifndef __ASM_KASAN_H
> #define __ASM_KASAN_H
>
> +#include <asm/page.h>
> +
> #ifdef CONFIG_KASAN
> #define _GLOBAL_KASAN(fn) _GLOBAL(__##fn)
> #define _GLOBAL_TOC_KASAN(fn) _GLOBAL_TOC(__##fn)
> @@ -14,29 +16,41 @@
>
> #ifndef __ASSEMBLY__
>
> -#include <asm/page.h>
> -
> #define KASAN_SHADOW_SCALE_SHIFT 3
>
> #define KASAN_SHADOW_START (KASAN_SHADOW_OFFSET + \
> (PAGE_OFFSET >> KASAN_SHADOW_SCALE_SHIFT))
>
> +#ifdef CONFIG_KASAN_SHADOW_OFFSET
> #define KASAN_SHADOW_OFFSET ASM_CONST(CONFIG_KASAN_SHADOW_OFFSET)
> +#endif
>
> +#ifdef CONFIG_PPC32
> #define KASAN_SHADOW_END 0UL
>
> -#define KASAN_SHADOW_SIZE (KASAN_SHADOW_END - KASAN_SHADOW_START)
> +#ifdef CONFIG_KASAN
> +void kasan_late_init(void);
> +#else
> +static inline void kasan_late_init(void) { }
> +#endif
> +
> +#endif
> +
> +#ifdef CONFIG_PPC_BOOK3S_64
> +#define KASAN_SHADOW_END (KASAN_SHADOW_OFFSET + \
> + (RADIX_VMEMMAP_END >> KASAN_SHADOW_SCALE_SHIFT))
> +
> +static inline void kasan_late_init(void) { }
> +#endif
>
> #ifdef CONFIG_KASAN
> void kasan_early_init(void);
> void kasan_mmu_init(void);
> void kasan_init(void);
> -void kasan_late_init(void);
> #else
> static inline void kasan_init(void) { }
> static inline void kasan_mmu_init(void) { }
> -static inline void kasan_late_init(void) { }
> #endif
Why modify all this kasan_late_init() stuff ?
This function is only called from kasan init_32.c, it is never called by
PPC64, so you should not need to modify anything at all.
Christophe
next prev parent reply other threads:[~2020-02-12 6:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-12 5:47 [PATCH v6 0/4] KASAN for powerpc64 radix Daniel Axtens
2020-02-12 5:47 ` [PATCH v6 1/4] kasan: define and use MAX_PTRS_PER_* for early shadow tables Daniel Axtens
2020-02-12 5:47 ` [PATCH v6 2/4] kasan: Document support on 32-bit powerpc Daniel Axtens
2020-02-12 5:47 ` [PATCH v6 3/4] powerpc/mm/kasan: rename kasan_init_32.c to init_32.c Daniel Axtens
2020-02-12 5:47 ` [PATCH v6 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support Daniel Axtens
2020-02-12 5:47 ` Daniel Axtens
2020-02-12 6:35 ` Christophe Leroy [this message]
2020-02-12 6:35 ` Christophe Leroy
2020-02-12 10:12 ` Daniel Axtens
2020-02-12 10:12 ` Daniel Axtens
2020-02-12 10:35 ` Christophe Leroy
2020-02-12 10:35 ` Christophe Leroy
2020-02-12 12:16 ` Daniel Axtens
2020-02-12 12:16 ` Daniel Axtens
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=224745f3-db66-fe46-1459-d1d41867b4f3@c-s.fr \
--to=christophe.leroy@c-s.fr \
--cc=aneesh.kumar@linux.ibm.com \
--cc=bsingharora@gmail.com \
--cc=dja@axtens.net \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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.