|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 14/16] x86: make entry point code build when !CONFIG_PV
Skip building x86_64/compat/entry.S and put CONFIG_PV in
x86_64/entry.S.
Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
v2: new
---
xen/arch/x86/x86_64/Makefile | 2 +-
xen/arch/x86/x86_64/entry.S | 30 ++++++++++++++++++++++++++++--
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/xen/arch/x86/x86_64/Makefile b/xen/arch/x86/x86_64/Makefile
index f336a6a..4bfa148 100644
--- a/xen/arch/x86/x86_64/Makefile
+++ b/xen/arch/x86/x86_64/Makefile
@@ -1,4 +1,4 @@
-subdir-y += compat
+subdir-$(CONFIG_PV) += compat
obj-bin-y += entry.o
obj-y += traps.o
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 319f923..16cd911 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -15,6 +15,7 @@
#include <public/xen.h>
#include <irq_vectors.h>
+#ifdef CONFIG_PV
/* %rbx: struct vcpu */
ENTRY(switch_to_kernel)
leaq VCPU_trap_bounce(%rbx),%rdx
@@ -537,6 +538,7 @@ ENTRY(dom_crash_sync_extable)
xorl %edi,%edi
jmp asm_domain_crash_synchronous /* Does not return */
.popsection
+#endif /* CONFIG_PV */
/* --- CODE BELOW THIS LINE (MOSTLY) NOT GUEST RELATED --- */
@@ -548,10 +550,14 @@ ENTRY(ret_from_intr)
GET_CURRENT(bx)
testb $3, UREGS_cs(%rsp)
jz restore_all_xen
+#ifdef CONFIG_PV
movq VCPU_domain(%rbx), %rax
cmpb $0, DOMAIN_is_32bit_pv(%rax)
je test_all_events
jmp compat_test_all_events
+#else
+ BUG
+#endif
.section .text.entry, "ax", @progbits
@@ -596,8 +602,9 @@ ENTRY(common_interrupt)
cmovnz %r12, %r15
cmovnz %r12d, %ebx
.Lintr_cr3_okay:
-
+#ifdef CONFIG_PV
CR4_PV32_RESTORE
+#endif
movq %rsp,%rdi
callq do_IRQ
mov %r15, STACK_CPUINFO_FIELD(xen_cr3)(%r14)
@@ -634,12 +641,15 @@ handle_exception_saved:
testb $X86_EFLAGS_IF>>8,UREGS_eflags+1(%rsp)
jz exception_with_ints_disabled
+#ifdef CONFIG_PV
ALTERNATIVE_2 "jmp .Lcr4_pv32_done", \
__stringify(mov VCPU_domain(%rbx), %rax), X86_FEATURE_XEN_SMEP, \
__stringify(mov VCPU_domain(%rbx), %rax), X86_FEATURE_XEN_SMAP
+#endif
testb $3,UREGS_cs(%rsp)
jz .Lcr4_pv32_done
+#ifdef CONFIG_PV
cmpb $0,DOMAIN_is_32bit_pv(%rax)
je .Lcr4_pv32_done
call cr4_pv32_restore
@@ -672,6 +682,9 @@ handle_exception_saved:
xor UREGS_error_code(%rsp),%eax
test $~(PFEC_write_access|PFEC_insn_fetch),%eax
jz compat_test_all_events
+#else
+ BUG
+#endif /* CONFIG_PV */
.Lcr4_pv32_done:
sti
1: movq %rsp,%rdi
@@ -684,10 +697,14 @@ handle_exception_saved:
mov %r13b, STACK_CPUINFO_FIELD(use_pv_cr3)(%r14)
testb $3,UREGS_cs(%rsp)
jz restore_all_xen
+#ifdef CONFIG_PV
movq VCPU_domain(%rbx),%rax
cmpb $0, DOMAIN_is_32bit_pv(%rax)
jne compat_test_all_events
jmp test_all_events
+#else
+ BUG
+#endif
/* No special register assumptions. */
exception_with_ints_disabled:
@@ -837,10 +854,12 @@ handle_ist_exception:
/* %r12 is still zero at this point. */
mov %r12, STACK_CPUINFO_FIELD(xen_cr3)(%r14)
.List_cr3_okay:
-
+#ifdef CONFIG_PV
CR4_PV32_RESTORE
+#endif
testb $3,UREGS_cs(%rsp)
jz 1f
+#ifdef CONFIG_PV
/*
* Interrupted guest context. Clear the restore value for xen_cr3
* and copy the context to stack bottom.
@@ -852,6 +871,9 @@ handle_ist_exception:
movl $UREGS_kernel_sizeof/8,%ecx
movq %rdi,%rsp
rep movsq
+#else
+ BUG
+#endif
1: movq %rsp,%rdi
movzbl UREGS_entry_vector(%rsp),%eax
leaq exception_table(%rip),%rdx
@@ -865,7 +887,11 @@ handle_ist_exception:
/* We want to get straight to the IRET on the NMI exit path. */
testb $3,UREGS_cs(%rsp)
jz restore_all_xen
+#ifdef CONFIG_PV
jmp self_ipi_restore_all_guest
+#else
+ BUG
+#endif
ENTRY(machine_check)
pushq $0
--
git-series 0.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |