diff mbox series

[5/6] x86/suspend: Expand macros in wakeup_prot.S

Message ID 20191213190436.24475-6-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show
Series x86/suspend: State cleanup | expand

Commit Message

Andrew Cooper Dec. 13, 2019, 7:04 p.m. UTC
Most users have been dropped, and they do nothing but obfuscate the assembly.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/acpi/wakeup_prot.S | 28 +++++++++-------------------
 1 file changed, 9 insertions(+), 19 deletions(-)

Comments

Roger Pau Monné Dec. 17, 2019, 12:32 p.m. UTC | #1
On Fri, Dec 13, 2019 at 07:04:35PM +0000, Andrew Cooper wrote:
> Most users have been dropped, and they do nothing but obfuscate the assembly.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks, Roger.
diff mbox series

Patch

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index a81849fd2b..0ce96e26a9 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -2,14 +2,6 @@ 
         .text
         .code64
 
-#define GREG(x)         %r##x
-#define SAVED_GREG(x)   saved_r##x(%rip)
-#define DECLARE_GREG(x) saved_r##x:     .quad   0
-#define SAVE_GREG(x)    movq GREG(x), SAVED_GREG(x)
-#define LOAD_GREG(x)    movq SAVED_GREG(x), GREG(x)
-
-#define REF(x)          x(%rip)
-
 ENTRY(do_suspend_lowlevel)
         push    %rbp
         push    %rbx
@@ -18,10 +10,10 @@  ENTRY(do_suspend_lowlevel)
         push    %r14
         push    %r15
 
-        SAVE_GREG(sp)
+        mov     %rsp, saved_rsp(%rip)
 
-        mov     %cr0, GREG(ax)
-        mov     GREG(ax), REF(saved_cr0)
+        mov     %cr0, %rax
+        mov     %rax, saved_cr0(%rip)
 
         call    save_rest_processor_state
 
@@ -45,12 +37,12 @@  ENTRY(do_suspend_lowlevel)
 ENTRY(s3_resume)
         lgdt    boot_gdtr(%rip)
 
-        mov     REF(saved_cr0), GREG(ax)
-        mov     GREG(ax), %cr0
+        mov     saved_cr0(%rip), %rax
+        mov     %rax, %cr0
 
         mov     $__HYPERVISOR_DS64, %eax
         mov     %eax, %ss
-        LOAD_GREG(sp)
+        mov     saved_rsp(%rip), %rsp
 
         /* Reload code selector */
         pushq   $__HYPERVISOR_CS
@@ -73,10 +65,8 @@  ENTRY(s3_resume)
 .data
         .align 16
 
+saved_rsp:      .quad   0
+saved_cr0:      .quad   0
+
 GLOBAL(saved_magic)
         .long   0x9abcdef0
-
-        .align 8
-DECLARE_GREG(sp)
-
-saved_cr0:      .quad   0