From: Daniel Axtens <dja@axtens.net> To: Christophe Leroy <christophe.leroy@c-s.fr>, 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 23:16:21 +1100 [thread overview] Message-ID: <87ftfgrofe.fsf@dja-thinkpad.axtens.net> (raw) In-Reply-To: <5e392944-50ac-ed06-5896-2664894335d9@c-s.fr> Christophe Leroy <christophe.leroy@c-s.fr> writes: > Le 12/02/2020 à 11:12, Daniel Axtens a écrit : >> Christophe Leroy <christophe.leroy@c-s.fr> writes: >> >>> 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. >> >> I got a compile error for a missing symbol. I'll repro it and attach it. >> > > Oops, sorry. I looked too quickly. It is defined in kasan_init_32.c and > called from mm/mem.c > > We don't have a performance issue here, since this is called only once > during startup. Could you define an empty kasan_late_init() in > init_book3s_64.c instead ? Yeah, I can do that, will respin tomorrow. Would you mind having a quick check of the documentation changes in patches 2 and 4? I just want to confirm I've accurately captured the state of ppc32 kasan work. Thanks! Daniel > > Christophe
WARNING: multiple messages have this Message-ID (diff)
From: Daniel Axtens <dja@axtens.net> To: Christophe Leroy <christophe.leroy@c-s.fr>, 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 23:16:21 +1100 [thread overview] Message-ID: <87ftfgrofe.fsf@dja-thinkpad.axtens.net> (raw) In-Reply-To: <5e392944-50ac-ed06-5896-2664894335d9@c-s.fr> Christophe Leroy <christophe.leroy@c-s.fr> writes: > Le 12/02/2020 à 11:12, Daniel Axtens a écrit : >> Christophe Leroy <christophe.leroy@c-s.fr> writes: >> >>> 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. >> >> I got a compile error for a missing symbol. I'll repro it and attach it. >> > > Oops, sorry. I looked too quickly. It is defined in kasan_init_32.c and > called from mm/mem.c > > We don't have a performance issue here, since this is called only once > during startup. Could you define an empty kasan_late_init() in > init_book3s_64.c instead ? Yeah, I can do that, will respin tomorrow. Would you mind having a quick check of the documentation changes in patches 2 and 4? I just want to confirm I've accurately captured the state of ppc32 kasan work. Thanks! Daniel > > Christophe
next prev parent reply other threads:[~2020-02-12 12:16 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 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 [this message] 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=87ftfgrofe.fsf@dja-thinkpad.axtens.net \ --to=dja@axtens.net \ --cc=aneesh.kumar@linux.ibm.com \ --cc=bsingharora@gmail.com \ --cc=christophe.leroy@c-s.fr \ --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: linkBe 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.