From a4e2b9adbba95c2d783761e84444bbb3c8d6107b Mon Sep 17 00:00:00 2001 From: Marcelo Tosatti Date: Tue, 17 Jul 2012 14:18:00 -0300 Subject: [PATCH] enable USE_PLATFORM_CLOCK bit in FADT flags Enable bit 15 (USE_PLATFORM_CLOCK) of FADT flags field so that older Windows guests do not make use of the TSC for timestamping. From the ACPI manual: "A value of one indicates that OSPM should use a platform provided timer to drive any monotonically non-decreasing counters, such as OSPM performance counter services. Which particular platform timer will be used is OSPM specific, however, it is recommended that the timer used is based on the following algorithm: If the HPET is exposed to OSPM, OSPM should use the HPET. Otherwise, OSPM will use the ACPI power management timer. A value of one indicates that the platform is known to have a correctly implemented ACPI power management timer." Problems using the TSC include: 1) Migration to a host with different frequency. 2) Unsynchronized TSCs in SMP hosts (KVM does not guarantee synchronization). 3) Processors which do not increment TSC on low power states. Signed-off-by: Marcelo Tosatti --- src/acpi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/acpi.c b/src/acpi.c index 55e4607..9071bd4 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -294,8 +294,9 @@ build_fadt(struct pci_device *pci) fadt->plvl2_lat = cpu_to_le16(0xfff); // C2 state not supported fadt->plvl3_lat = cpu_to_le16(0xfff); // C3 state not supported pci_init_device(fadt_init_tbl, pci, fadt); - /* WBINVD + PROC_C1 + SLP_BUTTON + RTC_S4 */ - fadt->flags = cpu_to_le32((1 << 0) | (1 << 2) | (1 << 5) | (1 << 7)); + /* WBINVD + PROC_C1 + SLP_BUTTON + FIX_RTC + USE_PLATFORM_CLOCK */ + fadt->flags = cpu_to_le32((1 << 0) | (1 << 2) | (1 << 5) | (1 << 6) | + (1 << 15)); build_header((void*)fadt, FACP_SIGNATURE, sizeof(*fadt), 1); -- 2.39.5