]> xenbits.xensource.com Git - xen.git/commitdiff
x86/S3: Restore cr4 later during resume
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 13 Dec 2019 17:56:40 +0000 (17:56 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 18 Dec 2019 11:42:54 +0000 (11:42 +0000)
Just like the BSP/AP paths, %cr4 is loaded with only PAE.  Defer restoring all
of %cr4 (MCE in particular) until all the system structures (IDT/TSS in
particular) have been loaded.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/acpi/suspend.c
xen/arch/x86/acpi/wakeup_prot.S

index c9dea67bf325afc64e8e775f98e01496deb15f8b..32d0f71ffde2e699ab284fe94361f09149705ce9 100644 (file)
@@ -43,6 +43,9 @@ void restore_rest_processor_state(void)
 {
     load_system_tables();
 
+    /* Restore full CR4 (inc MCE) now that the IDT is in place. */
+    write_cr4(mmu_cr4_features);
+
     /* Recover syscall MSRs */
     wrmsrl(MSR_LSTAR, saved_lstar);
     wrmsrl(MSR_CSTAR, saved_cstar);
index 2f6c8e18ef2c2b648edab6db737572b431937352..a81849fd2b9508bfa91e7472eea4048d2300c909 100644 (file)
@@ -45,10 +45,6 @@ ENTRY(do_suspend_lowlevel)
 ENTRY(s3_resume)
         lgdt    boot_gdtr(%rip)
 
-        /* mmu_cr4_features contains latest cr4 setting */
-        mov     REF(mmu_cr4_features), GREG(ax)
-        mov     GREG(ax), %cr4
-
         mov     REF(saved_cr0), GREG(ax)
         mov     GREG(ax), %cr0