Commit a7c4c0d9 authored by H. Peter Anvin's avatar H. Peter Anvin

x86, sleep: Always save the value of EFER

Always save the value of EFER, regardless of the state of NX.  Since
EFER may not actually exist, use rdmsr_safe() to do so.

v2: check the return value from rdmsr_safe() instead of relying on
    the output values being unchanged on error.
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
Acked-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Nigel Cunningham <nigel@tuxonice.net>
LKML-Reference: <1258154897-6770-3-git-send-email-hpa@zytor.com>
Acked-by: default avatarKees Cook <kees.cook@canonical.com>
parent 8a50e513
...@@ -78,12 +78,9 @@ int acpi_save_state_mem(void) ...@@ -78,12 +78,9 @@ int acpi_save_state_mem(void)
#ifndef CONFIG_64BIT #ifndef CONFIG_64BIT
store_gdt((struct desc_ptr *)&header->pmode_gdt); store_gdt((struct desc_ptr *)&header->pmode_gdt);
header->pmode_efer_low = nx_enabled; if (rdmsr_safe(MSR_EFER, &header->pmode_efer_low,
if (header->pmode_efer_low & 1) { &header->pmode_efer_high))
/* This is strange, why not save efer, always? */ header->pmode_efer_low = header->pmode_efer_high = 0;
rdmsr(MSR_EFER, header->pmode_efer_low,
header->pmode_efer_high);
}
#endif /* !CONFIG_64BIT */ #endif /* !CONFIG_64BIT */
header->pmode_cr0 = read_cr0(); header->pmode_cr0 = read_cr0();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment