They can also be built with the normal rules, rather than using special logic.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
+++ /dev/null
-#include <xtf/asm_macros.h>
-
-#include <arch/page.h>
-#include <arch/processor.h>
-#include <arch/msr-index.h>
-#include <arch/segment.h>
-
- .code32 /* Always starts in 32bit flat mode. */
-GLOBAL(_start) /* HVM common setup. */
-
-#if CONFIG_PAGING_LEVELS > 0 /* Paging setup for CR3 and CR4 */
-
- /* Set _PAGE_USER on leaf mappings if a test wants them. */
- cmpb $0, test_wants_user_mappings
- je .Lskip_user
-
- mov $l1_identmap, %edx
- mov $l2_identmap_end, %ecx
- sub %edx, %ecx
- shr $PTE_ORDER, %ecx
- add $PTE_SIZE, %edx /* Avoid setting _PAGE_USER in the NULL entry. */
-.Lnext_pte:
- orb $_PAGE_USER, (%edx)
- add $PTE_SIZE, %edx
- loop .Lnext_pte
-.Lskip_user:
-
-#if CONFIG_PAGING_LEVELS == 2
- mov $X86_CR4_PSE, %eax
-#elif CONFIG_PAGING_LEVELS == 3 || CONFIG_PAGING_LEVELS == 4
- mov $X86_CR4_PAE, %eax
-#else
-# error Bad paging mode
-#endif
- mov %eax, %cr4
-
- mov $cr3_target, %ebx
- mov %ebx, %cr3
-#endif /* CONFIG_PAGING_LEVELS > 0 */
-
-#ifdef __x86_64__ /* EFER.LME = 1 */
- mov $MSR_EFER, %ecx
- rdmsr
- bts $_EFER_LME, %eax
- wrmsr
-#endif /* __x86_64__ */
-
-#if CONFIG_PAGING_LEVELS > 0 /* CR0.PG = 1 */
-# define MAYBE_PG X86_CR0_PG
-#else
-# define MAYBE_PG 0
-#endif /* CONFIG_PAGING_LEVELS > 0 */
-
- mov %cr0, %eax
- or $(X86_CR0_WP | MAYBE_PG), %eax
- mov %eax, %cr0
-
- lgdt gdt_ptr
-
- /* Load code segment. */
- ljmp $__KERN_CS, $1f
-#ifdef __x86_64__
- .code64
-#endif
-
- /* Load data segments. */
-1: mov $__USER_DS, %eax
- mov %eax, %ds
- mov %eax, %es
- mov %eax, %fs
- mov %eax, %gs
- mov $__KERN_DS, %eax
- mov %eax, %ss
-
- /* Move onto the boot stack. */
- mov $boot_stack + PAGE_SIZE, %esp
-
- /* Reset flags. */
- push $X86_EFLAGS_MBS
- popf
-
- call xtf_main
-
- /* panic() if xtf_main manages to return. */
-#ifdef __x86_64__
- lea .Lmain_err_msg(%rip), %rdi
-#else
- push $.Lmain_err_msg
-#endif
- call panic
-ENDFUNC(_start)
-
-DECLSTR(.Lmain_err_msg, "xtf_main() returned\n")
-
-/*
- * Local variables:
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
+++ /dev/null
-#include <xtf/asm_macros.h>
-
-#include <arch/page.h>
-
-#include <xen/elfnote.h>
-
-/* Guest name and version */
-ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "XTF")
-ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION, .asciz "0")
-
-/* PV loader */
-ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic")
-ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _WORD hypercall_page)
-
-/* Xen ABI information */
-ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0")
-ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz "!writable_page_tables|pae_pgdir_above_4gb")
-ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE, .asciz "yes")
-
- .text
-#ifdef __x86_64__
- .code64
-#else
- .code32
-#endif
-
- /* PV entry point. */
-GLOBAL(_start)
-
- /* Stash start_info_t pointer from domain build. */
- mov %_ASM_SI, start_info
-
- /* Move onto own stack. */
- mov $boot_stack + PAGE_SIZE, %esp
-
- call xtf_main
-
- /* panic() if xtf_main manages to return. */
-#ifdef __x86_64__
- lea .Lmain_err_msg(%rip), %rdi
-#else
- push $.Lmain_err_msg
-#endif
- call panic
-ENDFUNC(_start)
-
-DECLSTR(.Lmain_err_msg, "xtf_main() returned\n")
-
-/*
- * Local variables:
- * tab-width: 8
- * indent-tabs-mode: nil
- * End:
- */
--- /dev/null
+#include <xtf/asm_macros.h>
+
+#include <arch/page.h>
+#include <arch/processor.h>
+#include <arch/msr-index.h>
+#include <arch/segment.h>
+
+ .code32 /* Always starts in 32bit flat mode. */
+GLOBAL(_start) /* HVM common setup. */
+
+#if CONFIG_PAGING_LEVELS > 0 /* Paging setup for CR3 and CR4 */
+
+ /* Set _PAGE_USER on leaf mappings if a test wants them. */
+ cmpb $0, test_wants_user_mappings
+ je .Lskip_user
+
+ mov $l1_identmap, %edx
+ mov $l2_identmap_end, %ecx
+ sub %edx, %ecx
+ shr $PTE_ORDER, %ecx
+ add $PTE_SIZE, %edx /* Avoid setting _PAGE_USER in the NULL entry. */
+.Lnext_pte:
+ orb $_PAGE_USER, (%edx)
+ add $PTE_SIZE, %edx
+ loop .Lnext_pte
+.Lskip_user:
+
+#if CONFIG_PAGING_LEVELS == 2
+ mov $X86_CR4_PSE, %eax
+#elif CONFIG_PAGING_LEVELS == 3 || CONFIG_PAGING_LEVELS == 4
+ mov $X86_CR4_PAE, %eax
+#else
+# error Bad paging mode
+#endif
+ mov %eax, %cr4
+
+ mov $cr3_target, %ebx
+ mov %ebx, %cr3
+#endif /* CONFIG_PAGING_LEVELS > 0 */
+
+#ifdef __x86_64__ /* EFER.LME = 1 */
+ mov $MSR_EFER, %ecx
+ rdmsr
+ bts $_EFER_LME, %eax
+ wrmsr
+#endif /* __x86_64__ */
+
+#if CONFIG_PAGING_LEVELS > 0 /* CR0.PG = 1 */
+# define MAYBE_PG X86_CR0_PG
+#else
+# define MAYBE_PG 0
+#endif /* CONFIG_PAGING_LEVELS > 0 */
+
+ mov %cr0, %eax
+ or $(X86_CR0_WP | MAYBE_PG), %eax
+ mov %eax, %cr0
+
+ lgdt gdt_ptr
+
+ /* Load code segment. */
+ ljmp $__KERN_CS, $1f
+#ifdef __x86_64__
+ .code64
+#endif
+
+ /* Load data segments. */
+1: mov $__USER_DS, %eax
+ mov %eax, %ds
+ mov %eax, %es
+ mov %eax, %fs
+ mov %eax, %gs
+ mov $__KERN_DS, %eax
+ mov %eax, %ss
+
+ /* Move onto the boot stack. */
+ mov $boot_stack + PAGE_SIZE, %esp
+
+ /* Reset flags. */
+ push $X86_EFLAGS_MBS
+ popf
+
+ call xtf_main
+
+ /* panic() if xtf_main manages to return. */
+#ifdef __x86_64__
+ lea .Lmain_err_msg(%rip), %rdi
+#else
+ push $.Lmain_err_msg
+#endif
+ call panic
+ENDFUNC(_start)
+
+DECLSTR(.Lmain_err_msg, "xtf_main() returned\n")
+
+/*
+ * Local variables:
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ */
--- /dev/null
+#include <xtf/asm_macros.h>
+
+#include <arch/page.h>
+
+#include <xen/elfnote.h>
+
+/* Guest name and version */
+ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "XTF")
+ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION, .asciz "0")
+
+/* PV loader */
+ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic")
+ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _WORD hypercall_page)
+
+/* Xen ABI information */
+ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0")
+ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz "!writable_page_tables|pae_pgdir_above_4gb")
+ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE, .asciz "yes")
+
+ .text
+#ifdef __x86_64__
+ .code64
+#else
+ .code32
+#endif
+
+ /* PV entry point. */
+GLOBAL(_start)
+
+ /* Stash start_info_t pointer from domain build. */
+ mov %_ASM_SI, start_info
+
+ /* Move onto own stack. */
+ mov $boot_stack + PAGE_SIZE, %esp
+
+ call xtf_main
+
+ /* panic() if xtf_main manages to return. */
+#ifdef __x86_64__
+ lea .Lmain_err_msg(%rip), %rdi
+#else
+ push $.Lmain_err_msg
+#endif
+ call panic
+ENDFUNC(_start)
+
+DECLSTR(.Lmain_err_msg, "xtf_main() returned\n")
+
+/*
+ * Local variables:
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ */
COMMON_CFLAGS-x86_32 := -m32
COMMON_CFLAGS-x86_64 := -m64
-head-pv64 := $(ROOT)/arch/x86/boot/head_pv64.o
-head-pv32pae := $(ROOT)/arch/x86/boot/head_pv32pae.o
-head-hvm64 := $(ROOT)/arch/x86/boot/head_hvm64.o
-head-hvm32pae := $(ROOT)/arch/x86/boot/head_hvm32pae.o
-head-hvm32pse := $(ROOT)/arch/x86/boot/head_hvm32pse.o
-head-hvm32 := $(ROOT)/arch/x86/boot/head_hvm32.o
-
defcfg-pv := $(ROOT)/config/default-pv.cfg.in
defcfg-hvm := $(ROOT)/config/default-hvm.cfg.in
AFLAGS_$(1) := $$(AFLAGS_$($(1)_arch)) $$(COMMON_AFLAGS-$(1)) -DCONFIG_ENV_$(1) -include arch/config.h
CFLAGS_$(1) := $$(CFLAGS_$($(1)_arch)) $$(COMMON_CFLAGS-$(1)) -DCONFIG_ENV_$(1) -include arch/config.h
+head-$(1) := $(ROOT)/arch/x86/$($(1)_guest)/head-$(1).o
link-$(1) := $(ROOT)/arch/x86/link-$(1).lds
LDFLAGS_$(1) := -Wl,-T,$$(link-$(1)) -nostdlib $(LDFLAGS-y)
# Needs to pick up test-provided obj-perenv and obj-perarch
-DEPS-$(1) = $(head-$(1)) \
+DEPS-$(1) = $$(head-$(1)) \
$$(obj-perarch:%.o=%-$($(1)_arch).o) \
$$(obj-$(1):%.o=%-$(1).o) $$(obj-perenv:%.o=%-$(1).o)
-# Generate head with approprate flags
-ifneq ($(findstring $(1),$(PV_ENVIRONMENTS)),)
-# PV guests generate head_$(env).o from head_pv.S
-%/head_$(1).o: %/head_pv.S
- $$(CC) $$(AFLAGS_$(1)) -c $$< -o $$@
-endif
-ifneq ($(findstring $(1),$(HVM_ENVIRONMENTS)),)
-# HVM guests generate head_$(env).o from head_hvm.S
-%/head_$(1).o: %/head_hvm.S
- $$(CC) $$(AFLAGS_$(1)) -c $$< -o $$@
-endif
-
# Generate .lds with approprate flags
%/link-$(1).lds: %/link.lds.S
$$(CPP) $$(AFLAGS_$(1)) -P -C $$< -o $$@