WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fix create_bounce_frame() for both x86/32 and x86/64 (ea

To: xen-changelog@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix create_bounce_frame() for both x86/32 and x86/64 (each was broken
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Wed, 23 Mar 2005 16:16:02 +0000
Delivery-date: Wed, 23 Mar 2005 17:09:03 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-changelog>
List-help: <mailto:xen-changelog-request@lists.sourceforge.net?subject=help>
List-id: <xen-changelog.lists.sourceforge.net>
List-post: <mailto:xen-changelog@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.sourceforge.net?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-admin@xxxxxxxxxxxxxxxxxxxxx
ChangeSet 1.1355, 2005/03/23 16:16:02+00:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Fix create_bounce_frame() for both x86/32 and x86/64 (each was broken
        in a different way).
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 x86_32/asm-offsets.c |    2 ++
 x86_32/entry.S       |   14 +++-----------
 x86_64/entry.S       |    2 +-
 3 files changed, 6 insertions(+), 12 deletions(-)


diff -Nru a/xen/arch/x86/x86_32/asm-offsets.c 
b/xen/arch/x86/x86_32/asm-offsets.c
--- a/xen/arch/x86/x86_32/asm-offsets.c 2005-03-23 12:03:18 -05:00
+++ b/xen/arch/x86/x86_32/asm-offsets.c 2005-03-23 12:03:18 -05:00
@@ -47,6 +47,8 @@
     OFFSET(EDOMAIN_failsafe_addr, struct exec_domain, arch.failsafe_address);
     OFFSET(EDOMAIN_trap_bounce, struct exec_domain, arch.trap_bounce);
     OFFSET(EDOMAIN_thread_flags, struct exec_domain, arch.flags);
+    OFFSET(EDOMAIN_kernel_ss, struct exec_domain, arch.kernel_ss);
+    OFFSET(EDOMAIN_kernel_sp, struct exec_domain, arch.kernel_sp);
     BLANK();
 
     OFFSET(VCPUINFO_upcall_pending, vcpu_info_t, evtchn_upcall_pending);
diff -Nru a/xen/arch/x86/x86_32/entry.S b/xen/arch/x86/x86_32/entry.S
--- a/xen/arch/x86/x86_32/entry.S       2005-03-23 12:03:18 -05:00
+++ b/xen/arch/x86/x86_32/entry.S       2005-03-23 12:03:18 -05:00
@@ -299,23 +299,15 @@
                 
 /* CREATE A BASIC EXCEPTION FRAME ON GUEST OS (RING-1) STACK:            */
 /*   {EIP, CS, EFLAGS, [ESP, SS]}                                        */
-/* %edx == trap_bounce, %ebx == task_struct                              */
+/* %edx == trap_bounce, %ebx == struct exec_domain                       */
 /* %eax,%ecx are clobbered. %gs:%esi contain new XREGS_ss/XREGS_esp. */
 create_bounce_frame:
         movl XREGS_eflags+4(%esp),%ecx
         movb XREGS_cs+4(%esp),%cl
         testl $(2|X86_EFLAGS_VM),%ecx
         jz   ring1 /* jump if returning to an existing ring-1 activation */
-        /* obtain ss/esp from TSS -- no current ring-1 activations */
-        movl EDOMAIN_processor(%ebx),%eax
-        /* next 4 lines multiply %eax by 8320, which is sizeof(tss_struct) */
-        movl %eax, %ecx
-        shll $7, %ecx
-        shll $13, %eax
-        addl %ecx,%eax
-        addl $init_tss + 12,%eax
-        movl (%eax),%esi /* tss->esp1 */
-FLT6:   movl 4(%eax),%gs /* tss->ss1  */
+        movl EDOMAIN_kernel_sp(%ebx),%esi
+FLT6:   movl EDOMAIN_kernel_ss(%ebx),%gs
         testl $X86_EFLAGS_VM,XREGS_eflags+4(%esp)
         jz   nvm86_1
         subl $16,%esi       /* push ES/DS/FS/GS (VM86 stack frame) */
diff -Nru a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S       2005-03-23 12:03:18 -05:00
+++ b/xen/arch/x86/x86_64/entry.S       2005-03-23 12:03:18 -05:00
@@ -165,11 +165,11 @@
         testb $TF_kernel_mode,EDOMAIN_thread_flags(%rbx)
         jnz   1f
         /* Push new frame at registered guest-OS stack base. */
-        movq  EDOMAIN_kernel_sp(%rbx),%rsi
         pushq %rdx
         movq  %rbx,%rdi
         call  SYMBOL_NAME(toggle_guest_mode)
         popq  %rdx
+        movq  EDOMAIN_kernel_sp(%rbx),%rsi
         jmp   2f
 1:      /* In kernel context already: push new frame at existing %rsp. */
         movq  XREGS_rsp+8(%rsp),%rsi


-------------------------------------------------------
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix create_bounce_frame() for both x86/32 and x86/64 (each was broken, BitKeeper Bot <=