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] Implement direct iret to guest kernel where possible in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Implement direct iret to guest kernel where possible in HYPERVISOR_IRET macro.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 24 Feb 2006 13:52:07 +0000
Delivery-date: Fri, 24 Feb 2006 13:52:28 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian.Campbell@xxxxxxxxxxxxx
# Node ID e0f563e8db9fb9e15f3a28068d217eca24ad0960
# Parent  e33ebd1437675bc2a4a01f63de359783fc14653f
Implement direct iret to guest kernel where possible in HYPERVISOR_IRET macro.

Returns to guest userspace and from an NMI must still go via the hypervisor.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxxxxx>

diff -r e33ebd143767 -r e0f563e8db9f 
linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S       Fri Feb 24 
09:29:09 2006
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S       Fri Feb 24 
11:05:52 2006
@@ -61,6 +61,8 @@
 #ifndef CONFIG_PREEMPT
 #define retint_kernel retint_restore_args
 #endif 
+
+NMI_MASK = 0x80000000
        
 /*
  * C code is not supposed to know about undefined top of stack. Every time 
@@ -143,6 +145,18 @@
          * #define VGCF_IN_SYSCALL (1<<8) 
          */
        .macro HYPERVISOR_IRET flag
+       testb $3,1*8(%rsp)
+       jnz   1f
+       testl $NMI_MASK,2*8(%rsp)
+       jnz   1f
+
+       /* Direct iret to kernel space. Correct CS and SS. */
+       orb   $3,1*8(%rsp)
+       orb   $3,4*8(%rsp)
+       iretq
+
+1:     /* Slow iret via hypervisor. */
+       andl  $~NMI_MASK, 16(%rsp)
        pushq $\flag
        jmp  hypercall_page + (__HYPERVISOR_iret * 32)
        .endm
@@ -805,6 +819,7 @@
 ENTRY(do_nmi_callback)
         addq $8, %rsp
         call do_nmi
+        orl  $NMI_MASK,EFLAGS(%rsp)
         RESTORE_REST
         XEN_BLOCK_EVENTS(%rsi)
         GET_THREAD_INFO(%rcx)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Implement direct iret to guest kernel where possible in HYPERVISOR_IRET macro., Xen patchbot -unstable <=