public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Fan, Jeff" <jeff.fan@intel.com>
To: Laszlo Ersek <lersek@redhat.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	"edk2-devel@ml01.01.org" <edk2-devel@ml01.01.org>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH] UefiCpuPkg/PiSmmCpu: Check XdSupport before set NX.
Date: Fri, 18 Nov 2016 00:44:29 +0000	[thread overview]
Message-ID: <542CF652F8836A4AB8DBFAAD40ED192A4A2E125F@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <39cfaef3-e31f-6d5d-01b1-70fe3cc6057f@redhat.com>

Reviewed-by: Jeff Fan <jeff.fan@intel.com>

-----Original Message-----
From: Laszlo Ersek [mailto:lersek@redhat.com] 
Sent: Thursday, November 17, 2016 11:58 PM
To: Yao, Jiewen; edk2-devel@ml01.01.org
Cc: Kinney, Michael D; Fan, Jeff
Subject: Re: [edk2] [PATCH] UefiCpuPkg/PiSmmCpu: Check XdSupport before set NX.

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-18  0:44 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
2016-11-18  0:44   ` Fan, Jeff [this message]

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=542CF652F8836A4AB8DBFAAD40ED192A4A2E125F@shsmsx102.ccr.corp.intel.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