[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] x86/wakeup: Fix code generation for bogus_saved_magic



commit c839c8c3fc87de632f84d5098ff1d2c0c081c5a9
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri Nov 8 16:54:34 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Mon Nov 11 15:25:39 2024 +0000

    x86/wakeup: Fix code generation for bogus_saved_magic
    
    bogus_saved_magic() is assembled in a .code64 section but invoked in 32bit
    mode.  Moving it causes a real encoding difference.
    
    Before:
      66 c7 04 25 14 80 0b 00 53 0e    movw   $0xe53,0xb8014(,%eiz,1)
    
    After:
      66 c7 05 14 80 0b 00 53 0e       movw   $0xe53,0xb8014
    
    The difference happens to be benign, but move the logic back into a .code32
    for sanity sake.  Annotate it with ELF metadata while doing so.
    
    Fixes: d8c8fef09054 ("Provide basic Xen PM infrastructure")
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Frediano Ziglio <frediano.ziglio@xxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/boot/wakeup.S | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/boot/wakeup.S b/xen/arch/x86/boot/wakeup.S
index 08447e1934..c929fe9218 100644
--- a/xen/arch/x86/boot/wakeup.S
+++ b/xen/arch/x86/boot/wakeup.S
@@ -153,15 +153,16 @@ wakeup_32:
         /* Now in compatibility mode. Long-jump to 64-bit mode */
         ljmp    $BOOT_CS64, $bootsym_rel(wakeup_64,6)
 
+FUNC_LOCAL(bogus_saved_magic, 0)
+        movw    $0x0e00 + 'S', 0xb8014
+        jmp     bogus_saved_magic
+END(bogus_saved_magic)
+
         .code64
 wakeup_64:
         /* Jump to high mappings and the higher-level wakeup code. */
         movabs  $s3_resume, %rbx
         jmp     *%rbx
 
-bogus_saved_magic:
-        movw    $0x0e00 + 'S', 0xb8014
-        jmp     bogus_saved_magic
-
 /* Stack for wakeup: rest of first trampoline page. */
 ENTRY(wakeup_stack_start)
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.