[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d6201d21-9631-dd22-2ff1-af7520086c32@ghiti.fr>
Date: Tue, 7 Apr 2020 01:08:13 -0400
From: Alex Ghiti <alex@...ti.fr>
To: Zong Li <zong.li@...ive.com>, palmer@...belt.com,
paul.walmsley@...ive.com, linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC 1/8] riscv/kaslr: add interface to get kaslr offset
On 3/24/20 3:30 AM, Zong Li wrote:
> Add interface to get the random offset.
>
> Signed-off-by: Zong Li <zong.li@...ive.com>
> ---
> arch/riscv/include/asm/page.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/riscv/include/asm/page.h b/arch/riscv/include/asm/page.h
> index 92848e172a40..e2c2020f0a8d 100644
> --- a/arch/riscv/include/asm/page.h
> +++ b/arch/riscv/include/asm/page.h
> @@ -101,6 +101,11 @@ extern unsigned long kernel_virt_addr;
> extern unsigned long max_low_pfn;
> extern unsigned long min_low_pfn;
>
> +static inline unsigned long get_kaslr_offset(void)
> +{
> + return kernel_virt_addr - PAGE_OFFSET;
> +}
> +
> #define __pa_to_va_nodebug(x) ((void *)((unsigned long) (x) + va_pa_offset))
> #define __va_to_pa_nodebug(x) ((unsigned long)(x) - va_pa_offset)
>
>
No problem for this one:
Reviewed-by: Alexandre Ghiti <alex@...ti.fr>
Thanks,
Alex
Powered by blists - more mailing lists