aboutsummaryrefslogtreecommitdiff
path: root/hw/pc_piix.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2012-06-04 14:31:55 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2012-06-19 13:36:56 -0500
commit459ae5ea5ad682c2b3220beb244d4102c1a4e332 (patch)
treed6959529e733678024a1be608bf65948610e8fff /hw/pc_piix.c
parentdcff25f2cd8c11a9368cc2369aeb0319c32d9e26 (diff)
Add PIIX4 properties to control PM system states.
This patch adds two things. First it allows QEMU to distinguish between regular powerdown and S4 powerdown. Later separate QMP notification will be added for S4 powerdown. Second it allows S3/S4 states to be disabled from QEMU command line. Some guests known to be broken with regards to power management, but allow to use it anyway. Using new properties management will be able to disable S3/S4 for such guests. Supported system state are passed to a firmware using new fw_cfg file. The file contains 6 byte array. Each byte represents one system state. If byte at offset X has its MSB set it means that system state X is supported and to enter it guest should use the value from lowest 3 bits. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pc_piix.c')
-rw-r--r--hw/pc_piix.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index d68f77a9c0..b7e90a8298 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -147,6 +147,7 @@ static void pc_init1(MemoryRegion *system_memory,
MemoryRegion *ram_memory;
MemoryRegion *pci_memory;
MemoryRegion *rom_memory;
+ void *fw_cfg = NULL;
pc_cpus_init(cpu_model);
@@ -173,7 +174,7 @@ static void pc_init1(MemoryRegion *system_memory,
/* allocate ram and load rom/bios */
if (!xen_enabled()) {
- pc_memory_init(system_memory,
+ fw_cfg = pc_memory_init(system_memory,
kernel_filename, kernel_cmdline, initrd_filename,
below_4g_mem_size, above_4g_mem_size,
pci_enabled ? rom_memory : system_memory, &ram_memory);
@@ -277,7 +278,7 @@ static void pc_init1(MemoryRegion *system_memory,
/* TODO: Populate SPD eeprom data. */
smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100,
gsi[9], *smi_irq,
- kvm_enabled());
+ kvm_enabled(), fw_cfg);
smbus_eeprom_init(smbus, 8, NULL, 0);
}