it still correct for x86 and other users, and can serve us as simpler to
[1] cpu_enabled_status() callback that does the same in a roundabout way.
It's still an RFC, and probably there we should add another property
'enabled' instead of abusing 'realized' and/or handle enabled state
using hotplug handlers chain. i.e. in plug handler store enabled state
AcpiCpuStatus and clear it in unplug handler instead of asking cpu from
MMIO handler directly.
1) bf1ecc8dad606 (w/acpi: Update ACPI `_STA` method with QOM vCPU ACPI Hotplug states)
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
hw/acpi/cpu.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
index 67513450f9..992ae5d233 100644
--- a/hw/acpi/cpu.c
+++ b/hw/acpi/cpu.c
@@ -63,7 +63,9 @@ static uint64_t cpu_hotplug_rd(void *opaque, hwaddr addr, unsigned size)
cdev = &cpu_st->devs[cpu_st->selector];
switch (addr) {
case ACPI_CPU_FLAGS_OFFSET_RW: /* pack and return is_* fields */
- val |= cdev->cpu ? 1 : 0;
+ val |= cdev->cpu ? object_property_get_bool(OBJECT(cdev->cpu),
+ "realized", NULL)
+ : 0;
val |= cdev->is_inserting ? 2 : 0;
val |= cdev->is_removing ? 4 : 0;
val |= cdev->fw_remove ? 16 : 0;
--
2.43.0