All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Ghiti <alex@ghiti.fr>
To: Zong Li <zong.li@sifive.com>,
	palmer@dabbelt.com, paul.walmsley@sifive.com,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 1/8] riscv/kaslr: add interface to get kaslr offset
Date: Tue, 7 Apr 2020 01:08:13 -0400	[thread overview]
Message-ID: <d6201d21-9631-dd22-2ff1-af7520086c32@ghiti.fr> (raw)
In-Reply-To: <cf8585177e6798095b1af02f28dad5a3271a761e.1584352425.git.zong.li@sifive.com>

On 3/24/20 3:30 AM, Zong Li wrote:
> Add interface to get the random offset.
> 
> Signed-off-by: Zong Li <zong.li@sifive.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@ghiti.fr>

Thanks,

Alex

  reply	other threads:[~2020-04-07  5:08 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24  7:30 [PATCH RFC 0/8] Support KASLR for RISC-V Zong Li
2020-03-24  7:30 ` [PATCH RFC 1/8] riscv/kaslr: add interface to get kaslr offset Zong Li
2020-04-07  5:08   ` Alex Ghiti [this message]
2020-03-24  7:30 ` [PATCH RFC 2/8] riscv/kaslr: introduce functions to clear page table Zong Li
2020-04-07  5:09   ` Alex Ghiti
2020-04-07  9:17     ` Zong Li
2020-04-07  9:17       ` Zong Li
2020-03-24  7:30 ` [PATCH RFC 3/8] riscv/kaslr: support KASLR infrastructure Zong Li
2020-04-07  5:10   ` Alex Ghiti
2020-04-07 10:34     ` Zong Li
2020-04-07 10:34       ` Zong Li
2020-04-09  5:53       ` Alex Ghiti
2020-04-09  5:53         ` Alex Ghiti
2020-04-09 11:08         ` Zong Li
2020-04-09 11:08           ` Zong Li
2020-03-24  7:30 ` [PATCH RFC 4/8] riscv/kaslr: randomize the kernel image offset Zong Li
2020-04-07  5:11   ` Alex Ghiti
2020-04-07 10:53     ` Zong Li
2020-04-07 10:53       ` Zong Li
2020-04-09  5:51       ` Alex Ghiti
2020-04-09  5:51         ` Alex Ghiti
2020-04-09 10:31         ` Zong Li
2020-04-09 10:31           ` Zong Li
2020-04-10 15:58           ` Alex Ghiti
2020-04-10 15:58             ` Alex Ghiti
2020-04-11  8:20             ` Zong Li
2020-04-11  8:20               ` Zong Li
2020-04-12  6:53               ` Alex Ghiti
2020-04-12  6:53                 ` Alex Ghiti
2020-04-14  2:46                 ` Zong Li
2020-04-14  2:46                   ` Zong Li
2020-04-14  5:43                   ` Alex Ghiti
2020-04-14  5:43                     ` Alex Ghiti
2020-04-14  7:00                     ` Zong Li
2020-04-14  7:00                       ` Zong Li
2020-03-24  7:30 ` [PATCH RFC 5/8] riscv/kaslr: support sparse memory model Zong Li
2020-03-24  7:30 ` [PATCH RFC 6/8] riscv/kaslr: clear the original kernel image Zong Li
2020-04-07  5:11   ` Alex Ghiti
2020-04-07 11:18     ` Zong Li
2020-04-07 11:18       ` Zong Li
2020-04-09  5:53       ` Alex Ghiti
2020-04-09  5:53         ` Alex Ghiti
2020-04-09  8:14         ` Alex Ghiti
2020-04-09  8:14           ` Alex Ghiti
2020-03-24  7:30 ` [PATCH RFC 7/8] riscv/kaslr: add cmdline support to disable KASLR Zong Li
2020-03-24  7:30 ` [PATCH RFC 8/8] riscv/kaslr: dump out kernel offset information on panic Zong Li

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=d6201d21-9631-dd22-2ff1-af7520086c32@ghiti.fr \
    --to=alex@ghiti.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=zong.li@sifive.com \
    /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.