All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>, Andi Kleen <ak@suse.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/6] x86: fix some bugs about EFI runtime code mapping
Date: Thu, 24 Jan 2008 23:35:40 -0800	[thread overview]
Message-ID: <4799914C.5060709@goop.org> (raw)
In-Reply-To: <1201240501.15972.46.camel@caritas-dev.intel.com>

Huang, Ying wrote:
> This patch fixes some bugs of making EFI runtime code executable.
>
> - Use change_page_attr in i386 too. Because the runtime code may be
>   mapped not through ioremap.
>
> - If there is no _PAGE_NX in __supported_pte_mask, the change_page_attr
>   is not called.
>
> - Make efi_ioremap map pages as PAGE_KERNEL_EXEC, because EFI runtime
>   code may be mapped through efi_ioremap.
>
> Signed-off-by: Huang Ying <ying.huang@intel.com>
>
> ---
>  arch/x86/kernel/efi.c    |   35 ++++++++++++++++++++++++++++++-----
>  arch/x86/kernel/efi_64.c |   26 ++++++--------------------
>  include/asm-x86/efi.h    |    1 -
>  3 files changed, 36 insertions(+), 26 deletions(-)
>
> --- a/arch/x86/kernel/efi.c
> +++ b/arch/x86/kernel/efi.c
> @@ -40,6 +40,8 @@
>  #include <asm/setup.h>
>  #include <asm/efi.h>
>  #include <asm/time.h>
> +#include <asm/cacheflush.h>
> +#include <asm/tlbflush.h>
>  
>  #define EFI_DEBUG	1
>  #define PFX 		"EFI: "
> @@ -379,6 +381,32 @@ void __init efi_init(void)
>  #endif
>  }
>  
> +#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
> +static void __init runtime_code_page_mkexec(void)
> +{
> +	efi_memory_desc_t *md;
> +	unsigned long end;
> +	void *p;
> +
> +	if (!(__supported_pte_mask & _PAGE_NX))
> +		return;
>   

On 32-bit non-PAE, _PAGE_NX == 0, so this if() statement should be 
sufficient to disable the whole function at compile time without needing 
the outer #if defined wrapper.

    J

  reply	other threads:[~2008-01-25  7:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-25  5:55 [PATCH 4/6] x86: fix some bugs about EFI runtime code mapping Huang, Ying
2008-01-25  7:35 ` Jeremy Fitzhardinge [this message]
2008-01-25  9:19   ` Ingo Molnar
2008-01-25  9:30     ` Huang, Ying
2008-01-25  9:16 ` Ingo Molnar
2008-01-25  9:26   ` Huang, Ying
2008-01-25  9:48     ` Ingo Molnar

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=4799914C.5060709@goop.org \
    --to=jeremy@goop.org \
    --cc=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 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.