[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v4 23/48] x86: cpuhp: refuse cpu hot-unplug request earlier if not
From: |
Michael S. Tsirkin |
Subject: |
[PULL v4 23/48] x86: cpuhp: refuse cpu hot-unplug request earlier if not supported |
Date: |
Tue, 29 Sep 2020 03:21:54 -0400 |
From: Igor Mammedov <imammedo@redhat.com>
CPU hot-unplug with SMM requires firmware participation to prevent
guest crash (i.e. CPU can be removed only after OS _and_ firmware
were prepared for the action).
Previous patches introduced ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT
feature bit, which is advertised by firmware when it has support
for CPU hot-unplug. Use it to check if guest is able to handle
unplug and make device_del fail gracefully if hot-unplug feature
hasn't been negotiated.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200923094650.1301166-4-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/acpi/ich9.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 0acc9a3107..95cb0f935b 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -460,6 +460,18 @@ void ich9_pm_device_unplug_request_cb(HotplugHandler
*hotplug_dev,
errp);
} else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) &&
!lpc->pm.cpu_hotplug_legacy) {
+ uint64_t negotiated = lpc->smi_negotiated_features;
+
+ if (negotiated & BIT_ULL(ICH9_LPC_SMI_F_BROADCAST_BIT) &&
+ !(negotiated & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT))) {
+ error_setg(errp, "cpu hot-unplug with SMI wasn't enabled "
+ "by firmware");
+ error_append_hint(errp, "update machine type to a version having "
+ "x-smi-cpu-hotunplug=on and firmware that "
+ "supports CPU hot-unplug with SMM");
+ return;
+ }
+
acpi_cpu_unplug_request_cb(hotplug_dev, &lpc->pm.cpuhp_state,
dev, errp);
} else {
--
MST
- [PULL v4 40/48] tests/acpi: list added acpi table binary file for pci bridge hotplug test, (continued)
- [PULL v4 40/48] tests/acpi: list added acpi table binary file for pci bridge hotplug test, Michael S. Tsirkin, 2020/09/29
- [PULL v4 37/48] tests/acpi: add a new ACPI table in order to test root pci hotplug on/off, Michael S. Tsirkin, 2020/09/29
- [PULL v4 41/48] tests/acpi: unit test for 'acpi-pci-hotplug-with-bridge-support' bridge flag, Michael S. Tsirkin, 2020/09/29
- [PULL v4 42/48] tests/acpi: add newly added acpi DSDT table blob for pci bridge hotplug flag, Michael S. Tsirkin, 2020/09/29
- [PULL v4 44/48] piix4: don't reserve hw resources when hotplug is off globally, Michael S. Tsirkin, 2020/09/29
- [PULL v4 43/48] Add ACPI DSDT tables for q35 that are being updated by the next patch, Michael S. Tsirkin, 2020/09/29
- [PULL v4 46/48] hw: virtio-pmem: detach the element fromt the virtqueue when error occurs, Michael S. Tsirkin, 2020/09/29
- [PULL v4 48/48] libvhost-user: return on error in vu_log_queue_fill(), Michael S. Tsirkin, 2020/09/29
- [PULL v4 12/48] virtio-pmem-pci: force virtio version 1, Michael S. Tsirkin, 2020/09/29
- [PULL v4 01/48] linux headers: sync to 5.9-rc4, Michael S. Tsirkin, 2020/09/29
- [PULL v4 23/48] x86: cpuhp: refuse cpu hot-unplug request earlier if not supported,
Michael S. Tsirkin <=
- [PULL v4 30/48] tests: acpi: update acpi blobs with new AML, Michael S. Tsirkin, 2020/09/29
- [PULL v4 20/48] virtio: update MemoryRegionCaches when guest set bad features, Michael S. Tsirkin, 2020/09/29
- [PULL v4 02/48] vhost: switch to use IOTLB v2 format, Michael S. Tsirkin, 2020/09/29
- [PULL v4 47/48] libvhost-user: return early on virtqueue errors, Michael S. Tsirkin, 2020/09/29
- [PULL v4 45/48] tests/acpi: update golden master DSDT binary table blobs for q35, Michael S. Tsirkin, 2020/09/29
- Re: [PULL v4 00/48] virtio,pc,acpi: fixes, tests, no-reply, 2020/09/29
- Re: [PULL v4 00/48] virtio,pc,acpi: fixes, tests, no-reply, 2020/09/29
- Re: [PULL v4 00/48] virtio,pc,acpi: fixes, tests, Peter Maydell, 2020/09/29
- Re: [PULL v4 00/48] virtio,pc,acpi: fixes, tests, Michael S. Tsirkin, 2020/09/29