ia64/xen-unstable

changeset 9039:c823e60207f0

Support XENFEAT_supervisor_mode_kernel in x86/64 HYPERVISOR_IRET macro

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian.Campbell@xensource.com
date Mon Feb 27 10:58:17 2006 +0000 (2006-02-27)
parents f1e5b29dd15a
children b75d80269ff4 57cd768791d1
files linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S	Mon Feb 27 10:55:13 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/entry-xen.S	Mon Feb 27 10:58:17 2006 +0000
     1.3 @@ -51,6 +51,7 @@
     1.4  #include <asm/page.h>
     1.5  #include <asm/errno.h>
     1.6  #include <xen/interface/arch-x86_64.h>
     1.7 +#include <xen/interface/features.h>
     1.8  
     1.9  #include "irq_vectors.h"
    1.10  
    1.11 @@ -146,16 +147,19 @@ NMI_MASK = 0x80000000
    1.12           */
    1.13  	.macro HYPERVISOR_IRET flag
    1.14  	testb $3,1*8(%rsp)
    1.15 -	jnz   1f
    1.16 +	jnz   2f
    1.17  	testl $NMI_MASK,2*8(%rsp)
    1.18 +	jnz   2f
    1.19 +
    1.20 +	testb $1,(xen_features+XENFEAT_supervisor_mode_kernel)
    1.21  	jnz   1f
    1.22  
    1.23  	/* Direct iret to kernel space. Correct CS and SS. */
    1.24  	orb   $3,1*8(%rsp)
    1.25  	orb   $3,4*8(%rsp)
    1.26 -	iretq
    1.27 +1:	iretq
    1.28  
    1.29 -1:	/* Slow iret via hypervisor. */
    1.30 +2:	/* Slow iret via hypervisor. */
    1.31  	andl  $~NMI_MASK, 16(%rsp)
    1.32  	pushq $\flag
    1.33  	jmp  hypercall_page + (__HYPERVISOR_iret * 32)