[patch 21/43] lguest: Reorder guest saved regs to match hyperall order

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

 



Move eax next to ebx/ecx/edx in struct lguest_regs on i386, so they
will be located together and allow it to map directly to a struct
hcall_ring entry (which will be renamed struct hcall_args as in a
subsequent patch).

This is in preparation for making the code hcall code architecture
independent.

Signed-off-by: Jes Sorensen <jes@xxxxxxx>
Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
---
 drivers/lguest/i386_switcher.S |    4 ++--
 include/asm-i386/lguest.h      |    3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

===================================================================
--- linux-2.6.23-rc3.orig/drivers/lguest/i386_switcher.S
+++ linux-2.6.23-rc3/drivers/lguest/i386_switcher.S
@@ -134,6 +134,7 @@ ENTRY(switch_to_guest)
 	// The Guest's register page has been mapped
 	// Writable onto our %esp (stack) --
 	// We can simply pop off all Guest regs.
+	popl	%eax
 	popl	%ebx
 	popl	%ecx
 	popl	%edx
@@ -141,7 +142,6 @@ ENTRY(switch_to_guest)
 	popl	%edi
 	popl	%ebp
 	popl	%gs
-	popl	%eax
 	popl	%fs
 	popl	%ds
 	popl	%es
@@ -169,7 +169,6 @@ ENTRY(switch_to_guest)
 	pushl	%es;							\
 	pushl	%ds;							\
 	pushl	%fs;							\
-	pushl	%eax;							\
 	pushl	%gs;							\
 	pushl	%ebp;							\
 	pushl	%edi;							\
@@ -177,6 +176,7 @@ ENTRY(switch_to_guest)
 	pushl	%edx;							\
 	pushl	%ecx;							\
 	pushl	%ebx;							\
+	pushl	%eax;							\
 	/* Our stack and our code are using segments			\
 	 * Set in the TSS and IDT					\
 	 * Yet if we were to touch data we'd use			\
===================================================================
--- linux-2.6.23-rc3.orig/include/asm-i386/lguest.h
+++ linux-2.6.23-rc3/include/asm-i386/lguest.h
@@ -26,10 +26,9 @@ extern unsigned long default_idt_entries
 struct lguest_regs
 {
 	/* Manually saved part. */
-	unsigned long ebx, ecx, edx;
+	unsigned long eax, ebx, ecx, edx;
 	unsigned long esi, edi, ebp;
 	unsigned long gs;
-	unsigned long eax;
 	unsigned long fs, ds, es;
 	unsigned long trapnum, errcode;
 	/* Trap pushed part */

--
   there are those who do and those who hang on and you don't see too
   many doers quoting their contemporaries.  -- Larry McVoy

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux