public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Jiewen Yao <jiewen.yao@intel.com>, edk2-devel@ml01.01.org
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
	Jeff Fan <jeff.fan@intel.com>
Subject: Re: [PATCH] UefiCpuPkg/PiSmmCpu: Check XdSupport before set NX.
Date: Thu, 17 Nov 2016 16:58:15 +0100	[thread overview]
Message-ID: <39cfaef3-e31f-6d5d-01b1-70fe3cc6057f@redhat.com> (raw)
In-Reply-To: <1479389619-16016-1-git-send-email-jiewen.yao@intel.com>

On 11/17/16 14:33, Jiewen Yao wrote:
> When XD is not supported, the BIT63 is reserved.
> We should not set BIT63 in the page table.
> 
> Test OVMF IA32/IA32X64 with XD enabled/disabled.
> 
> Analyzed-by: Laszlo Ersek <lersek@redhat.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Jeff Fan <jeff.fan@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
> index b4f8861..c85e025 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
> @@ -209,10 +209,12 @@ ConvertPageEntryAttribute (
>      }
>    }
>    if ((Attributes & EFI_MEMORY_XP) != 0) {
> -    if (IsSet) {
> -      NewPageEntry |= IA32_PG_NX;
> -    } else {
> -      NewPageEntry &= ~IA32_PG_NX;
> +    if (mXdSupported) {
> +      if (IsSet) {
> +        NewPageEntry |= IA32_PG_NX;
> +      } else {
> +        NewPageEntry &= ~IA32_PG_NX;
> +      }
>      }
>    }
>    *PageEntry = NewPageEntry;
> 

Tested-by: Laszlo Ersek <lersek@redhat.com>

Thanks!
Laszlo


  reply	other threads:[~2016-11-17 15:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17 13:33 [PATCH] UefiCpuPkg/PiSmmCpu: Check XdSupport before set NX Jiewen Yao
2016-11-17 15:58 ` Laszlo Ersek [this message]
2016-11-18  0:44   ` Fan, Jeff

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-list 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=39cfaef3-e31f-6d5d-01b1-70fe3cc6057f@redhat.com \
    --to=devel@edk2.groups.io \
    /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