public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Garrett Kirkendall <Garrett.Kirkendall@amd.com>, devel@edk2.groups.io
Cc: Eric Dong <eric.dong@intel.com>, Ray Ni <ray.ni@intel.com>
Subject: Re: [PATCH v1 0/2] UefiCpuPkg: AMD procesor MSR_IA32_MISC_ENABLE
Date: Tue, 16 Jun 2020 19:01:01 +0200	[thread overview]
Message-ID: <5f2fd5a9-2107-503a-406b-de08529dcb56@redhat.com> (raw)
In-Reply-To: <20200615183029.4577-1-Garrett.Kirkendall@amd.com>

Hi Garrett,

On 06/15/20 20:30, Garrett Kirkendall wrote:
> AMD processor does not support MSR_IA32_MISC_ENABLE register.  Accessing
> this register on AMD causes an unhandled exception in SmmEntry.nasm and
> a subsequent failure to boot since this is too early in SMM path for the
> exception handler to be loaded.
> 
> First, to distinguish between AMD and other processors, refactor
> StandardSignatureIsAuthenticAMD into BaseUefiCpuLib.  So there is only
> one copy in the source. All changed modules already include UefiCpuLib
> either directly or indirectly so could not easly split first patch.
> 
> Second, Skip manipulation of MSR_IA32_MISC_ENABLE register if running
> on an AMD processor.
> 
> Tested on AMD X64 processor.
> 
> Modified source patching in 2/2 for FALSE
> and TRUE to test failure and passing case when AMD processor detected.
> Did not have a way to test UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm.

Please test the series as follows:

(1) Download

https://www.kraxel.org/repos/images/fedora-30-efi-systemd-i686.qcow2.xz
https://www.kraxel.org/repos/images/fedora-31-efi-grub2-x86_64.qcow2.xz

and decompress both files.


(2) Test using a 32-bit guest on an Intel host (standing in your edk2 tree, with the patches applied):

$ build -a IA32 -b DEBUG -p OvmfPkg/OvmfPkgIa32.dsc -t GCC5 -D SMM_REQUIRE

$ qemu-system-i386 \
    -cpu coreduo,-nx \
    -machine q35,smm=on,accel=kvm \
    -m 4096 \
    -smp 4 \
    -global driver=cfi.pflash01,property=secure,value=on \
    -drive if=pflash,format=raw,unit=0,readonly=on,file=Build/OvmfIa32/DEBUG_GCC5/FV/OVMF_CODE.fd \
    -drive if=pflash,format=raw,unit=1,snapshot=on,file=Build/OvmfIa32/DEBUG_GCC5/FV/OVMF_VARS.fd \
    -drive id=hdd,if=none,format=qcow2,snapshot=on,file=fedora-30-efi-systemd-i686.qcow2 \
    -device virtio-scsi-pci,id=scsi0 \
    -device scsi-hd,drive=hdd,bus=scsi0.0,bootindex=1

(Once you get a login prompt, feel free to interrupt QEMU with Ctrl-C.)


(3) Test using a 64-bit guest on an Intel host:

$ build -a IA32 -a X64 -b DEBUG -p OvmfPkg/OvmfPkgIa32X64.dsc -t GCC5 -D SMM_REQUIRE

$ qemu-system-x86_64 \
    -cpu host \
    -machine q35,smm=on,accel=kvm \
    -m 4096 \
    -smp 4 \
    -global driver=cfi.pflash01,property=secure,value=on \
    -drive if=pflash,format=raw,unit=0,readonly=on,file=Build/Ovmf3264/DEBUG_GCC5/FV/OVMF_CODE.fd \
    -drive if=pflash,format=raw,unit=1,snapshot=on,file=Build/Ovmf3264/DEBUG_GCC5/FV/OVMF_VARS.fd \
    -drive id=hdd,if=none,format=qcow2,snapshot=on,file=fedora-31-efi-grub2-x86_64.qcow2 \
    -device virtio-scsi-pci,id=scsi0 \
    -device scsi-hd,drive=hdd,bus=scsi0.0,bootindex=1


(4) Test using a 64-bit guest on an AMD host -- just repeat step (3) on an AMD host.

Thanks!
Laszlo


      parent reply	other threads:[~2020-06-16 17:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 18:30 [PATCH v1 0/2] UefiCpuPkg: AMD procesor MSR_IA32_MISC_ENABLE Kirkendall, Garrett
2020-06-15 18:30 ` [PATCH v1 1/2] UefiCpuPkg: Move StandardSignatureIsAuthenticAMD to BaseUefiCpuLib Kirkendall, Garrett
2020-06-16 15:29   ` Laszlo Ersek
2020-06-17  0:30   ` [edk2-devel] " Dong, Eric
2020-06-15 18:30 ` [PATCH v1 2/2] UefiCpuPkg: PiSmmCpuDxeSmm skip MSR_IA32_MISC_ENABLE manipulation on AMD Kirkendall, Garrett
2020-06-16 16:28   ` Laszlo Ersek
2020-06-16 17:01 ` Laszlo Ersek [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=5f2fd5a9-2107-503a-406b-de08529dcb56@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