Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx> --- x86/s3.c | 5 +++-- x86/vmexit.c | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/x86/s3.c b/x86/s3.c index 72467a2..8bf71da 100644 --- a/x86/s3.c +++ b/x86/s3.c @@ -1,5 +1,5 @@ #include "libcflat.h" -#include "acpi.h" +#include "x86/acpi.h" u32* find_resume_vector_addr(void) { @@ -40,6 +40,7 @@ extern char resume_start, resume_end; int main(int argc, char **argv) { + struct fadt_descriptor_rev1 *fadt = find_acpi_table_addr(FACP_SIGNATURE); volatile u32 *resume_vector_ptr = find_resume_vector_addr(); char *addr, *resume_vec = (void*)0x1000; @@ -60,7 +61,7 @@ int main(int argc, char **argv) rtc_out(RTC_REG_B, rtc_in(RTC_REG_B) | REG_B_AIE); *(volatile int*)0 = 0; - asm volatile("outw %0, %1" :: "a"((short)0x2400), "d"((short)0xb004):"memory"); + asm volatile("outw %0, %1" :: "a"((short)0x2400), "d"((short)fadt->pm1a_cnt_blk):"memory"); while(1) *(volatile int*)0 = 1; diff --git a/x86/vmexit.c b/x86/vmexit.c index 3bd0c81..1413454 100644 --- a/x86/vmexit.c +++ b/x86/vmexit.c @@ -5,6 +5,7 @@ #include "x86/vm.h" #include "x86/desc.h" #include "x86/pci.h" +#include "x86/acpi.h" struct test { void (*func)(void); @@ -104,9 +105,10 @@ static void ipi_halt(void) ; } +int pm_tmr_blk; static void inl_pmtimer(void) { - inl(0xb008); + inl(pm_tmr_blk); } static void inl_nop_qemu(void) @@ -406,6 +408,7 @@ bool test_wanted(struct test *test, char *wanted[], int nwanted) int main(int ac, char **av) { + struct fadt_descriptor_rev1 *fadt; int i; unsigned long membar = 0, base, offset; void *m; @@ -418,6 +421,10 @@ int main(int ac, char **av) for (i = cpu_count(); i > 0; i--) on_cpu(i-1, enable_nx, 0); + fadt = find_acpi_table_addr(FACP_SIGNATURE); + pm_tmr_blk = fadt->pm_tmr_blk; + printf("PM timer port is %x\n", pm_tmr_blk); + pcidev = pci_find_dev(0x1b36, 0x0005); if (pcidev) { for (i = 0; i < 2; i++) { -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html