On 01/05/2025 23.04, Philippe Mathieu-Daudé wrote:
The ICH9_LPC_SMI_F_BROADCAST_BIT feature bit was only set
in the pc_compat_2_8[] array, via the 'x-smi-broadcast=off'
property. We removed all machines using that array, lets remove
that property and all the code around it.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
  include/hw/southbridge/ich9.h |  1 -
  hw/acpi/ich9.c                |  6 ++----
  hw/isa/lpc_ich9.c             | 22 +++-------------------
  3 files changed, 5 insertions(+), 24 deletions(-)

FWIW, this patch seems to break tests/qtest/cpu-plug-test ... I get the error message "cpu hotplug with SMI wasn't enabled by firmware". Sounds like the guest has the enable this feature, too, so I assume we cannot simply assume that it is always available now?

 Thomas



diff --git a/include/hw/southbridge/ich9.h b/include/hw/southbridge/ich9.h
index 1e231e89c92..4764c03ac2d 100644
--- a/include/hw/southbridge/ich9.h
+++ b/include/hw/southbridge/ich9.h
@@ -244,7 +244,6 @@ struct ICH9LPCState {
  #define ICH9_LPC_SMI_NEGOTIATED_FEAT_PROP "x-smi-negotiated-features"
/* bit positions used in fw_cfg SMI feature negotiation */
-#define ICH9_LPC_SMI_F_BROADCAST_BIT            0
  #define ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT          1
  #define ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT       2
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index c7a735bf642..40564605735 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -477,8 +477,7 @@ void ich9_pm_device_pre_plug_cb(HotplugHandler 
*hotplug_dev, DeviceState *dev,
      if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {
          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_HOTPLUG_BIT))) {
+        if (!(negotiated & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT))) {
              error_setg(errp, "cpu hotplug with SMI wasn't enabled by 
firmware");
              error_append_hint(errp, "update machine type to newer than 5.1 "
                  "and firmware that suppors CPU hotplug with SMM");
@@ -526,8 +525,7 @@ void ich9_pm_device_unplug_request_cb(HotplugHandler 
*hotplug_dev,
                 !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))) {
+        if (!(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 "
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 71afb45b631..c57a06e0dde 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -400,15 +400,6 @@ static void smi_features_ok_callback(void *opaque)
      guest_cpu_hotplug_features = guest_features &
                                   (BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT) |
                                    BIT_ULL(ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT));
-    if (!(guest_features & BIT_ULL(ICH9_LPC_SMI_F_BROADCAST_BIT)) &&
-        guest_cpu_hotplug_features) {
-        /*
-         * cpu hot-[un]plug with SMI requires SMI broadcast,
-         * leave @features_ok at zero
-         */
-        return;
-    }
-
      if (guest_cpu_hotplug_features ==
          BIT_ULL(ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT)) {
          /* cpu hot-unplug is unsupported without cpu-hotplug */
@@ -470,14 +461,9 @@ static void ich9_apm_ctrl_changed(uint32_t val, void *arg)
/* SMI_EN = PMBASE + 30. SMI control and enable register */
      if (lpc->pm.smi_en & ICH9_PMIO_SMI_EN_APMC_EN) {
-        if (lpc->smi_negotiated_features &
-            (UINT64_C(1) << ICH9_LPC_SMI_F_BROADCAST_BIT)) {
-            CPUState *cs;
-            CPU_FOREACH(cs) {
-                cpu_interrupt(cs, CPU_INTERRUPT_SMI);
-            }
-        } else {
-            cpu_interrupt(current_cpu, CPU_INTERRUPT_SMI);
+        CPUState *cs;
+        CPU_FOREACH(cs) {
+            cpu_interrupt(cs, CPU_INTERRUPT_SMI);
          }
      }
  }
@@ -830,8 +816,6 @@ static const Property ich9_lpc_properties[] = {
      DEFINE_PROP_BOOL("noreboot", ICH9LPCState, pin_strap.spkr_hi, false),
      DEFINE_PROP_BOOL("smm-compat", ICH9LPCState, pm.smm_compat, false),
      DEFINE_PROP_BOOL("smm-enabled", ICH9LPCState, pm.smm_enabled, false),
-    DEFINE_PROP_BIT64("x-smi-broadcast", ICH9LPCState, smi_host_features,
-                      ICH9_LPC_SMI_F_BROADCAST_BIT, true),
      DEFINE_PROP_BIT64("x-smi-cpu-hotplug", ICH9LPCState, smi_host_features,
                        ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT, true),
      DEFINE_PROP_BIT64("x-smi-cpu-hotunplug", ICH9LPCState, smi_host_features,


Reply via email to