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

[Xen-changelog] [xen master] x86/S3: Don't save unnecessary GPRs



commit a8e9ac0a23b0ef38aa3396b720d9aa0788d8d94f
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri Dec 13 17:52:21 2019 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Dec 18 11:42:54 2019 +0000

    x86/S3: Don't save unnecessary GPRs
    
    Only the callee-preserved registers need saving/restoring.  Spill them to 
the
    stack like regular functions do.  %rsp is now the only GPR which gets 
stashed
    in .data
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/acpi/wakeup_prot.S | 59 +++++++++--------------------------------
 1 file changed, 12 insertions(+), 47 deletions(-)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index 35fd7a5e9f..2f6c8e18ef 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -11,24 +11,14 @@
 #define REF(x)          x(%rip)
 
 ENTRY(do_suspend_lowlevel)
+        push    %rbp
+        push    %rbx
+        push    %r12
+        push    %r13
+        push    %r14
+        push    %r15
 
         SAVE_GREG(sp)
-        SAVE_GREG(ax)
-        SAVE_GREG(bx)
-        SAVE_GREG(cx)
-        SAVE_GREG(dx)
-        SAVE_GREG(bp)
-        SAVE_GREG(si)
-        SAVE_GREG(di)
-
-        SAVE_GREG(8)     # save r8...r15
-        SAVE_GREG(9)
-        SAVE_GREG(10)
-        SAVE_GREG(11)
-        SAVE_GREG(12)
-        SAVE_GREG(13)
-        SAVE_GREG(14)
-        SAVE_GREG(15)
 
         mov     %cr0, GREG(ax)
         mov     GREG(ax), REF(saved_cr0)
@@ -75,22 +65,13 @@ ENTRY(s3_resume)
 
         call restore_rest_processor_state
 
-        LOAD_GREG(bp)
-        LOAD_GREG(ax)
-        LOAD_GREG(bx)
-        LOAD_GREG(cx)
-        LOAD_GREG(dx)
-        LOAD_GREG(si)
-        LOAD_GREG(di)
-        LOAD_GREG(8)     # save r8...r15
-        LOAD_GREG(9)
-        LOAD_GREG(10)
-        LOAD_GREG(11)
-        LOAD_GREG(12)
-        LOAD_GREG(13)
-        LOAD_GREG(14)
-        LOAD_GREG(15)
 .Lsuspend_err:
+        pop     %r15
+        pop     %r14
+        pop     %r13
+        pop     %r12
+        pop     %rbx
+        pop     %rbp
         ret
 
 .data
@@ -101,21 +82,5 @@ GLOBAL(saved_magic)
 
         .align 8
 DECLARE_GREG(sp)
-DECLARE_GREG(bp)
-DECLARE_GREG(ax)
-DECLARE_GREG(bx)
-DECLARE_GREG(cx)
-DECLARE_GREG(dx)
-DECLARE_GREG(si)
-DECLARE_GREG(di)
-
-DECLARE_GREG(8)
-DECLARE_GREG(9)
-DECLARE_GREG(10)
-DECLARE_GREG(11)
-DECLARE_GREG(12)
-DECLARE_GREG(13)
-DECLARE_GREG(14)
-DECLARE_GREG(15)
 
 saved_cr0:      .quad   0
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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