[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8736idunz8.fsf@concordia.ellerman.id.au>
Date: Wed, 07 Aug 2019 23:03:23 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Jason Yan <yanaijie@...wei.com>, linuxppc-dev@...ts.ozlabs.org,
diana.craciun@....com, christophe.leroy@....fr,
benh@...nel.crashing.org, paulus@...ba.org, npiggin@...il.com,
keescook@...omium.org, kernel-hardening@...ts.openwall.com
Cc: linux-kernel@...r.kernel.org, wangkefeng.wang@...wei.com,
yebin10@...wei.com, thunder.leizhen@...wei.com,
jingxiangfeng@...wei.com, fanchengyang@...wei.com,
zhaohongjiang@...wei.com, Jason Yan <yanaijie@...wei.com>
Subject: Re: [PATCH v5 03/10] powerpc: introduce kimage_vaddr to store the kernel base
Jason Yan <yanaijie@...wei.com> writes:
> Now the kernel base is a fixed value - KERNELBASE. To support KASLR, we
> need a variable to store the kernel base.
>
> Signed-off-by: Jason Yan <yanaijie@...wei.com>
> Cc: Diana Craciun <diana.craciun@....com>
> Cc: Michael Ellerman <mpe@...erman.id.au>
> Cc: Christophe Leroy <christophe.leroy@....fr>
> Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
> Cc: Paul Mackerras <paulus@...ba.org>
> Cc: Nicholas Piggin <npiggin@...il.com>
> Cc: Kees Cook <keescook@...omium.org>
> Reviewed-by: Christophe Leroy <christophe.leroy@....fr>
> Reviewed-by: Diana Craciun <diana.craciun@....com>
> Tested-by: Diana Craciun <diana.craciun@....com>
> ---
> arch/powerpc/include/asm/page.h | 2 ++
> arch/powerpc/mm/init-common.c | 2 ++
> 2 files changed, 4 insertions(+)
>
> diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
> index 0d52f57fca04..60a68d3a54b1 100644
> --- a/arch/powerpc/include/asm/page.h
> +++ b/arch/powerpc/include/asm/page.h
> @@ -315,6 +315,8 @@ void arch_free_page(struct page *page, int order);
>
> struct vm_area_struct;
>
> +extern unsigned long kimage_vaddr;
> +
> #include <asm-generic/memory_model.h>
> #endif /* __ASSEMBLY__ */
> #include <asm/slice.h>
> diff --git a/arch/powerpc/mm/init-common.c b/arch/powerpc/mm/init-common.c
> index 152ae0d21435..d4801ce48dc5 100644
> --- a/arch/powerpc/mm/init-common.c
> +++ b/arch/powerpc/mm/init-common.c
> @@ -25,6 +25,8 @@ phys_addr_t memstart_addr = (phys_addr_t)~0ull;
> EXPORT_SYMBOL_GPL(memstart_addr);
> phys_addr_t kernstart_addr;
> EXPORT_SYMBOL_GPL(kernstart_addr);
> +unsigned long kimage_vaddr = KERNELBASE;
> +EXPORT_SYMBOL_GPL(kimage_vaddr);
The names of the #defines and variables we use for these values are not
very consistent already, but using kimage_vaddr makes it worse I think.
Isn't this going to have the same value as kernstart_addr, but the
virtual rather than physical address?
If so kernstart_virt_addr would seem better.
cheers
Powered by blists - more mailing lists