From: Jes Sorensen Date: Mon, 22 Oct 2007 01:03:29 +0000 (+1000) Subject: Reorder guest saved regs to match hyperall order X-Git-Tag: upstream/snapshot3+hdmi~29332^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4614a3a3b638dfd7a67d0237944f6a76331af61d;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Reorder guest saved regs to match hyperall order 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 Signed-off-by: Rusty Russell --- diff --git a/drivers/lguest/x86/switcher_32.S b/drivers/lguest/x86/switcher_32.S index e66cec5..1010b90 100644 --- a/drivers/lguest/x86/switcher_32.S +++ b/drivers/lguest/x86/switcher_32.S @@ -133,6 +133,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 @@ -140,7 +141,6 @@ ENTRY(switch_to_guest) popl %edi popl %ebp popl %gs - popl %eax popl %fs popl %ds popl %es @@ -168,7 +168,6 @@ ENTRY(switch_to_guest) pushl %es; \ pushl %ds; \ pushl %fs; \ - pushl %eax; \ pushl %gs; \ pushl %ebp; \ pushl %edi; \ @@ -176,6 +175,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 \ diff --git a/include/asm-x86/lguest.h b/include/asm-x86/lguest.h index f10f1c6..ccd3384 100644 --- a/include/asm-x86/lguest.h +++ b/include/asm-x86/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 */