xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Juergen Gross <jgross@suse.com>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Wei Liu <wei.liu2@citrix.com>
Subject: [MINIOS PATCH 4/5] x86_64: introduce and use SAVE_ALL
Date: Thu, 25 Aug 2016 17:38:27 +0100	[thread overview]
Message-ID: <1472143108-26331-5-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1472143108-26331-1-git-send-email-wei.liu2@citrix.com>

Introduce this macro to match RESTORE_ALL. Also delete the unused
SAVE_REST.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 arch/x86/x86_64.S | 38 ++++++++++++++++----------------------
 1 file changed, 16 insertions(+), 22 deletions(-)

diff --git a/arch/x86/x86_64.S b/arch/x86/x86_64.S
index 8432d69..21fa61b 100644
--- a/arch/x86/x86_64.S
+++ b/arch/x86/x86_64.S
@@ -119,14 +119,26 @@ KERNEL_CS_MASK = 0xfc
 	addq $15*8+8,%rsp
 .endm	
 
-.macro SAVE_REST
-	subq $6*8,%rsp
+.macro SAVE_ALL
+	/* rdi slot contains rax, oldrax contains error code */
+	cld
+	subq $14*8,%rsp
+	movq %rsi,13*8(%rsp)
+	movq 14*8(%rsp),%rsi	/* load rax from rdi slot */
+	movq %rdx,12*8(%rsp)
+	movq %rcx,11*8(%rsp)
+	movq %rsi,10*8(%rsp)	/* store rax */
+	movq %r8, 9*8(%rsp)
+	movq %r9, 8*8(%rsp)
+	movq %r10,7*8(%rsp)
+	movq %r11,6*8(%rsp)
 	movq %rbx,5*8(%rsp)
 	movq %rbp,4*8(%rsp)
 	movq %r12,3*8(%rsp)
 	movq %r13,2*8(%rsp)
 	movq %r14,1*8(%rsp)
 	movq %r15,(%rsp)
+	movq %rdi, RDI(%rsp)	/* put rdi into the slot */
 .endm
 
 .macro HYPERVISOR_IRET flag
@@ -154,26 +166,8 @@ KERNEL_CS_MASK = 0xfc
  * and the exception handler in %rax.	
  */ 		  				
 ENTRY(error_entry)
-	/* rdi slot contains rax, oldrax contains error code */
-	cld	
-	subq  $14*8,%rsp
-	movq %rsi,13*8(%rsp)
-	movq 14*8(%rsp),%rsi	/* load rax from rdi slot */
-	movq %rdx,12*8(%rsp)
-	movq %rcx,11*8(%rsp)
-	movq %rsi,10*8(%rsp)	/* store rax */ 
-	movq %r8, 9*8(%rsp)
-	movq %r9, 8*8(%rsp)
-	movq %r10,7*8(%rsp)
-	movq %r11,6*8(%rsp)
-	movq %rbx,5*8(%rsp) 
-	movq %rbp,4*8(%rsp) 
-	movq %r12,3*8(%rsp) 
-	movq %r13,2*8(%rsp) 
-	movq %r14,1*8(%rsp) 
-	movq %r15,(%rsp) 
-
-	movq %rdi, RDI(%rsp)
+	SAVE_ALL
+
 	movq %rsp,%rdi
 	movq ORIG_RAX(%rsp),%rsi	# get error code 
 	movq $-1,ORIG_RAX(%rsp)
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-08-25 16:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-25 16:38 [MINIOS PATCH 0/5] x86 assmebly code clean up Wei Liu
2016-08-25 16:38 ` [MINIOS PATCH 1/5] x86_32: remove inclusion of x86-32.h Wei Liu
2016-08-25 17:02   ` Juergen Gross
2016-08-25 16:38 ` [MINIOS PATCH 2/5] x86_64: remove unused labels Wei Liu
2016-08-25 17:04   ` Juergen Gross
2016-08-25 16:38 ` [MINIOS PATCH 3/5] x86_64: merge RESTORE_REST into RESTORE_ALL Wei Liu
2016-08-25 16:45   ` Wei Liu
2016-08-25 17:07   ` Juergen Gross
2016-08-25 16:38 ` Wei Liu [this message]
2016-08-25 17:09   ` [MINIOS PATCH 4/5] x86_64: introduce and use SAVE_ALL Juergen Gross
2016-08-25 16:38 ` [MINIOS PATCH 5/5] x86_64: don't unnecessarily export some entries Wei Liu
2016-08-25 17:11   ` Juergen Gross
2016-08-25 17:12 ` [MINIOS PATCH 0/5] x86 assmebly code clean up Juergen Gross
2016-08-25 17:42   ` Wei Liu
2016-08-25 17:25 ` Samuel Thibault
2016-08-25 17:48 ` Wei Liu
2016-08-26  8:13   ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472143108-26331-5-git-send-email-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=jgross@suse.com \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).