pc: acpi-build: create CPU hotplug IO region dynamically
commitddf1ec2ffe30bd6bb34acc020622741eafc16b79
authorIgor Mammedov <imammedo@redhat.com>
Wed, 18 Feb 2015 19:14:44 +0000 (18 19:14 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 26 Feb 2015 12:04:17 +0000 (26 13:04 +0100)
treeba811b534e43a19079f6aa74bffadc1271eb4b68
parent20843d16632c4da3d3d35ddc8d5eb047167693ce
pc: acpi-build: create CPU hotplug IO region dynamically

it replaces a static complied in DSDT MMIO region
for CPU hotplug with one created at runtime
leaving only truly static CPU hotplug related ASL
bits in DSDT.
It also puts CPU_HOTPLUG_RESOURCE_DEVICE into
PCI0 scope and reserves resources from it,
preparing for dropping manual hole punching
in PCI0._CRS.

Later it also would make easier to reuse current
ACPI CPU hotplug on other targets.

Also later it would be possible to move remaining
CPU hotplug ASL methods into build_ssdt() and
add all CPU hotplug related AML into SSDT only
when CPU hotplug is enabled, further reducing
ACPI tables blob if CPU hotplug isn't used.

impl. detail:
Windows XP can't handle /BSODs/ OperationRegion
declaration in DSDT when variable from SSDT is used
for specifying its address/length and also when
Field declared in DSDT with OperationRegion from
SSDT if DSDT is being parsed before SSDT.
But it works just fine when referencing named
fields from another table. Hence OperationRegion
and Field declaration are moved to SSDT to make
XP based editions work.

PS:
Later Windows editions seem to be fine with above
conditions.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/acpi-build.c
hw/i386/acpi-dsdt-cpu-hotplug.dsl
include/hw/acpi/pc-hotplug.h