From fc8929cb29989fc4caad2b23112637c38aad6ff3 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sun, 11 Jun 2017 14:39:08 +0000 Subject: [PATCH] More accurately handle early EFER restoration on resume. Do not try to set LMA bit while CPU is still in legacy mode. Apparently Intel CPUs ignore non-id writes to LMA, while AMD's (over-)react with #GP. Reported and tested by: danfe Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/x86/acpica/acpi_wakeup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c index 74f4fedc28f1..690f8b765f29 100644 --- a/sys/x86/acpica/acpi_wakeup.c +++ b/sys/x86/acpica/acpi_wakeup.c @@ -224,7 +224,8 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); #ifdef __amd64__ - WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER)); + WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER) & + ~(EFER_LMA)); #else WAKECODE_FIXUP(wakeup_cr4, register_t, pcb->pcb_cr4); #endif