From: Minfei Huang <mhuang@redhat.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
Kees Cook <keescook@chromium.org>, Borislav Petkov <bp@suse.de>,
Baoquan He <bhe@redhat.com>, Thomas Gleixner <tglx@linutronix.de>,
Jiri Kosina <jkosina@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Matt Fleming <matt.fleming@intel.com>
Subject: Re: [PATCH v4] x86, kaslr: Access the correct kaslr_enabled variable
Date: Mon, 16 Mar 2015 11:08:18 +0800 [thread overview]
Message-ID: <20150316030818.GA14862@dhcp-128-1.nay.redhat.com> (raw)
In-Reply-To: <CAE9FiQUF6E3-F-31A7M6qw4ut9wrFfcKOhZ1=0SRwAQYD3QV+A@mail.gmail.com>
On 03/15/15 at 10:02am, Yinghai Lu wrote:
> 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.
>
Hi, Yinghai!
Thank you for your reply.
I find that the variate kaslr_setup_data is a global variate. Always we
can use physical address to access the value.
But it is more comfortable that we use the early_memmap to access the
value.
Thanks
Minfei
> >
> > 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
next prev parent reply other threads:[~2015-03-16 3:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-15 7:49 Yinghai Lu
2015-03-15 12:18 ` Minfei Huang
2015-03-15 17:02 ` Yinghai Lu
2015-03-16 3:08 ` Minfei Huang [this message]
2015-03-16 3:28 ` Baoquan He
2015-03-16 4:36 ` Yinghai Lu
2015-03-16 5:11 ` Baoquan He
2015-03-16 5:04 ` Yinghai Lu
2015-03-16 5:19 ` Baoquan He
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=20150316030818.GA14862@dhcp-128-1.nay.redhat.com \
--to=mhuang@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=bp@suse.de \
--cc=hpa@zytor.com \
--cc=jkosina@suse.cz \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt.fleming@intel.com \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=yinghai@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®