lkml.org 
[lkml]   [2015]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4] x86, kaslr: Access the correct kaslr_enabled variable
From
On Sun, Mar 15, 2015 at 5:18 AM, Minfei Huang <mhuang@redhat.com> wrote:
> On 03/15/15 at 12:49am, Yinghai Lu wrote:
> It confuses me with the virtual address in function parse_kaslr_setup.
> When we are in here(parse_kaslr_setup), we already use the virtual
> address, instead of physical address. Is it all right?

setup_data is using physical address to have linked list.

we have setup_arch==>parse_setup_data(), that is way before
init_mem_mapping() to have final kernel mapping setup yet.

For 64bit, we may use virtual address with help of early mapping with
#PF handler.
But 32bit, we don't have that.

So just use early_memmap to get virtual address to access the value.

>
> In the other words, using physical address in parse_kaslr_setup is
> always a mistake, whatever the kaslr is on or off.
>

The problem is: old code just use physical address as value.

Thanks

Yinghai


\
 
 \ /
  Last update: 2015-03-15 18:21    [W:0.065 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site