• Laszlo Ersek's avatar
    hw/isa/lpc_ich9: add broadcast SMI feature · 5ce45c7a
    Laszlo Ersek authored
    The generic edk2 SMM infrastructure prefers
    EFI_SMM_CONTROL2_PROTOCOL.Trigger() to inject an SMI on each processor. If
    Trigger() only brings the current processor into SMM, then edk2 handles it
    in the following ways:
    
    (1) If Trigger() is executed by the BSP (which is guaranteed before
        ExitBootServices(), but is not necessarily true at runtime), then:
    
        (a) If edk2 has been configured for "traditional" SMM synchronization,
            then the BSP sends directed SMIs to the APs with APIC delivery,
            bringing them into SMM individually. Then the BSP runs the SMI
            handler / dispatcher.
    
        (b) If edk2 has been configured for "relaxed" SMM synchronization,
            then the APs that are not already in SMM are not brought in, and
            the BSP runs the SMI handler / dispatcher.
    
    (2) If Trigger() is executed by an AP (which is possible after
        ExitBootServices(), and can be forced e.g. by "taskset -c 1
        efibootmgr"), then the AP in question brings in the BSP with a
        directed SMI, and the BSP runs the SMI handler / dispatcher.
    
    The smaller problem with (1a) and (2) is that the BSP and AP
    synchronization is slow. For example, the "taskset -c 1 efibootmgr"
    command from (2) can take more than 3 seconds to complete, because
    efibootmgr accesses non-volatile UEFI variables intensively.
    
    The larger problem is that QEMU's current behavior diverges from the
    behavior usually seen on physical hardware, and that keeps exposing
    obscure corner cases, race conditions and other instabilities in edk2,
    which generally expects / prefers a software SMI to affect all CPUs at
    once.
    
    Therefore introduce the "broadcast SMI" feature that causes QEMU to inject
    the SMI on all VCPUs.
    
    While the original posting of this patch
    <http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg05658.html>
    only intended to speed up (2), based on our recent "stress testing" of SMM
    this patch actually provides functional improvements.
    
    Cc: "Michael S. Tsirkin" <mst@redhat.com>
    Cc: Gerd Hoffmann <kraxel@redhat.com>
    Cc: Igor Mammedov <imammedo@redhat.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: 's avatarLaszlo Ersek <lersek@redhat.com>
    Reviewed-by: 's avatarMichael S. Tsirkin <mst@redhat.com>
    Reviewed-by: 's avatarIgor Mammedov <imammedo@redhat.com>
    Message-Id: <20170126014416.11211-3-lersek@redhat.com>
    Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
    5ce45c7a
Name
Last commit
Last update
audio Loading commit data...
backends Loading commit data...
block Loading commit data...
bsd-user Loading commit data...
contrib Loading commit data...
crypto Loading commit data...
default-configs Loading commit data...
disas Loading commit data...
docs Loading commit data...
dtc @ 65cc4d27 Loading commit data...
fpu Loading commit data...
fsdev Loading commit data...
gdb-xml Loading commit data...
hw Loading commit data...
include Loading commit data...
io Loading commit data...
libdecnumber Loading commit data...
linux-headers Loading commit data...
linux-user Loading commit data...
migration Loading commit data...
nbd Loading commit data...
net Loading commit data...
pc-bios Loading commit data...
pixman @ 87eea99e Loading commit data...
po Loading commit data...
qapi Loading commit data...
qga Loading commit data...
qobject Loading commit data...
qom Loading commit data...
replay Loading commit data...
roms Loading commit data...
scripts Loading commit data...
slirp Loading commit data...
stubs Loading commit data...
target Loading commit data...
tcg Loading commit data...
tests Loading commit data...
trace Loading commit data...
ui Loading commit data...
util Loading commit data...
.dir-locals.el Loading commit data...
.exrc Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CODING_STYLE Loading commit data...
COPYING Loading commit data...
COPYING.LIB Loading commit data...
Changelog Loading commit data...
HACKING Loading commit data...
LICENSE Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
Makefile.objs Loading commit data...
Makefile.target Loading commit data...
README Loading commit data...
VERSION Loading commit data...
accel.c Loading commit data...
aio-posix.c Loading commit data...
aio-win32.c Loading commit data...
arch_init.c Loading commit data...
async.c Loading commit data...
atomic_template.h Loading commit data...
balloon.c Loading commit data...
block.c Loading commit data...
blockdev-nbd.c Loading commit data...
blockdev.c Loading commit data...
blockjob.c Loading commit data...
bootdevice.c Loading commit data...
bt-host.c Loading commit data...
bt-vhci.c Loading commit data...
configure Loading commit data...
cpu-exec-common.c Loading commit data...
cpu-exec.c Loading commit data...
cpus-common.c Loading commit data...
cpus.c Loading commit data...
cputlb.c Loading commit data...
device-hotplug.c Loading commit data...
device_tree.c Loading commit data...
disas.c Loading commit data...
dma-helpers.c Loading commit data...
dump.c Loading commit data...
exec.c Loading commit data...
gdbstub.c Loading commit data...
hax-stub.c Loading commit data...
hmp-commands-info.hx Loading commit data...
hmp-commands.hx Loading commit data...
hmp.c Loading commit data...
hmp.h Loading commit data...
iohandler.c Loading commit data...
ioport.c Loading commit data...
iothread.c Loading commit data...
kvm-all.c Loading commit data...
kvm-stub.c Loading commit data...
main-loop.c Loading commit data...
memory.c Loading commit data...
memory_ldst.inc.c Loading commit data...
memory_mapping.c Loading commit data...
module-common.c Loading commit data...
monitor.c Loading commit data...
numa.c Loading commit data...
os-posix.c Loading commit data...
os-win32.c Loading commit data...
page_cache.c Loading commit data...
qapi-schema.json Loading commit data...
qdev-monitor.c Loading commit data...
qdict-test-data.txt Loading commit data...
qemu-bridge-helper.c Loading commit data...
qemu-char.c Loading commit data...
qemu-doc.texi Loading commit data...
qemu-ga.texi Loading commit data...
qemu-img-cmds.hx Loading commit data...
qemu-img.c Loading commit data...
qemu-img.texi Loading commit data...
qemu-io-cmds.c Loading commit data...
qemu-io.c Loading commit data...
qemu-nbd.c Loading commit data...
qemu-nbd.texi Loading commit data...
qemu-option-trace.texi Loading commit data...
qemu-options-wrapper.h Loading commit data...
qemu-options.h Loading commit data...
qemu-options.hx Loading commit data...
qemu-seccomp.c Loading commit data...
qemu-tech.texi Loading commit data...
qemu-timer.c Loading commit data...
qemu.nsi Loading commit data...
qemu.sasl Loading commit data...
qmp.c Loading commit data...
qtest.c Loading commit data...
replication.c Loading commit data...
replication.h Loading commit data...
rules.mak Loading commit data...
softmmu_template.h Loading commit data...
spice-qemu-char.c Loading commit data...
tcg-runtime.c Loading commit data...
tci.c Loading commit data...
thread-pool.c Loading commit data...
thunk.c Loading commit data...
tpm.c Loading commit data...
trace-events Loading commit data...
translate-all.c Loading commit data...
translate-all.h Loading commit data...
translate-common.c Loading commit data...
user-exec-stub.c Loading commit data...
user-exec.c Loading commit data...
version.rc Loading commit data...
vl.c Loading commit data...
xen-common-stub.c Loading commit data...
xen-common.c Loading commit data...
xen-hvm-stub.c Loading commit data...
xen-hvm.c Loading commit data...
xen-mapcache.c Loading commit data...