diff options
author | Igor Mammedov | 2020-09-23 11:46:41 +0200 |
---|---|---|
committer | Michael S. Tsirkin | 2020-09-29 08:15:24 +0200 |
commit | c5be7517d658ae787de6d0ccc8e93db01fdf60a1 (patch) | |
tree | c6ee2833973a11a6ae1868407fb25b2a73569f59 /hw/i386/x86.c | |
parent | x86: lpc9: let firmware negotiate 'CPU hotplug with SMI' features (diff) | |
download | qemu-c5be7517d658ae787de6d0ccc8e93db01fdf60a1.tar.gz qemu-c5be7517d658ae787de6d0ccc8e93db01fdf60a1.tar.xz qemu-c5be7517d658ae787de6d0ccc8e93db01fdf60a1.zip |
x86: cpuhp: prevent guest crash on CPU hotplug when broadcast SMI is in use
There were reports of guest crash on CPU hotplug, when using q35 machine
type and OVMF with SMM, due to hotplugged CPU trying to process SMI at
default SMI handler location without it being relocated by firmware first.
Fix it by refusing hotplug if firmware hasn't negotiated CPU hotplug with
SMI support while SMI broadcast is in use.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200923094650.1301166-3-imammedo@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386/x86.c')
-rw-r--r-- | hw/i386/x86.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/i386/x86.c b/hw/i386/x86.c index c2ea989579..403c2b1dad 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -279,6 +279,17 @@ void x86_cpu_pre_plug(HotplugHandler *hotplug_dev, return; } + if (x86ms->acpi_dev) { + Error *local_err = NULL; + + hotplug_handler_pre_plug(HOTPLUG_HANDLER(x86ms->acpi_dev), dev, + &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } + } + init_topo_info(&topo_info, x86ms); env->nr_dies = x86ms->smp_dies; |