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

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 <>
Acked-by: default avatarRafael J. Wysocki <>
Cc: Pavel Machek <>
Cc: Nigel Cunningham <>
LKML-Reference: <>
Acked-by: default avatarKees Cook <>
parent 8a50e513
......@@ -78,12 +78,9 @@ int acpi_save_state_mem(void)
#ifndef CONFIG_64BIT
store_gdt((struct desc_ptr *)&header->pmode_gdt);
header->pmode_efer_low = nx_enabled;
if (header->pmode_efer_low & 1) {
/* This is strange, why not save efer, always? */
rdmsr(MSR_EFER, header->pmode_efer_low,
if (rdmsr_safe(MSR_EFER, &header->pmode_efer_low,
header->pmode_efer_low = header->pmode_efer_high = 0;
#endif /* !CONFIG_64BIT */
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