public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	ThomasGleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: EFI runtime code mapping enhancement
Date: Thu, 14 Feb 2008 13:06:17 +0100	[thread overview]
Message-ID: <200802141306.17642.ak@suse.de> (raw)
In-Reply-To: <1202953580.5026.39.camel@caritas-dev.intel.com>


> For EFI runtime service in virtual mode, using direct mapping is mainly
> for kexec, where EFI runtime memory area need to be mapped at same
> virtual address across kexec. 

I see. I didn't consider this aspect.

> - Use direct mapping of kernel, clean NX bit from kernel page table
> temporarily before/after EFI calling. This needs not split 2M page into
> 4K pages, because the region changed is aligned with 2M. And, because
> the changing is temporary, a little larger region is not a big issue.

I would just do it permanently. 

> Aligning 
> EFI runtime code region with 1G seems not a good idea too. I think a
> better method is adding a non-split mode to c_p_a(), where the region
> changed is enlarged if necessary to avoid page allocation. This can be
> used to implement early_set_memory_xx(). The early_set_memory_xx()
> instead of duplicated c_p_a() variant can be used by EFI code.

I attempted something like this with my advisory vs required static
protections last week, but it was rejected.

But yes having such a mode would make sense agreed. 

The easiest way (as in least amount of code) to implement it actually 
is to just bypass set_memory_*() and just do the lookup_address() yourself 
and clear NX and do a global TLB flush. For the special case of NX
that is fine because you don't need to worry about fixing up any aliases.

-Andi
 

  reply	other threads:[~2008-02-14 12:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-13  9:22 [PATCH] x86: EFI runtime code mapping enhancement Huang, Ying
2008-02-13 11:32 ` Andi Kleen
2008-02-14  1:46   ` Huang, Ying
2008-02-14 12:06     ` Andi Kleen [this message]
2008-02-15  2:10       ` Huang, Ying
2008-02-15  2:25 ` Huang, Ying

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=200802141306.17642.ak@suse.de \
    --to=ak@suse.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=ying.huang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox