[PATCH 3/5] BIOS changes for KVM HPET (v5)

Beth Kon
2009-06-11T14:41:49Z

kvm/bios/acpi-dsdt.dsl | 2 --
kvm/bios/rombios32.c | 11 +++--------
2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/kvm/bios/acpi-dsdt.dsl b/kvm/bios/acpi-dsdt.dsl
index db57307..71d0a5e 100755
--- a/kvm/bios/acpi-dsdt.dsl
+++ b/kvm/bios/acpi-dsdt.dsl
@@ -296,7 +296,6 @@ DefinitionBlock (
})
}
#ifdef BX_QEMU
-#ifdef HPET_WORKS_IN_KVM
Device(HPET) {
Name(_HID, EISAID("PNP0103"))
Name(_UID, 0)
@@ -316,7 +315,6 @@ DefinitionBlock (
})
}
#endif
-#endif
}

Scope(\_SB.PCI0) {
diff --git a/kvm/bios/rombios32.c b/kvm/bios/rombios32.c
index 9d6910e..1106f38 100755
--- a/kvm/bios/rombios32.c
+++ b/kvm/bios/rombios32.c
@@ -1518,8 +1518,8 @@ struct acpi_20_generic_address {
} __attribute__((__packed__));

/*
- * * HPET Description Table
- * */
+ * HPET Description Table
+ */
struct acpi_20_hpet {
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
uint32_t timer_block_id;
@@ -1703,13 +1703,11 @@ void acpi_bios_init(void)
addr += madt_size;

#ifdef BX_QEMU
-#ifdef HPET_WORKS_IN_KVM
addr = (addr + 7) & ~7;
hpet_addr = addr;
hpet = (void *)(addr);
addr += sizeof(*hpet);
#endif
-#endif

/* RSDP */
memset(rsdp, 0, sizeof(*rsdp));
@@ -1883,7 +1881,6 @@ void acpi_bios_init(void)
}

/* HPET */
-#ifdef HPET_WORKS_IN_KVM
memset(hpet, 0, sizeof(*hpet));
/* Note timer_block_id value must be kept in sync with value advertised by
* emulated hpet
@@ -1892,7 +1889,6 @@ void acpi_bios_init(void)
hpet->addr.address = cpu_to_le32(ACPI_HPET_ADDRESS);
acpi_build_table_header((struct acpi_table_header *)hpet,
"HPET", sizeof(*hpet), 1);
-#endif

acpi_additional_tables(); /* resets cfg to required entry */
for(i = 0; i < external_tables; i++) {
@@ -1912,8 +1908,7 @@ void acpi_bios_init(void)
/* kvm has no ssdt (processors are in dsdt) */
// rsdt->table_offset_entry[nb_rsdt_entries++] = cpu_to_le32(ssdt_addr);
#ifdef BX_QEMU
- /* No HPET (yet) */
-// rsdt->table_offset_entry[nb_rsdt_entries++] = cpu_to_le32(hpet_addr);
+ rsdt->table_offset_entry[nb_rsdt_entries++] = cpu_to_le32(hpet_addr);
if (nb_numa_nodes > 0)
rsdt->table_offset_entry[nb_rsdt_entries++] = cpu_to_le32(srat_addr);
#endif