On 02/24/16 07:00, Ni, Ruiyu wrote:
> Hi all,
> could anyone tell me how to enable SMM in OVMF?
> I tried to set the flag SMM_REQUIRE to TRUE but SmmAccessPei
> module thinks my HostBridgeDevId cannot support SMM.
(Note in advance: the error message is valid; by default QEMU emulates
an i440fx-like motherboard, and that cannot support SMM. You have to
select a Q35 machine type.)
Please consult the OvmfPkg/README file. It has a section on SMM:
"=== SMM support ==="
There are two possibilities. If you want hardware virtualization (vmx or
svm, fast), you need a fresh (version 4.4 or newer) Linux host computer.
(The version number for the Linux host kernel, and all of the other
components too, like QEMU, are given in the README.)
Otherwise, if you are okay with much slower (but still pretty good, for
firmware testing purposes) software emulation, then you can use a
Windows host computer as well.
(Mike can help you build QEMU on Windows -- he has done it before.)
The section in the README file that I referenced above instructs you to
compose a QEMU command line *gradually*. However, I can give a quick
summary here:
(1) First, build a fresh QEMU -- for windows binaries, ask Mike for
help. It has to be at least version 2.5.
(2) Build OVMF as you always do, but pass "-D SMM_REQUIRE".
(3) Locate the following two files under the Build directory:
OVMF_CODE.fd
OVMF_VARS.fd
The first file is the firmware binary that you can use directly.
The second file is a variable store *template*, that you should *not*
use directly. Instead, you should copy it to a separate file for each
individual virtual machine that you create. Then every such virtual
machine will have to stick with that specific copy.
The idea is that each virtual machine is expected to have its private
variable store (initially created from the varstore template). Whereas
all virtual machines can share the OVMF binary between them.
For now, let us call the copy of "OVMF_VARS.fd" "ray1.vars".
(4) The QEMU command line you want (on Windows, i.e., for software
emulation) is:
qemu-system-x86_64 \
-machine pc-q35-2.5,smm=on,accel=tcg \
-m 2048 \
-smp 4 \
-global driver=cfi.pflash01,property=secure,value=on \
-drive if=pflash,format=raw,unit=0,file=OVMF_CODE.fd,readonly=on \
-drive if=pflash,format=raw,unit=1,file=ray1.vars \
...
This virtual machine will have software emulation (accel=tcg), 2 GB of
RAM (-m 2048), 4 VCPUs (-smp 4), and it will use, as variable store, the
"ray1.vars" file.
(5) In order to use disk images, CD-ROM ISOs etc, more options are
needed; I can help with that too, but I'll have to know what you need.
Thanks!
Laszlo
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel