mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Support XENFEAT_supervisor_mode_kernel in x86/64 HYPERVISOR_IRET macro
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
This commit is contained in:
1 parent
0fd06de05a
commit
ebc9e1ccdb
1 file changed
+7
-3
@@ -51,6 +51,7 @@
|
||||
#include <asm/page.h>
|
||||
#include <asm/errno.h>
|
||||
#include <xen/interface/arch-x86_64.h>
|
||||
#include <xen/interface/features.h>
|
||||
|
||||
#include "irq_vectors.h"
|
||||
|
||||
@@ -146,16 +147,19 @@ NMI_MASK = 0x80000000
|
||||
*/
|
||||
.macro HYPERVISOR_IRET flag
|
||||
testb $3,1*8(%rsp)
|
||||
jnz 1f
|
||||
jnz 2f
|
||||
testl $NMI_MASK,2*8(%rsp)
|
||||
jnz 2f
|
||||
|
||||
testb $1,(xen_features+XENFEAT_supervisor_mode_kernel)
|
||||
jnz 1f
|
||||
|
||||
/* Direct iret to kernel space. Correct CS and SS. */
|
||||
orb $3,1*8(%rsp)
|
||||
orb $3,4*8(%rsp)
|
||||
iretq
|
||||
1: iretq
|
||||
|
||||
1: /* Slow iret via hypervisor. */
|
||||
2: /* Slow iret via hypervisor. */
|
||||
andl $~NMI_MASK, 16(%rsp)
|
||||
pushq $\flag
|
||||
jmp hypercall_page + (__HYPERVISOR_iret * 32)
|
||||
|
||||