public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Fan, Jeff" <jeff.fan@intel.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: "Yao, Jiewen" <jiewen.yao@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH V4 1/3] UefiCpuPkg/CpuDxe: Add memory attribute setting.
Date: Mon, 13 Mar 2017 01:58:09 +0000	[thread overview]
Message-ID: <542CF652F8836A4AB8DBFAAD40ED192A4C55D477@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20170310152142.GL1760@perard.uk.xensource.com>

Anthony,

It's very interesting.  Some INTEL IA-32 architectural MSR (like 0x1A0, IA32_MISC_ENABLE) is not supported by AMD processors.

For this case, I think reading 0x1A0 is not necessary. Reading CPUID.80000001H:EDK[20] is enough to check if XD feature is supported or not.

I will create the patch to remove the following check.

      if ((AsmReadMsr64 (0x000001A0) & BIT34) == 0) {
        // XD enabled

I suggest to review such issue case by case when we encounter unsupported architectural MSRs on AMD processors in the future.

Thanks!
Jeff

-----Original Message-----
From: Anthony PERARD [mailto:anthony.perard@citrix.com] 
Sent: Friday, March 10, 2017 11:22 PM
To: Fan, Jeff
Cc: Yao, Jiewen; edk2-devel@lists.01.org; Kinney, Michael D
Subject: Re: [edk2] [PATCH V4 1/3] UefiCpuPkg/CpuDxe: Add memory attribute setting.

On Fri, Mar 10, 2017 at 01:02:22AM +0000, Fan, Jeff wrote:
> Anthony,
> 
> MSR 0x1A0 is architectural MSR defined in IA32 SDM.
> 
> Have you tried AMD real platform?

Yes, I did, and unless I've made a mistake, trying to read msr 0x1a0 does generate a GPF.

Also, I've now take a look into the AMD manuals[1] and more specificaly
"AMD64 Architecture Programmer’s Manual Volume 2: System Programming"[2], there is no sign of MSR 0x1a0 (in Appendix A).

As for the XD bit on AMD, (well NX actually), it is describe at 5.6.3, in the "Page Translation and Protection" chapter.


About MSR 0x1a0 been architectural defined, I guess that applies only to Intel CPUs, all of them.

[1]: http://developer.amd.com/resources/developer-guides-manuals/
[2]: http://support.amd.com/TechDocs/24593.pdf

Thanks,

--
Anthony PERARD

  reply	other threads:[~2017-03-13  1:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21  6:57 [PATCH V4 0/3] DXE Memory Protection Jiewen Yao
2017-02-21  6:57 ` [PATCH V4 1/3] UefiCpuPkg/CpuDxe: Add memory attribute setting Jiewen Yao
2017-03-09 11:52   ` Anthony PERARD
2017-03-10  1:02     ` Fan, Jeff
2017-03-10 15:21       ` Anthony PERARD
2017-03-13  1:58         ` Fan, Jeff [this message]
2017-02-21  6:57 ` [PATCH V4 2/3] MdeModulePkg/dec: add PcdImageProtectionPolicy Jiewen Yao
2017-02-21  6:57 ` [PATCH V4 3/3] MdeModulePkg/DxeCore: Add UEFI image protection Jiewen Yao
2017-02-21  7:23 ` [PATCH V4 0/3] DXE Memory Protection Fan, Jeff
2017-02-21  8:36 ` Ard Biesheuvel
2017-02-21  8:39   ` Yao, Jiewen
2017-02-21 17:25     ` Ard Biesheuvel

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=542CF652F8836A4AB8DBFAAD40ED192A4C55D477@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