]> xenbits.xensource.com Git - xen.git/commitdiff
x86/MTRR: hook mtrr_bp_restore() back up
authorJan Beulich <jbeulich@suse.com>
Tue, 29 Apr 2025 09:38:58 +0000 (11:38 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 29 Apr 2025 09:38:58 +0000 (11:38 +0200)
Unlike stated in the offending commit's description,
load_system_tables() wasn't the only thing left to retain from the
earlier restore_rest_processor_state(). Note that MTRR state was still
reloaded via mtrr_aps_sync_end(), but that happens quite a bit later in
the resume process.

While there also do Misra-related tidying for the function itself: The
function being used from assembly only means it doesn't need to have a
declaration, but wants to be asmlinkage.

Fixes: 4304ff420e51 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
Reported-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
master commit: 0414dedd6fde1a1c5c5e38dcbef4dad506e1398c
master date: 2025-04-03 09:39:13 +0200

xen/arch/x86/acpi/wakeup_prot.S
xen/arch/x86/cpu/mtrr/main.c
xen/arch/x86/include/asm/mtrr.h

index 8ce57ad137f6b47f29c5cabb3ef383600df4a9f4..a741d58b9117f495e7af58442cf2f1ac2c591cbc 100644 (file)
@@ -124,6 +124,8 @@ LABEL(s3_resume)
         mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
         mov     %rax, %cr4
 
+        call    mtrr_bp_restore
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
index 0a44ebbcb04ff894da90301fa7593a0d48acc0ab..516c8478c6e35282e8eaf8bbd69129438f01b79e 100644 (file)
@@ -609,7 +609,7 @@ void mtrr_aps_sync_end(void)
        hold_mtrr_updates_on_aps = 0;
 }
 
-void mtrr_bp_restore(void)
+void asmlinkage mtrr_bp_restore(void)
 {
        mtrr_set_all();
 }
index 36dac0a775a364899e3fe75f145229458028f787..48b59d2620c8cdf343e174f2939a59b9a00bf93f 100644 (file)
@@ -66,7 +66,6 @@ extern uint8_t pat_type_2_pte_flags(uint8_t pat_type);
 extern int hold_mtrr_updates_on_aps;
 extern void mtrr_aps_sync_begin(void);
 extern void mtrr_aps_sync_end(void);
-extern void mtrr_bp_restore(void);
 
 extern bool mtrr_var_range_msr_set(struct domain *d, struct mtrr_state *m,
                                    uint32_t msr, uint64_t msr_content);