@@ -96,6 +96,7 @@ typedef enum {
ACPI_PCI_HOTPLUG_STATUS = 2,
ACPI_CPU_HOTPLUG_STATUS = 4,
ACPI_MEMORY_HOTPLUG_STATUS = 8,
+ ACPI_VMGENID_CHANGED_STATUS = 16,
} AcpiGPEStatusBits;
/* structs */
@@ -28,6 +28,9 @@ typedef struct AcpiDeviceIf {
* ospm_status: returns status of ACPI device objects, reported
* via _OST method if device supports it.
*
+ * vm_generation_id_changed: notify the guest that its generation ID has been
+ * changed.
+ *
* Interface is designed for providing unified interface
* to generic ACPI functionality that could be used without
* knowledge about internals of actual device that implements
@@ -39,5 +42,6 @@ typedef struct AcpiDeviceIfClass {
/* <public> */
void (*ospm_status)(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
+ void (*vm_generation_id_changed)(AcpiDeviceIf *adev);
} AcpiDeviceIfClass;
#endif
@@ -77,4 +77,5 @@ void ich9_pm_device_unplug_cb(ICH9LPCPMRegs *pm, DeviceState *dev,
Error **errp);
void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
+void ich9_vm_generation_id_changed(AcpiDeviceIf *adev);
#endif /* HW_ACPI_ICH9_H */
@@ -482,3 +482,11 @@ void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list)
acpi_memory_ospm_status(&s->pm.acpi_memory_hotplug, list);
}
+
+void ich9_vm_generation_id_changed(AcpiDeviceIf *adev)
+{
+ ICH9LPCState *s = ICH9_LPC_DEVICE(adev);
+ ICH9LPCPMRegs *pm = &s->pm;
+
+ acpi_send_gpe_event(&pm->acpi_regs, pm->irq, ACPI_VMGENID_CHANGED_STATUS);
+}
@@ -583,6 +583,13 @@ static void piix4_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list)
acpi_memory_ospm_status(&s->acpi_memory_hotplug, list);
}
+static void piix4_vm_generation_id_changed(AcpiDeviceIf *adev)
+{
+ PIIX4PMState *s = PIIX4_PM(adev);
+
+ acpi_send_gpe_event(&s->ar, s->irq, ACPI_VMGENID_CHANGED_STATUS);
+}
+
static Property piix4_pm_properties[] = {
DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0),
DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 0),
@@ -621,6 +628,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data)
hc->unplug_request = piix4_device_unplug_request_cb;
hc->unplug = piix4_device_unplug_cb;
adevc->ospm_status = piix4_ospm_status;
+ adevc->vm_generation_id_changed = piix4_vm_generation_id_changed;
}
static const TypeInfo piix4_pm_info = {
@@ -724,6 +724,7 @@ static void ich9_lpc_class_init(ObjectClass *klass, void *data)
hc->unplug_request = ich9_device_unplug_request_cb;
hc->unplug = ich9_device_unplug_cb;
adevc->ospm_status = ich9_pm_ospm_status;
+ adevc->vm_generation_id_changed = ich9_vm_generation_id_changed;
}
static const TypeInfo ich9_lpc_info = {