From 3688542d5eac45ac55608fd613e495897bdbf67e Mon Sep 17 00:00:00 2001 From: Yin Fengwei Date: Tue, 23 Oct 2018 16:24:49 +0800 Subject: [PATCH 01/18] unit-test: avoid invoke configure We do know what kind of guest we want to build. So add the files generated during running cmd configure. Then we could just do make to build unit-test. Signed-off-by: Yin Fengwei --- Makefile | 2 +- config.mak | 21 +++++++++++++++++++++ lib/asm | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 config.mak create mode 120000 lib/asm diff --git a/Makefile b/Makefile index 7c0f8e2..05d8133 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,7 @@ libfdt_clean: $(LIBFDT_objdir)/.*.d distclean: clean libfdt_clean - $(RM) lib/asm config.mak $(TEST_DIR)-run msr.out cscope.* build-head + $(RM) $(TEST_DIR)-run msr.out cscope.* build-head $(RM) -r tests logs logs.old cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/asm-generic diff --git a/config.mak b/config.mak new file mode 100644 index 0000000..c3ed4e1 --- /dev/null +++ b/config.mak @@ -0,0 +1,21 @@ +SRCDIR=${shell pwd} +PREFIX=/usr/local +HOST=x86_64 +ARCH=x86_64 +ARCH_NAME=x86_64 +PROCESSOR=x86_64 +CC=gcc +CXX=g++ +LD=ld +OBJCOPY=objcopy +OBJDUMP=objdump +AR=ar +ADDR2LINE=addr2line +API= +TEST_DIR=x86 +FIRMWARE= +ENDIAN= +PRETTY_PRINT_STACKS=yes +ENVIRON_DEFAULT=yes +ERRATATXT=errata.txt +U32_LONG_FMT= diff --git a/lib/asm b/lib/asm new file mode 120000 index 0000000..1603718 --- /dev/null +++ b/lib/asm @@ -0,0 +1 @@ +x86/asm \ No newline at end of file From 79eb582b5e58b572767237d1257c445ce0ca804d Mon Sep 17 00:00:00 2001 From: Yin Fengwei Date: Tue, 23 Oct 2018 16:27:02 +0800 Subject: [PATCH 02/18] unit-test: workaround the SMP issue. We don't have fwcfg to pass info from DM to guest. So we hardcode the guest cpu number. And 1 is used because the SMP support in unit-test is blocked by one issue in ACRN. Signed-off-by: Yin Fengwei --- lib/x86/fwcfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/x86/fwcfg.c b/lib/x86/fwcfg.c index c52b445..4ead167 100644 --- a/lib/x86/fwcfg.c +++ b/lib/x86/fwcfg.c @@ -41,5 +41,5 @@ uint64_t fwcfg_get_u64(unsigned index) unsigned fwcfg_get_nb_cpus(void) { - return fwcfg_get_u16(FW_CFG_NB_CPUS); + return 1; } From 3da5b998f4c2951b84ab9890d680e457fb7922de Mon Sep 17 00:00:00 2001 From: Yin Fengwei Date: Tue, 23 Oct 2018 16:28:39 +0800 Subject: [PATCH 03/18] unit-test: update the mutliboot header The test guest needs DM to prepare the mem_* in multiboot info. So we should set the flag in multiboot header to request DM to prepare these info. Signed-off-by: Yin Fengwei --- x86/cstart.S | 2 +- x86/cstart64.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x86/cstart.S b/x86/cstart.S index 143317e..deb8cb5 100644 --- a/x86/cstart.S +++ b/x86/cstart.S @@ -77,7 +77,7 @@ idt_descr: .code32 mb_magic = 0x1BADB002 -mb_flags = 0x0 +mb_flags = 0x2 # multiboot header .long mb_magic, mb_flags, 0 - (mb_magic + mb_flags) diff --git a/x86/cstart64.S b/x86/cstart64.S index 21db10f..f220b4e 100644 --- a/x86/cstart64.S +++ b/x86/cstart64.S @@ -102,7 +102,7 @@ pt_root: .quad ptl4 .code32 mb_magic = 0x1BADB002 -mb_flags = 0x0 +mb_flags = 0x2 # multiboot header .long mb_magic, mb_flags, 0 - (mb_magic + mb_flags) From c729bdd0ab2fb0aeb0201dc654d7e2133d4c1398 Mon Sep 17 00:00:00 2001 From: Jason Chen CJ Date: Tue, 23 Oct 2018 16:42:38 +0800 Subject: [PATCH 04/18] apic: test modification Signed-off-by: Jason Chen CJ --- x86/apic.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x86/apic.c b/x86/apic.c index c976e8d..ac93f2c 100644 --- a/x86/apic.c +++ b/x86/apic.c @@ -15,7 +15,7 @@ static void test_lapic_existence(void) lvr = apic_read(APIC_LVR); printf("apic version: %x\n", lvr); - report("apic existence", (u16)lvr == 0x14); + report("apic existence", (u16)lvr == 16); } #define TSC_DEADLINE_TIMER_VECTOR 0xef @@ -109,8 +109,12 @@ static void verify_disabled_apic_mmio(void) volatile u32 *lvr = (volatile u32 *)(APIC_DEFAULT_PHYS_BASE + APIC_LVR); volatile u32 *tpr = (volatile u32 *)(APIC_DEFAULT_PHYS_BASE + APIC_TASKPRI); u32 cr8 = read_cr8(); + void *apic_base = (void *)APIC_DEFAULT_PHYS_BASE; + u32 offset; + + for (offset = 0; offset < PAGE_SIZE; offset+=16) + *(volatile u64 *)(apic_base + offset) = 0xffffffffffffffff; - memset((void *)APIC_DEFAULT_PHYS_BASE, 0xff, PAGE_SIZE); report("*0xfee00030: %x", *lvr == ~0, *lvr); report("CR8: %lx", read_cr8() == cr8, read_cr8()); write_cr8(cr8 ^ MAX_TPR); From 5de5a9740af442d5d27c2e19ba86442a7d339854 Mon Sep 17 00:00:00 2001 From: Yin Fengwei Date: Tue, 30 Oct 2018 09:49:09 +0800 Subject: [PATCH 05/18] acrn-unit-test: move the test to guest directory. Current unit-test cases are guest based. Move them to guest directory. --- COPYRIGHT => guest/COPYRIGHT | 0 MAINTAINERS => guest/MAINTAINERS | 0 Makefile => guest/Makefile | 0 README => guest/README | 0 README.md => guest/README.md | 0 {api => guest/api}/api-sample.cc | 0 {api => guest/api}/dirty-log-perf.cc | 0 {api => guest/api}/dirty-log.cc | 0 {api => guest/api}/exception.cc | 0 {api => guest/api}/exception.hh | 0 {api => guest/api}/identity.cc | 0 {api => guest/api}/identity.hh | 0 {api => guest/api}/kvmxx.cc | 0 {api => guest/api}/kvmxx.hh | 0 {api => guest/api}/memmap.cc | 0 {api => guest/api}/memmap.hh | 0 {arm => guest/arm}/Makefile | 0 {arm => guest/arm}/Makefile.arm | 0 {arm => guest/arm}/Makefile.arm64 | 0 {arm => guest/arm}/Makefile.common | 0 {arm => guest/arm}/cstart.S | 0 {arm => guest/arm}/cstart64.S | 0 {arm => guest/arm}/flat.lds | 0 {arm => guest/arm}/gic.c | 0 {arm => guest/arm}/pci-test.c | 0 {arm => guest/arm}/pmu.c | 0 {arm => guest/arm}/psci.c | 0 {arm => guest/arm}/run | 0 {arm => guest/arm}/selftest.c | 0 {arm => guest/arm}/sieve.c | 0 {arm => guest/arm}/spinlock-test.c | 0 {arm => guest/arm}/timer.c | 0 {arm => guest/arm}/unittests.cfg | 0 config.mak => guest/config.mak | 0 configure => guest/configure | 0 errata.txt => guest/errata.txt | 0 {lib => guest/lib}/abort.c | 0 {lib => guest/lib}/alloc.c | 0 {lib => guest/lib}/alloc.h | 0 {lib => guest/lib}/alloc_page.c | 0 {lib => guest/lib}/alloc_page.h | 0 {lib => guest/lib}/alloc_phys.c | 0 {lib => guest/lib}/alloc_phys.h | 0 {lib => guest/lib}/argv.c | 0 {lib => guest/lib}/argv.h | 0 {lib => guest/lib}/arm/.gitignore | 0 {lib => guest/lib}/arm/asm-offsets.c | 0 {lib => guest/lib}/arm/asm/arch_gicv3.h | 0 {lib => guest/lib}/arm/asm/barrier.h | 0 {lib => guest/lib}/arm/asm/bitops.h | 0 {lib => guest/lib}/arm/asm/cpumask.h | 0 {lib => guest/lib}/arm/asm/delay.h | 0 {lib => guest/lib}/arm/asm/gic-v2.h | 0 {lib => guest/lib}/arm/asm/gic-v3.h | 0 {lib => guest/lib}/arm/asm/gic.h | 0 {lib => guest/lib}/arm/asm/io.h | 0 {lib => guest/lib}/arm/asm/mmu-api.h | 0 {lib => guest/lib}/arm/asm/mmu.h | 0 {lib => guest/lib}/arm/asm/page.h | 0 {lib => guest/lib}/arm/asm/pci.h | 0 {lib => guest/lib}/arm/asm/pgtable-hwdef.h | 0 {lib => guest/lib}/arm/asm/pgtable.h | 0 {lib => guest/lib}/arm/asm/processor.h | 0 {lib => guest/lib}/arm/asm/psci.h | 0 {lib => guest/lib}/arm/asm/ptrace.h | 0 {lib => guest/lib}/arm/asm/setup.h | 0 {lib => guest/lib}/arm/asm/smp.h | 0 {lib => guest/lib}/arm/asm/spinlock.h | 0 {lib => guest/lib}/arm/asm/stack.h | 0 {lib => guest/lib}/arm/asm/sysreg.h | 0 {lib => guest/lib}/arm/asm/thread_info.h | 0 {lib => guest/lib}/arm/bitops.c | 0 {lib => guest/lib}/arm/delay.c | 0 {lib => guest/lib}/arm/eabi_compat.c | 0 {lib => guest/lib}/arm/gic-v2.c | 0 {lib => guest/lib}/arm/gic-v3.c | 0 {lib => guest/lib}/arm/gic.c | 0 {lib => guest/lib}/arm/io.c | 0 {lib => guest/lib}/arm/io.h | 0 {lib => guest/lib}/arm/mmu.c | 0 {lib => guest/lib}/arm/processor.c | 0 {lib => guest/lib}/arm/psci.c | 0 {lib => guest/lib}/arm/setup.c | 0 {lib => guest/lib}/arm/smp.c | 0 {lib => guest/lib}/arm/spinlock.c | 0 {lib => guest/lib}/arm/stack.c | 0 {lib => guest/lib}/arm64/.gitignore | 0 {lib => guest/lib}/arm64/asm-offsets.c | 0 {lib => guest/lib}/arm64/asm/arch_gicv3.h | 0 {lib => guest/lib}/arm64/asm/barrier.h | 0 {lib => guest/lib}/arm64/asm/bitops.h | 0 {lib => guest/lib}/arm64/asm/cpumask.h | 0 {lib => guest/lib}/arm64/asm/delay.h | 0 {lib => guest/lib}/arm64/asm/esr.h | 0 {lib => guest/lib}/arm64/asm/gic-v2.h | 0 {lib => guest/lib}/arm64/asm/gic-v3.h | 0 {lib => guest/lib}/arm64/asm/gic.h | 0 {lib => guest/lib}/arm64/asm/io.h | 0 {lib => guest/lib}/arm64/asm/mmu-api.h | 0 {lib => guest/lib}/arm64/asm/mmu.h | 0 {lib => guest/lib}/arm64/asm/page.h | 0 {lib => guest/lib}/arm64/asm/pci.h | 0 {lib => guest/lib}/arm64/asm/pgtable-hwdef.h | 0 {lib => guest/lib}/arm64/asm/pgtable.h | 0 {lib => guest/lib}/arm64/asm/processor.h | 0 {lib => guest/lib}/arm64/asm/psci.h | 0 {lib => guest/lib}/arm64/asm/ptrace.h | 0 {lib => guest/lib}/arm64/asm/setup.h | 0 {lib => guest/lib}/arm64/asm/smp.h | 0 {lib => guest/lib}/arm64/asm/spinlock.h | 0 {lib => guest/lib}/arm64/asm/stack.h | 0 {lib => guest/lib}/arm64/asm/sysreg.h | 0 {lib => guest/lib}/arm64/asm/thread_info.h | 0 {lib => guest/lib}/arm64/processor.c | 0 {lib => guest/lib}/arm64/spinlock.c | 0 {lib => guest/lib}/asm | 0 {lib => guest/lib}/asm-generic/atomic.h | 0 {lib => guest/lib}/asm-generic/barrier.h | 0 {lib => guest/lib}/asm-generic/io.h | 0 {lib => guest/lib}/asm-generic/page.h | 0 {lib => guest/lib}/asm-generic/pci-host-bridge.h | 0 {lib => guest/lib}/asm-generic/pci.h | 0 {lib => guest/lib}/asm-generic/spinlock.h | 0 {lib => guest/lib}/auxinfo.c | 0 {lib => guest/lib}/auxinfo.h | 0 {lib => guest/lib}/bitops.h | 0 {lib => guest/lib}/chr-testdev.c | 0 {lib => guest/lib}/chr-testdev.h | 0 {lib => guest/lib}/devicetree.c | 0 {lib => guest/lib}/devicetree.h | 0 {lib => guest/lib}/errata.h | 0 {lib => guest/lib}/getchar.c | 0 {lib => guest/lib}/kbuild.h | 0 {lib => guest/lib}/libcflat.h | 0 {lib => guest/lib}/libfdt/Makefile.libfdt | 0 {lib => guest/lib}/libfdt/README | 0 {lib => guest/lib}/libfdt/fdt.c | 0 {lib => guest/lib}/libfdt/fdt.h | 0 {lib => guest/lib}/libfdt/fdt_empty_tree.c | 0 {lib => guest/lib}/libfdt/fdt_ro.c | 0 {lib => guest/lib}/libfdt/fdt_rw.c | 0 {lib => guest/lib}/libfdt/fdt_strerror.c | 0 {lib => guest/lib}/libfdt/fdt_sw.c | 0 {lib => guest/lib}/libfdt/fdt_wip.c | 0 {lib => guest/lib}/libfdt/libfdt.h | 0 {lib => guest/lib}/libfdt/libfdt_env.h | 0 {lib => guest/lib}/libfdt/libfdt_internal.h | 0 {lib => guest/lib}/libfdt/version.lds | 0 {lib => guest/lib}/linux/const.h | 0 {lib => guest/lib}/linux/pci_regs.h | 0 {lib => guest/lib}/linux/psci.h | 0 {lib => guest/lib}/pci-edu.c | 0 {lib => guest/lib}/pci-edu.h | 0 {lib => guest/lib}/pci-host-generic.c | 0 {lib => guest/lib}/pci-host-generic.h | 0 {lib => guest/lib}/pci-testdev.c | 0 {lib => guest/lib}/pci.c | 0 {lib => guest/lib}/pci.h | 0 {lib => guest/lib}/powerpc/.gitignore | 0 {lib => guest/lib}/powerpc/asm/handlers.h | 0 {lib => guest/lib}/powerpc/asm/hcall.h | 0 {lib => guest/lib}/powerpc/asm/ppc_asm.h | 0 {lib => guest/lib}/powerpc/asm/processor.h | 0 {lib => guest/lib}/powerpc/asm/rtas.h | 0 {lib => guest/lib}/powerpc/asm/setup.h | 0 {lib => guest/lib}/powerpc/asm/smp.h | 0 {lib => guest/lib}/powerpc/asm/stack.h | 0 {lib => guest/lib}/powerpc/handlers.c | 0 {lib => guest/lib}/powerpc/hcall.c | 0 {lib => guest/lib}/powerpc/io.c | 0 {lib => guest/lib}/powerpc/io.h | 0 {lib => guest/lib}/powerpc/processor.c | 0 {lib => guest/lib}/powerpc/rtas.c | 0 {lib => guest/lib}/powerpc/setup.c | 0 {lib => guest/lib}/powerpc/smp.c | 0 {lib => guest/lib}/ppc64/.gitignore | 0 {lib => guest/lib}/ppc64/asm-offsets.c | 0 {lib => guest/lib}/ppc64/asm/barrier.h | 0 {lib => guest/lib}/ppc64/asm/bitops.h | 0 {lib => guest/lib}/ppc64/asm/handlers.h | 0 {lib => guest/lib}/ppc64/asm/hcall.h | 0 {lib => guest/lib}/ppc64/asm/io.h | 0 {lib => guest/lib}/ppc64/asm/page.h | 0 {lib => guest/lib}/ppc64/asm/ppc_asm.h | 0 {lib => guest/lib}/ppc64/asm/processor.h | 0 {lib => guest/lib}/ppc64/asm/ptrace.h | 0 {lib => guest/lib}/ppc64/asm/rtas.h | 0 {lib => guest/lib}/ppc64/asm/setup.h | 0 {lib => guest/lib}/ppc64/asm/smp.h | 0 {lib => guest/lib}/ppc64/asm/spinlock.h | 0 {lib => guest/lib}/ppc64/asm/stack.h | 0 {lib => guest/lib}/printf.c | 0 {lib => guest/lib}/report.c | 0 {lib => guest/lib}/s390x/.gitignore | 0 {lib => guest/lib}/s390x/asm-offsets.c | 0 {lib => guest/lib}/s390x/asm/arch_def.h | 0 {lib => guest/lib}/s390x/asm/barrier.h | 0 {lib => guest/lib}/s390x/asm/bitops.h | 0 {lib => guest/lib}/s390x/asm/cpacf.h | 0 {lib => guest/lib}/s390x/asm/facility.h | 0 {lib => guest/lib}/s390x/asm/float.h | 0 {lib => guest/lib}/s390x/asm/interrupt.h | 0 {lib => guest/lib}/s390x/asm/io.h | 0 {lib => guest/lib}/s390x/asm/mem.h | 0 {lib => guest/lib}/s390x/asm/page.h | 0 {lib => guest/lib}/s390x/asm/pgtable.h | 0 {lib => guest/lib}/s390x/asm/spinlock.h | 0 {lib => guest/lib}/s390x/asm/stack.h | 0 {lib => guest/lib}/s390x/interrupt.c | 0 {lib => guest/lib}/s390x/io.c | 0 {lib => guest/lib}/s390x/mmu.c | 0 {lib => guest/lib}/s390x/mmu.h | 0 {lib => guest/lib}/s390x/sclp-ascii.c | 0 {lib => guest/lib}/s390x/sclp.c | 0 {lib => guest/lib}/s390x/sclp.h | 0 {lib => guest/lib}/s390x/stack.c | 0 {lib => guest/lib}/setjmp.h | 0 {lib => guest/lib}/stack.c | 0 {lib => guest/lib}/stack.h | 0 {lib => guest/lib}/string.c | 0 {lib => guest/lib}/string.h | 0 {lib => guest/lib}/util.c | 0 {lib => guest/lib}/util.h | 0 {lib => guest/lib}/virtio-mmio.c | 0 {lib => guest/lib}/virtio-mmio.h | 0 {lib => guest/lib}/virtio.c | 0 {lib => guest/lib}/virtio.h | 0 {lib => guest/lib}/vmalloc.c | 0 {lib => guest/lib}/vmalloc.h | 0 {lib => guest/lib}/x86/acpi.c | 0 {lib => guest/lib}/x86/acpi.h | 0 {lib => guest/lib}/x86/apic-defs.h | 0 {lib => guest/lib}/x86/apic.c | 0 {lib => guest/lib}/x86/apic.h | 0 {lib => guest/lib}/x86/asm/barrier.h | 0 {lib => guest/lib}/x86/asm/bitops.h | 0 {lib => guest/lib}/x86/asm/io.h | 0 {lib => guest/lib}/x86/asm/page.h | 0 {lib => guest/lib}/x86/asm/pci.h | 0 {lib => guest/lib}/x86/asm/spinlock.h | 0 {lib => guest/lib}/x86/asm/stack.h | 0 {lib => guest/lib}/x86/atomic.c | 0 {lib => guest/lib}/x86/atomic.h | 0 {lib => guest/lib}/x86/delay.c | 0 {lib => guest/lib}/x86/delay.h | 0 {lib => guest/lib}/x86/desc.c | 0 {lib => guest/lib}/x86/desc.h | 0 {lib => guest/lib}/x86/fake-apic.h | 0 {lib => guest/lib}/x86/fault_test.c | 0 {lib => guest/lib}/x86/fault_test.h | 0 {lib => guest/lib}/x86/fwcfg.c | 0 {lib => guest/lib}/x86/fwcfg.h | 0 {lib => guest/lib}/x86/intel-iommu.c | 0 {lib => guest/lib}/x86/intel-iommu.h | 0 {lib => guest/lib}/x86/io.c | 0 {lib => guest/lib}/x86/isr.c | 0 {lib => guest/lib}/x86/isr.h | 0 {lib => guest/lib}/x86/msr.h | 0 {lib => guest/lib}/x86/processor.h | 0 {lib => guest/lib}/x86/setjmp32.S | 0 {lib => guest/lib}/x86/setjmp64.S | 0 {lib => guest/lib}/x86/setup.c | 0 {lib => guest/lib}/x86/smp.c | 0 {lib => guest/lib}/x86/smp.h | 0 {lib => guest/lib}/x86/stack.c | 0 {lib => guest/lib}/x86/usermode.c | 0 {lib => guest/lib}/x86/usermode.h | 0 {lib => guest/lib}/x86/vm.c | 0 {lib => guest/lib}/x86/vm.h | 0 {powerpc => guest/powerpc}/.gitignore | 0 {powerpc => guest/powerpc}/Makefile | 0 {powerpc => guest/powerpc}/Makefile.common | 0 {powerpc => guest/powerpc}/Makefile.ppc64 | 0 {powerpc => guest/powerpc}/boot_rom.S | 0 {powerpc => guest/powerpc}/cstart64.S | 0 {powerpc => guest/powerpc}/emulator.c | 0 {powerpc => guest/powerpc}/flat.lds | 0 {powerpc => guest/powerpc}/reloc64.c | 0 {powerpc => guest/powerpc}/rtas.c | 0 {powerpc => guest/powerpc}/run | 0 {powerpc => guest/powerpc}/selftest.c | 0 {powerpc => guest/powerpc}/spapr.h | 0 {powerpc => guest/powerpc}/spapr_hcall.c | 0 {powerpc => guest/powerpc}/sprs.c | 0 {powerpc => guest/powerpc}/tm.c | 0 {powerpc => guest/powerpc}/unittests.cfg | 0 run_tests.sh => guest/run_tests.sh | 0 {s390x => guest/s390x}/Makefile | 0 {s390x => guest/s390x}/cmm.c | 0 {s390x => guest/s390x}/cstart64.S | 0 {s390x => guest/s390x}/diag10.c | 0 {s390x => guest/s390x}/emulator.c | 0 {s390x => guest/s390x}/flat.lds | 0 {s390x => guest/s390x}/gs.c | 0 {s390x => guest/s390x}/iep.c | 0 {s390x => guest/s390x}/intercept.c | 0 {s390x => guest/s390x}/pfmf.c | 0 {s390x => guest/s390x}/run | 0 {s390x => guest/s390x}/selftest.c | 0 {s390x => guest/s390x}/sieve.c | 0 {s390x => guest/s390x}/skey.c | 0 {s390x => guest/s390x}/sthyi.c | 0 {s390x => guest/s390x}/sthyi.h | 0 {s390x => guest/s390x}/unittests.cfg | 0 {s390x => guest/s390x}/vector.c | 0 {scripts => guest/scripts}/arch-run.bash | 0 {scripts => guest/scripts}/asm-offsets.mak | 0 {scripts => guest/scripts}/common.bash | 0 {scripts => guest/scripts}/git.difforder | 0 {scripts => guest/scripts}/mkstandalone.sh | 0 {scripts => guest/scripts}/pretty_print_stacks.py | 0 {scripts => guest/scripts}/runtime.bash | 0 {x86 => guest/x86}/Makefile | 0 {x86 => guest/x86}/Makefile.common | 0 {x86 => guest/x86}/Makefile.i386 | 0 {x86 => guest/x86}/Makefile.x86_64 | 0 {x86 => guest/x86}/README | 0 {x86 => guest/x86}/access.c | 0 {x86 => guest/x86}/apic.c | 0 {x86 => guest/x86}/asyncpf.c | 0 {x86 => guest/x86}/cmpxchg8b.c | 0 {x86 => guest/x86}/cstart.S | 0 {x86 => guest/x86}/cstart64.S | 0 {x86 => guest/x86}/debug.c | 0 {x86 => guest/x86}/emulator.c | 0 {x86 => guest/x86}/eventinj.c | 0 {x86 => guest/x86}/flat.lds | 0 {x86 => guest/x86}/hypercall.c | 0 {x86 => guest/x86}/hyperv.c | 0 {x86 => guest/x86}/hyperv.h | 0 {x86 => guest/x86}/hyperv_clock.c | 0 {x86 => guest/x86}/hyperv_connections.c | 0 {x86 => guest/x86}/hyperv_stimer.c | 0 {x86 => guest/x86}/hyperv_synic.c | 0 {x86 => guest/x86}/idt_test.c | 0 {x86 => guest/x86}/init.c | 0 {x86 => guest/x86}/intel-iommu.c | 0 {x86 => guest/x86}/ioapic.c | 0 {x86 => guest/x86}/ioram.h | 0 {x86 => guest/x86}/kvmclock.c | 0 {x86 => guest/x86}/kvmclock.h | 0 {x86 => guest/x86}/kvmclock_test.c | 0 {x86 => guest/x86}/memory.c | 0 {x86 => guest/x86}/msr.c | 0 {x86 => guest/x86}/pcid.c | 0 {x86 => guest/x86}/pku.c | 0 {x86 => guest/x86}/pmu.c | 0 {x86 => guest/x86}/port80.c | 0 {x86 => guest/x86}/realmode.c | 0 {x86 => guest/x86}/realmode.lds | 0 {x86 => guest/x86}/rmap_chain.c | 0 {x86 => guest/x86}/run | 0 {x86 => guest/x86}/s3.c | 0 {x86 => guest/x86}/setjmp.c | 0 {x86 => guest/x86}/sieve.c | 0 {x86 => guest/x86}/smap.c | 0 {x86 => guest/x86}/smptest.c | 0 {x86 => guest/x86}/svm.c | 0 {x86 => guest/x86}/svm.h | 0 {x86 => guest/x86}/syscall.c | 0 {x86 => guest/x86}/taskswitch.c | 0 {x86 => guest/x86}/taskswitch2.c | 0 {x86 => guest/x86}/tsc.c | 0 {x86 => guest/x86}/tsc_adjust.c | 0 {x86 => guest/x86}/tscdeadline_latency.c | 0 {x86 => guest/x86}/types.h | 0 {x86 => guest/x86}/umip.c | 0 {x86 => guest/x86}/unittests.cfg | 0 {x86 => guest/x86}/vmexit.c | 0 {x86 => guest/x86}/vmware_backdoors.c | 0 {x86 => guest/x86}/vmx.c | 0 {x86 => guest/x86}/vmx.h | 0 {x86 => guest/x86}/vmx_tests.c | 0 {x86 => guest/x86}/xsave.c | 0 lib/arm/asm/asm-offsets.h | 1 - lib/arm64/asm/asm-offsets.h | 1 - lib/generated/.gitignore | 1 - lib/ppc64/asm/asm-offsets.h | 1 - lib/s390x/asm/asm-offsets.h | 10 ---------- 379 files changed, 14 deletions(-) rename COPYRIGHT => guest/COPYRIGHT (100%) rename MAINTAINERS => guest/MAINTAINERS (100%) rename Makefile => guest/Makefile (100%) rename README => guest/README (100%) rename README.md => guest/README.md (100%) rename {api => guest/api}/api-sample.cc (100%) rename {api => guest/api}/dirty-log-perf.cc (100%) rename {api => guest/api}/dirty-log.cc (100%) rename {api => guest/api}/exception.cc (100%) rename {api => guest/api}/exception.hh (100%) rename {api => guest/api}/identity.cc (100%) rename {api => guest/api}/identity.hh (100%) rename {api => guest/api}/kvmxx.cc (100%) rename {api => guest/api}/kvmxx.hh (100%) rename {api => guest/api}/memmap.cc (100%) rename {api => guest/api}/memmap.hh (100%) rename {arm => guest/arm}/Makefile (100%) rename {arm => guest/arm}/Makefile.arm (100%) rename {arm => guest/arm}/Makefile.arm64 (100%) rename {arm => guest/arm}/Makefile.common (100%) rename {arm => guest/arm}/cstart.S (100%) rename {arm => guest/arm}/cstart64.S (100%) rename {arm => guest/arm}/flat.lds (100%) rename {arm => guest/arm}/gic.c (100%) rename {arm => guest/arm}/pci-test.c (100%) rename {arm => guest/arm}/pmu.c (100%) rename {arm => guest/arm}/psci.c (100%) rename {arm => guest/arm}/run (100%) rename {arm => guest/arm}/selftest.c (100%) rename {arm => guest/arm}/sieve.c (100%) rename {arm => guest/arm}/spinlock-test.c (100%) rename {arm => guest/arm}/timer.c (100%) rename {arm => guest/arm}/unittests.cfg (100%) rename config.mak => guest/config.mak (100%) rename configure => guest/configure (100%) rename errata.txt => guest/errata.txt (100%) rename {lib => guest/lib}/abort.c (100%) rename {lib => guest/lib}/alloc.c (100%) rename {lib => guest/lib}/alloc.h (100%) rename {lib => guest/lib}/alloc_page.c (100%) rename {lib => guest/lib}/alloc_page.h (100%) rename {lib => guest/lib}/alloc_phys.c (100%) rename {lib => guest/lib}/alloc_phys.h (100%) rename {lib => guest/lib}/argv.c (100%) rename {lib => guest/lib}/argv.h (100%) rename {lib => guest/lib}/arm/.gitignore (100%) rename {lib => guest/lib}/arm/asm-offsets.c (100%) rename {lib => guest/lib}/arm/asm/arch_gicv3.h (100%) rename {lib => guest/lib}/arm/asm/barrier.h (100%) rename {lib => guest/lib}/arm/asm/bitops.h (100%) rename {lib => guest/lib}/arm/asm/cpumask.h (100%) rename {lib => guest/lib}/arm/asm/delay.h (100%) rename {lib => guest/lib}/arm/asm/gic-v2.h (100%) rename {lib => guest/lib}/arm/asm/gic-v3.h (100%) rename {lib => guest/lib}/arm/asm/gic.h (100%) rename {lib => guest/lib}/arm/asm/io.h (100%) rename {lib => guest/lib}/arm/asm/mmu-api.h (100%) rename {lib => guest/lib}/arm/asm/mmu.h (100%) rename {lib => guest/lib}/arm/asm/page.h (100%) rename {lib => guest/lib}/arm/asm/pci.h (100%) rename {lib => guest/lib}/arm/asm/pgtable-hwdef.h (100%) rename {lib => guest/lib}/arm/asm/pgtable.h (100%) rename {lib => guest/lib}/arm/asm/processor.h (100%) rename {lib => guest/lib}/arm/asm/psci.h (100%) rename {lib => guest/lib}/arm/asm/ptrace.h (100%) rename {lib => guest/lib}/arm/asm/setup.h (100%) rename {lib => guest/lib}/arm/asm/smp.h (100%) rename {lib => guest/lib}/arm/asm/spinlock.h (100%) rename {lib => guest/lib}/arm/asm/stack.h (100%) rename {lib => guest/lib}/arm/asm/sysreg.h (100%) rename {lib => guest/lib}/arm/asm/thread_info.h (100%) rename {lib => guest/lib}/arm/bitops.c (100%) rename {lib => guest/lib}/arm/delay.c (100%) rename {lib => guest/lib}/arm/eabi_compat.c (100%) rename {lib => guest/lib}/arm/gic-v2.c (100%) rename {lib => guest/lib}/arm/gic-v3.c (100%) rename {lib => guest/lib}/arm/gic.c (100%) rename {lib => guest/lib}/arm/io.c (100%) rename {lib => guest/lib}/arm/io.h (100%) rename {lib => guest/lib}/arm/mmu.c (100%) rename {lib => guest/lib}/arm/processor.c (100%) rename {lib => guest/lib}/arm/psci.c (100%) rename {lib => guest/lib}/arm/setup.c (100%) rename {lib => guest/lib}/arm/smp.c (100%) rename {lib => guest/lib}/arm/spinlock.c (100%) rename {lib => guest/lib}/arm/stack.c (100%) rename {lib => guest/lib}/arm64/.gitignore (100%) rename {lib => guest/lib}/arm64/asm-offsets.c (100%) rename {lib => guest/lib}/arm64/asm/arch_gicv3.h (100%) rename {lib => guest/lib}/arm64/asm/barrier.h (100%) rename {lib => guest/lib}/arm64/asm/bitops.h (100%) rename {lib => guest/lib}/arm64/asm/cpumask.h (100%) rename {lib => guest/lib}/arm64/asm/delay.h (100%) rename {lib => guest/lib}/arm64/asm/esr.h (100%) rename {lib => guest/lib}/arm64/asm/gic-v2.h (100%) rename {lib => guest/lib}/arm64/asm/gic-v3.h (100%) rename {lib => guest/lib}/arm64/asm/gic.h (100%) rename {lib => guest/lib}/arm64/asm/io.h (100%) rename {lib => guest/lib}/arm64/asm/mmu-api.h (100%) rename {lib => guest/lib}/arm64/asm/mmu.h (100%) rename {lib => guest/lib}/arm64/asm/page.h (100%) rename {lib => guest/lib}/arm64/asm/pci.h (100%) rename {lib => guest/lib}/arm64/asm/pgtable-hwdef.h (100%) rename {lib => guest/lib}/arm64/asm/pgtable.h (100%) rename {lib => guest/lib}/arm64/asm/processor.h (100%) rename {lib => guest/lib}/arm64/asm/psci.h (100%) rename {lib => guest/lib}/arm64/asm/ptrace.h (100%) rename {lib => guest/lib}/arm64/asm/setup.h (100%) rename {lib => guest/lib}/arm64/asm/smp.h (100%) rename {lib => guest/lib}/arm64/asm/spinlock.h (100%) rename {lib => guest/lib}/arm64/asm/stack.h (100%) rename {lib => guest/lib}/arm64/asm/sysreg.h (100%) rename {lib => guest/lib}/arm64/asm/thread_info.h (100%) rename {lib => guest/lib}/arm64/processor.c (100%) rename {lib => guest/lib}/arm64/spinlock.c (100%) rename {lib => guest/lib}/asm (100%) rename {lib => guest/lib}/asm-generic/atomic.h (100%) rename {lib => guest/lib}/asm-generic/barrier.h (100%) rename {lib => guest/lib}/asm-generic/io.h (100%) rename {lib => guest/lib}/asm-generic/page.h (100%) rename {lib => guest/lib}/asm-generic/pci-host-bridge.h (100%) rename {lib => guest/lib}/asm-generic/pci.h (100%) rename {lib => guest/lib}/asm-generic/spinlock.h (100%) rename {lib => guest/lib}/auxinfo.c (100%) rename {lib => guest/lib}/auxinfo.h (100%) rename {lib => guest/lib}/bitops.h (100%) rename {lib => guest/lib}/chr-testdev.c (100%) rename {lib => guest/lib}/chr-testdev.h (100%) rename {lib => guest/lib}/devicetree.c (100%) rename {lib => guest/lib}/devicetree.h (100%) rename {lib => guest/lib}/errata.h (100%) rename {lib => guest/lib}/getchar.c (100%) rename {lib => guest/lib}/kbuild.h (100%) rename {lib => guest/lib}/libcflat.h (100%) rename {lib => guest/lib}/libfdt/Makefile.libfdt (100%) rename {lib => guest/lib}/libfdt/README (100%) rename {lib => guest/lib}/libfdt/fdt.c (100%) rename {lib => guest/lib}/libfdt/fdt.h (100%) rename {lib => guest/lib}/libfdt/fdt_empty_tree.c (100%) rename {lib => guest/lib}/libfdt/fdt_ro.c (100%) rename {lib => guest/lib}/libfdt/fdt_rw.c (100%) rename {lib => guest/lib}/libfdt/fdt_strerror.c (100%) rename {lib => guest/lib}/libfdt/fdt_sw.c (100%) rename {lib => guest/lib}/libfdt/fdt_wip.c (100%) rename {lib => guest/lib}/libfdt/libfdt.h (100%) rename {lib => guest/lib}/libfdt/libfdt_env.h (100%) rename {lib => guest/lib}/libfdt/libfdt_internal.h (100%) rename {lib => guest/lib}/libfdt/version.lds (100%) rename {lib => guest/lib}/linux/const.h (100%) rename {lib => guest/lib}/linux/pci_regs.h (100%) rename {lib => guest/lib}/linux/psci.h (100%) rename {lib => guest/lib}/pci-edu.c (100%) rename {lib => guest/lib}/pci-edu.h (100%) rename {lib => guest/lib}/pci-host-generic.c (100%) rename {lib => guest/lib}/pci-host-generic.h (100%) rename {lib => guest/lib}/pci-testdev.c (100%) rename {lib => guest/lib}/pci.c (100%) rename {lib => guest/lib}/pci.h (100%) rename {lib => guest/lib}/powerpc/.gitignore (100%) rename {lib => guest/lib}/powerpc/asm/handlers.h (100%) rename {lib => guest/lib}/powerpc/asm/hcall.h (100%) rename {lib => guest/lib}/powerpc/asm/ppc_asm.h (100%) rename {lib => guest/lib}/powerpc/asm/processor.h (100%) rename {lib => guest/lib}/powerpc/asm/rtas.h (100%) rename {lib => guest/lib}/powerpc/asm/setup.h (100%) rename {lib => guest/lib}/powerpc/asm/smp.h (100%) rename {lib => guest/lib}/powerpc/asm/stack.h (100%) rename {lib => guest/lib}/powerpc/handlers.c (100%) rename {lib => guest/lib}/powerpc/hcall.c (100%) rename {lib => guest/lib}/powerpc/io.c (100%) rename {lib => guest/lib}/powerpc/io.h (100%) rename {lib => guest/lib}/powerpc/processor.c (100%) rename {lib => guest/lib}/powerpc/rtas.c (100%) rename {lib => guest/lib}/powerpc/setup.c (100%) rename {lib => guest/lib}/powerpc/smp.c (100%) rename {lib => guest/lib}/ppc64/.gitignore (100%) rename {lib => guest/lib}/ppc64/asm-offsets.c (100%) rename {lib => guest/lib}/ppc64/asm/barrier.h (100%) rename {lib => guest/lib}/ppc64/asm/bitops.h (100%) rename {lib => guest/lib}/ppc64/asm/handlers.h (100%) rename {lib => guest/lib}/ppc64/asm/hcall.h (100%) rename {lib => guest/lib}/ppc64/asm/io.h (100%) rename {lib => guest/lib}/ppc64/asm/page.h (100%) rename {lib => guest/lib}/ppc64/asm/ppc_asm.h (100%) rename {lib => guest/lib}/ppc64/asm/processor.h (100%) rename {lib => guest/lib}/ppc64/asm/ptrace.h (100%) rename {lib => guest/lib}/ppc64/asm/rtas.h (100%) rename {lib => guest/lib}/ppc64/asm/setup.h (100%) rename {lib => guest/lib}/ppc64/asm/smp.h (100%) rename {lib => guest/lib}/ppc64/asm/spinlock.h (100%) rename {lib => guest/lib}/ppc64/asm/stack.h (100%) rename {lib => guest/lib}/printf.c (100%) rename {lib => guest/lib}/report.c (100%) rename {lib => guest/lib}/s390x/.gitignore (100%) rename {lib => guest/lib}/s390x/asm-offsets.c (100%) rename {lib => guest/lib}/s390x/asm/arch_def.h (100%) rename {lib => guest/lib}/s390x/asm/barrier.h (100%) rename {lib => guest/lib}/s390x/asm/bitops.h (100%) rename {lib => guest/lib}/s390x/asm/cpacf.h (100%) rename {lib => guest/lib}/s390x/asm/facility.h (100%) rename {lib => guest/lib}/s390x/asm/float.h (100%) rename {lib => guest/lib}/s390x/asm/interrupt.h (100%) rename {lib => guest/lib}/s390x/asm/io.h (100%) rename {lib => guest/lib}/s390x/asm/mem.h (100%) rename {lib => guest/lib}/s390x/asm/page.h (100%) rename {lib => guest/lib}/s390x/asm/pgtable.h (100%) rename {lib => guest/lib}/s390x/asm/spinlock.h (100%) rename {lib => guest/lib}/s390x/asm/stack.h (100%) rename {lib => guest/lib}/s390x/interrupt.c (100%) rename {lib => guest/lib}/s390x/io.c (100%) rename {lib => guest/lib}/s390x/mmu.c (100%) rename {lib => guest/lib}/s390x/mmu.h (100%) rename {lib => guest/lib}/s390x/sclp-ascii.c (100%) rename {lib => guest/lib}/s390x/sclp.c (100%) rename {lib => guest/lib}/s390x/sclp.h (100%) rename {lib => guest/lib}/s390x/stack.c (100%) rename {lib => guest/lib}/setjmp.h (100%) rename {lib => guest/lib}/stack.c (100%) rename {lib => guest/lib}/stack.h (100%) rename {lib => guest/lib}/string.c (100%) rename {lib => guest/lib}/string.h (100%) rename {lib => guest/lib}/util.c (100%) rename {lib => guest/lib}/util.h (100%) rename {lib => guest/lib}/virtio-mmio.c (100%) rename {lib => guest/lib}/virtio-mmio.h (100%) rename {lib => guest/lib}/virtio.c (100%) rename {lib => guest/lib}/virtio.h (100%) rename {lib => guest/lib}/vmalloc.c (100%) rename {lib => guest/lib}/vmalloc.h (100%) rename {lib => guest/lib}/x86/acpi.c (100%) rename {lib => guest/lib}/x86/acpi.h (100%) rename {lib => guest/lib}/x86/apic-defs.h (100%) rename {lib => guest/lib}/x86/apic.c (100%) rename {lib => guest/lib}/x86/apic.h (100%) rename {lib => guest/lib}/x86/asm/barrier.h (100%) rename {lib => guest/lib}/x86/asm/bitops.h (100%) rename {lib => guest/lib}/x86/asm/io.h (100%) rename {lib => guest/lib}/x86/asm/page.h (100%) rename {lib => guest/lib}/x86/asm/pci.h (100%) rename {lib => guest/lib}/x86/asm/spinlock.h (100%) rename {lib => guest/lib}/x86/asm/stack.h (100%) rename {lib => guest/lib}/x86/atomic.c (100%) rename {lib => guest/lib}/x86/atomic.h (100%) rename {lib => guest/lib}/x86/delay.c (100%) rename {lib => guest/lib}/x86/delay.h (100%) rename {lib => guest/lib}/x86/desc.c (100%) rename {lib => guest/lib}/x86/desc.h (100%) rename {lib => guest/lib}/x86/fake-apic.h (100%) rename {lib => guest/lib}/x86/fault_test.c (100%) rename {lib => guest/lib}/x86/fault_test.h (100%) rename {lib => guest/lib}/x86/fwcfg.c (100%) rename {lib => guest/lib}/x86/fwcfg.h (100%) rename {lib => guest/lib}/x86/intel-iommu.c (100%) rename {lib => guest/lib}/x86/intel-iommu.h (100%) rename {lib => guest/lib}/x86/io.c (100%) rename {lib => guest/lib}/x86/isr.c (100%) rename {lib => guest/lib}/x86/isr.h (100%) rename {lib => guest/lib}/x86/msr.h (100%) rename {lib => guest/lib}/x86/processor.h (100%) rename {lib => guest/lib}/x86/setjmp32.S (100%) rename {lib => guest/lib}/x86/setjmp64.S (100%) rename {lib => guest/lib}/x86/setup.c (100%) rename {lib => guest/lib}/x86/smp.c (100%) rename {lib => guest/lib}/x86/smp.h (100%) rename {lib => guest/lib}/x86/stack.c (100%) rename {lib => guest/lib}/x86/usermode.c (100%) rename {lib => guest/lib}/x86/usermode.h (100%) rename {lib => guest/lib}/x86/vm.c (100%) rename {lib => guest/lib}/x86/vm.h (100%) rename {powerpc => guest/powerpc}/.gitignore (100%) rename {powerpc => guest/powerpc}/Makefile (100%) rename {powerpc => guest/powerpc}/Makefile.common (100%) rename {powerpc => guest/powerpc}/Makefile.ppc64 (100%) rename {powerpc => guest/powerpc}/boot_rom.S (100%) rename {powerpc => guest/powerpc}/cstart64.S (100%) rename {powerpc => guest/powerpc}/emulator.c (100%) rename {powerpc => guest/powerpc}/flat.lds (100%) rename {powerpc => guest/powerpc}/reloc64.c (100%) rename {powerpc => guest/powerpc}/rtas.c (100%) rename {powerpc => guest/powerpc}/run (100%) rename {powerpc => guest/powerpc}/selftest.c (100%) rename {powerpc => guest/powerpc}/spapr.h (100%) rename {powerpc => guest/powerpc}/spapr_hcall.c (100%) rename {powerpc => guest/powerpc}/sprs.c (100%) rename {powerpc => guest/powerpc}/tm.c (100%) rename {powerpc => guest/powerpc}/unittests.cfg (100%) rename run_tests.sh => guest/run_tests.sh (100%) rename {s390x => guest/s390x}/Makefile (100%) rename {s390x => guest/s390x}/cmm.c (100%) rename {s390x => guest/s390x}/cstart64.S (100%) rename {s390x => guest/s390x}/diag10.c (100%) rename {s390x => guest/s390x}/emulator.c (100%) rename {s390x => guest/s390x}/flat.lds (100%) rename {s390x => guest/s390x}/gs.c (100%) rename {s390x => guest/s390x}/iep.c (100%) rename {s390x => guest/s390x}/intercept.c (100%) rename {s390x => guest/s390x}/pfmf.c (100%) rename {s390x => guest/s390x}/run (100%) rename {s390x => guest/s390x}/selftest.c (100%) rename {s390x => guest/s390x}/sieve.c (100%) rename {s390x => guest/s390x}/skey.c (100%) rename {s390x => guest/s390x}/sthyi.c (100%) rename {s390x => guest/s390x}/sthyi.h (100%) rename {s390x => guest/s390x}/unittests.cfg (100%) rename {s390x => guest/s390x}/vector.c (100%) rename {scripts => guest/scripts}/arch-run.bash (100%) rename {scripts => guest/scripts}/asm-offsets.mak (100%) rename {scripts => guest/scripts}/common.bash (100%) rename {scripts => guest/scripts}/git.difforder (100%) rename {scripts => guest/scripts}/mkstandalone.sh (100%) rename {scripts => guest/scripts}/pretty_print_stacks.py (100%) rename {scripts => guest/scripts}/runtime.bash (100%) rename {x86 => guest/x86}/Makefile (100%) rename {x86 => guest/x86}/Makefile.common (100%) rename {x86 => guest/x86}/Makefile.i386 (100%) rename {x86 => guest/x86}/Makefile.x86_64 (100%) rename {x86 => guest/x86}/README (100%) rename {x86 => guest/x86}/access.c (100%) rename {x86 => guest/x86}/apic.c (100%) rename {x86 => guest/x86}/asyncpf.c (100%) rename {x86 => guest/x86}/cmpxchg8b.c (100%) rename {x86 => guest/x86}/cstart.S (100%) rename {x86 => guest/x86}/cstart64.S (100%) rename {x86 => guest/x86}/debug.c (100%) rename {x86 => guest/x86}/emulator.c (100%) rename {x86 => guest/x86}/eventinj.c (100%) rename {x86 => guest/x86}/flat.lds (100%) rename {x86 => guest/x86}/hypercall.c (100%) rename {x86 => guest/x86}/hyperv.c (100%) rename {x86 => guest/x86}/hyperv.h (100%) rename {x86 => guest/x86}/hyperv_clock.c (100%) rename {x86 => guest/x86}/hyperv_connections.c (100%) rename {x86 => guest/x86}/hyperv_stimer.c (100%) rename {x86 => guest/x86}/hyperv_synic.c (100%) rename {x86 => guest/x86}/idt_test.c (100%) rename {x86 => guest/x86}/init.c (100%) rename {x86 => guest/x86}/intel-iommu.c (100%) rename {x86 => guest/x86}/ioapic.c (100%) rename {x86 => guest/x86}/ioram.h (100%) rename {x86 => guest/x86}/kvmclock.c (100%) rename {x86 => guest/x86}/kvmclock.h (100%) rename {x86 => guest/x86}/kvmclock_test.c (100%) rename {x86 => guest/x86}/memory.c (100%) rename {x86 => guest/x86}/msr.c (100%) rename {x86 => guest/x86}/pcid.c (100%) rename {x86 => guest/x86}/pku.c (100%) rename {x86 => guest/x86}/pmu.c (100%) rename {x86 => guest/x86}/port80.c (100%) rename {x86 => guest/x86}/realmode.c (100%) rename {x86 => guest/x86}/realmode.lds (100%) rename {x86 => guest/x86}/rmap_chain.c (100%) rename {x86 => guest/x86}/run (100%) rename {x86 => guest/x86}/s3.c (100%) rename {x86 => guest/x86}/setjmp.c (100%) rename {x86 => guest/x86}/sieve.c (100%) rename {x86 => guest/x86}/smap.c (100%) rename {x86 => guest/x86}/smptest.c (100%) rename {x86 => guest/x86}/svm.c (100%) rename {x86 => guest/x86}/svm.h (100%) rename {x86 => guest/x86}/syscall.c (100%) rename {x86 => guest/x86}/taskswitch.c (100%) rename {x86 => guest/x86}/taskswitch2.c (100%) rename {x86 => guest/x86}/tsc.c (100%) rename {x86 => guest/x86}/tsc_adjust.c (100%) rename {x86 => guest/x86}/tscdeadline_latency.c (100%) rename {x86 => guest/x86}/types.h (100%) rename {x86 => guest/x86}/umip.c (100%) rename {x86 => guest/x86}/unittests.cfg (100%) rename {x86 => guest/x86}/vmexit.c (100%) rename {x86 => guest/x86}/vmware_backdoors.c (100%) rename {x86 => guest/x86}/vmx.c (100%) rename {x86 => guest/x86}/vmx.h (100%) rename {x86 => guest/x86}/vmx_tests.c (100%) rename {x86 => guest/x86}/xsave.c (100%) delete mode 100644 lib/arm/asm/asm-offsets.h delete mode 100644 lib/arm64/asm/asm-offsets.h delete mode 100644 lib/generated/.gitignore delete mode 100644 lib/ppc64/asm/asm-offsets.h delete mode 100644 lib/s390x/asm/asm-offsets.h diff --git a/COPYRIGHT b/guest/COPYRIGHT similarity index 100% rename from COPYRIGHT rename to guest/COPYRIGHT diff --git a/MAINTAINERS b/guest/MAINTAINERS similarity index 100% rename from MAINTAINERS rename to guest/MAINTAINERS diff --git a/Makefile b/guest/Makefile similarity index 100% rename from Makefile rename to guest/Makefile diff --git a/README b/guest/README similarity index 100% rename from README rename to guest/README diff --git a/README.md b/guest/README.md similarity index 100% rename from README.md rename to guest/README.md diff --git a/api/api-sample.cc b/guest/api/api-sample.cc similarity index 100% rename from api/api-sample.cc rename to guest/api/api-sample.cc diff --git a/api/dirty-log-perf.cc b/guest/api/dirty-log-perf.cc similarity index 100% rename from api/dirty-log-perf.cc rename to guest/api/dirty-log-perf.cc diff --git a/api/dirty-log.cc b/guest/api/dirty-log.cc similarity index 100% rename from api/dirty-log.cc rename to guest/api/dirty-log.cc diff --git a/api/exception.cc b/guest/api/exception.cc similarity index 100% rename from api/exception.cc rename to guest/api/exception.cc diff --git a/api/exception.hh b/guest/api/exception.hh similarity index 100% rename from api/exception.hh rename to guest/api/exception.hh diff --git a/api/identity.cc b/guest/api/identity.cc similarity index 100% rename from api/identity.cc rename to guest/api/identity.cc diff --git a/api/identity.hh b/guest/api/identity.hh similarity index 100% rename from api/identity.hh rename to guest/api/identity.hh diff --git a/api/kvmxx.cc b/guest/api/kvmxx.cc similarity index 100% rename from api/kvmxx.cc rename to guest/api/kvmxx.cc diff --git a/api/kvmxx.hh b/guest/api/kvmxx.hh similarity index 100% rename from api/kvmxx.hh rename to guest/api/kvmxx.hh diff --git a/api/memmap.cc b/guest/api/memmap.cc similarity index 100% rename from api/memmap.cc rename to guest/api/memmap.cc diff --git a/api/memmap.hh b/guest/api/memmap.hh similarity index 100% rename from api/memmap.hh rename to guest/api/memmap.hh diff --git a/arm/Makefile b/guest/arm/Makefile similarity index 100% rename from arm/Makefile rename to guest/arm/Makefile diff --git a/arm/Makefile.arm b/guest/arm/Makefile.arm similarity index 100% rename from arm/Makefile.arm rename to guest/arm/Makefile.arm diff --git a/arm/Makefile.arm64 b/guest/arm/Makefile.arm64 similarity index 100% rename from arm/Makefile.arm64 rename to guest/arm/Makefile.arm64 diff --git a/arm/Makefile.common b/guest/arm/Makefile.common similarity index 100% rename from arm/Makefile.common rename to guest/arm/Makefile.common diff --git a/arm/cstart.S b/guest/arm/cstart.S similarity index 100% rename from arm/cstart.S rename to guest/arm/cstart.S diff --git a/arm/cstart64.S b/guest/arm/cstart64.S similarity index 100% rename from arm/cstart64.S rename to guest/arm/cstart64.S diff --git a/arm/flat.lds b/guest/arm/flat.lds similarity index 100% rename from arm/flat.lds rename to guest/arm/flat.lds diff --git a/arm/gic.c b/guest/arm/gic.c similarity index 100% rename from arm/gic.c rename to guest/arm/gic.c diff --git a/arm/pci-test.c b/guest/arm/pci-test.c similarity index 100% rename from arm/pci-test.c rename to guest/arm/pci-test.c diff --git a/arm/pmu.c b/guest/arm/pmu.c similarity index 100% rename from arm/pmu.c rename to guest/arm/pmu.c diff --git a/arm/psci.c b/guest/arm/psci.c similarity index 100% rename from arm/psci.c rename to guest/arm/psci.c diff --git a/arm/run b/guest/arm/run similarity index 100% rename from arm/run rename to guest/arm/run diff --git a/arm/selftest.c b/guest/arm/selftest.c similarity index 100% rename from arm/selftest.c rename to guest/arm/selftest.c diff --git a/arm/sieve.c b/guest/arm/sieve.c similarity index 100% rename from arm/sieve.c rename to guest/arm/sieve.c diff --git a/arm/spinlock-test.c b/guest/arm/spinlock-test.c similarity index 100% rename from arm/spinlock-test.c rename to guest/arm/spinlock-test.c diff --git a/arm/timer.c b/guest/arm/timer.c similarity index 100% rename from arm/timer.c rename to guest/arm/timer.c diff --git a/arm/unittests.cfg b/guest/arm/unittests.cfg similarity index 100% rename from arm/unittests.cfg rename to guest/arm/unittests.cfg diff --git a/config.mak b/guest/config.mak similarity index 100% rename from config.mak rename to guest/config.mak diff --git a/configure b/guest/configure similarity index 100% rename from configure rename to guest/configure diff --git a/errata.txt b/guest/errata.txt similarity index 100% rename from errata.txt rename to guest/errata.txt diff --git a/lib/abort.c b/guest/lib/abort.c similarity index 100% rename from lib/abort.c rename to guest/lib/abort.c diff --git a/lib/alloc.c b/guest/lib/alloc.c similarity index 100% rename from lib/alloc.c rename to guest/lib/alloc.c diff --git a/lib/alloc.h b/guest/lib/alloc.h similarity index 100% rename from lib/alloc.h rename to guest/lib/alloc.h diff --git a/lib/alloc_page.c b/guest/lib/alloc_page.c similarity index 100% rename from lib/alloc_page.c rename to guest/lib/alloc_page.c diff --git a/lib/alloc_page.h b/guest/lib/alloc_page.h similarity index 100% rename from lib/alloc_page.h rename to guest/lib/alloc_page.h diff --git a/lib/alloc_phys.c b/guest/lib/alloc_phys.c similarity index 100% rename from lib/alloc_phys.c rename to guest/lib/alloc_phys.c diff --git a/lib/alloc_phys.h b/guest/lib/alloc_phys.h similarity index 100% rename from lib/alloc_phys.h rename to guest/lib/alloc_phys.h diff --git a/lib/argv.c b/guest/lib/argv.c similarity index 100% rename from lib/argv.c rename to guest/lib/argv.c diff --git a/lib/argv.h b/guest/lib/argv.h similarity index 100% rename from lib/argv.h rename to guest/lib/argv.h diff --git a/lib/arm/.gitignore b/guest/lib/arm/.gitignore similarity index 100% rename from lib/arm/.gitignore rename to guest/lib/arm/.gitignore diff --git a/lib/arm/asm-offsets.c b/guest/lib/arm/asm-offsets.c similarity index 100% rename from lib/arm/asm-offsets.c rename to guest/lib/arm/asm-offsets.c diff --git a/lib/arm/asm/arch_gicv3.h b/guest/lib/arm/asm/arch_gicv3.h similarity index 100% rename from lib/arm/asm/arch_gicv3.h rename to guest/lib/arm/asm/arch_gicv3.h diff --git a/lib/arm/asm/barrier.h b/guest/lib/arm/asm/barrier.h similarity index 100% rename from lib/arm/asm/barrier.h rename to guest/lib/arm/asm/barrier.h diff --git a/lib/arm/asm/bitops.h b/guest/lib/arm/asm/bitops.h similarity index 100% rename from lib/arm/asm/bitops.h rename to guest/lib/arm/asm/bitops.h diff --git a/lib/arm/asm/cpumask.h b/guest/lib/arm/asm/cpumask.h similarity index 100% rename from lib/arm/asm/cpumask.h rename to guest/lib/arm/asm/cpumask.h diff --git a/lib/arm/asm/delay.h b/guest/lib/arm/asm/delay.h similarity index 100% rename from lib/arm/asm/delay.h rename to guest/lib/arm/asm/delay.h diff --git a/lib/arm/asm/gic-v2.h b/guest/lib/arm/asm/gic-v2.h similarity index 100% rename from lib/arm/asm/gic-v2.h rename to guest/lib/arm/asm/gic-v2.h diff --git a/lib/arm/asm/gic-v3.h b/guest/lib/arm/asm/gic-v3.h similarity index 100% rename from lib/arm/asm/gic-v3.h rename to guest/lib/arm/asm/gic-v3.h diff --git a/lib/arm/asm/gic.h b/guest/lib/arm/asm/gic.h similarity index 100% rename from lib/arm/asm/gic.h rename to guest/lib/arm/asm/gic.h diff --git a/lib/arm/asm/io.h b/guest/lib/arm/asm/io.h similarity index 100% rename from lib/arm/asm/io.h rename to guest/lib/arm/asm/io.h diff --git a/lib/arm/asm/mmu-api.h b/guest/lib/arm/asm/mmu-api.h similarity index 100% rename from lib/arm/asm/mmu-api.h rename to guest/lib/arm/asm/mmu-api.h diff --git a/lib/arm/asm/mmu.h b/guest/lib/arm/asm/mmu.h similarity index 100% rename from lib/arm/asm/mmu.h rename to guest/lib/arm/asm/mmu.h diff --git a/lib/arm/asm/page.h b/guest/lib/arm/asm/page.h similarity index 100% rename from lib/arm/asm/page.h rename to guest/lib/arm/asm/page.h diff --git a/lib/arm/asm/pci.h b/guest/lib/arm/asm/pci.h similarity index 100% rename from lib/arm/asm/pci.h rename to guest/lib/arm/asm/pci.h diff --git a/lib/arm/asm/pgtable-hwdef.h b/guest/lib/arm/asm/pgtable-hwdef.h similarity index 100% rename from lib/arm/asm/pgtable-hwdef.h rename to guest/lib/arm/asm/pgtable-hwdef.h diff --git a/lib/arm/asm/pgtable.h b/guest/lib/arm/asm/pgtable.h similarity index 100% rename from lib/arm/asm/pgtable.h rename to guest/lib/arm/asm/pgtable.h diff --git a/lib/arm/asm/processor.h b/guest/lib/arm/asm/processor.h similarity index 100% rename from lib/arm/asm/processor.h rename to guest/lib/arm/asm/processor.h diff --git a/lib/arm/asm/psci.h b/guest/lib/arm/asm/psci.h similarity index 100% rename from lib/arm/asm/psci.h rename to guest/lib/arm/asm/psci.h diff --git a/lib/arm/asm/ptrace.h b/guest/lib/arm/asm/ptrace.h similarity index 100% rename from lib/arm/asm/ptrace.h rename to guest/lib/arm/asm/ptrace.h diff --git a/lib/arm/asm/setup.h b/guest/lib/arm/asm/setup.h similarity index 100% rename from lib/arm/asm/setup.h rename to guest/lib/arm/asm/setup.h diff --git a/lib/arm/asm/smp.h b/guest/lib/arm/asm/smp.h similarity index 100% rename from lib/arm/asm/smp.h rename to guest/lib/arm/asm/smp.h diff --git a/lib/arm/asm/spinlock.h b/guest/lib/arm/asm/spinlock.h similarity index 100% rename from lib/arm/asm/spinlock.h rename to guest/lib/arm/asm/spinlock.h diff --git a/lib/arm/asm/stack.h b/guest/lib/arm/asm/stack.h similarity index 100% rename from lib/arm/asm/stack.h rename to guest/lib/arm/asm/stack.h diff --git a/lib/arm/asm/sysreg.h b/guest/lib/arm/asm/sysreg.h similarity index 100% rename from lib/arm/asm/sysreg.h rename to guest/lib/arm/asm/sysreg.h diff --git a/lib/arm/asm/thread_info.h b/guest/lib/arm/asm/thread_info.h similarity index 100% rename from lib/arm/asm/thread_info.h rename to guest/lib/arm/asm/thread_info.h diff --git a/lib/arm/bitops.c b/guest/lib/arm/bitops.c similarity index 100% rename from lib/arm/bitops.c rename to guest/lib/arm/bitops.c diff --git a/lib/arm/delay.c b/guest/lib/arm/delay.c similarity index 100% rename from lib/arm/delay.c rename to guest/lib/arm/delay.c diff --git a/lib/arm/eabi_compat.c b/guest/lib/arm/eabi_compat.c similarity index 100% rename from lib/arm/eabi_compat.c rename to guest/lib/arm/eabi_compat.c diff --git a/lib/arm/gic-v2.c b/guest/lib/arm/gic-v2.c similarity index 100% rename from lib/arm/gic-v2.c rename to guest/lib/arm/gic-v2.c diff --git a/lib/arm/gic-v3.c b/guest/lib/arm/gic-v3.c similarity index 100% rename from lib/arm/gic-v3.c rename to guest/lib/arm/gic-v3.c diff --git a/lib/arm/gic.c b/guest/lib/arm/gic.c similarity index 100% rename from lib/arm/gic.c rename to guest/lib/arm/gic.c diff --git a/lib/arm/io.c b/guest/lib/arm/io.c similarity index 100% rename from lib/arm/io.c rename to guest/lib/arm/io.c diff --git a/lib/arm/io.h b/guest/lib/arm/io.h similarity index 100% rename from lib/arm/io.h rename to guest/lib/arm/io.h diff --git a/lib/arm/mmu.c b/guest/lib/arm/mmu.c similarity index 100% rename from lib/arm/mmu.c rename to guest/lib/arm/mmu.c diff --git a/lib/arm/processor.c b/guest/lib/arm/processor.c similarity index 100% rename from lib/arm/processor.c rename to guest/lib/arm/processor.c diff --git a/lib/arm/psci.c b/guest/lib/arm/psci.c similarity index 100% rename from lib/arm/psci.c rename to guest/lib/arm/psci.c diff --git a/lib/arm/setup.c b/guest/lib/arm/setup.c similarity index 100% rename from lib/arm/setup.c rename to guest/lib/arm/setup.c diff --git a/lib/arm/smp.c b/guest/lib/arm/smp.c similarity index 100% rename from lib/arm/smp.c rename to guest/lib/arm/smp.c diff --git a/lib/arm/spinlock.c b/guest/lib/arm/spinlock.c similarity index 100% rename from lib/arm/spinlock.c rename to guest/lib/arm/spinlock.c diff --git a/lib/arm/stack.c b/guest/lib/arm/stack.c similarity index 100% rename from lib/arm/stack.c rename to guest/lib/arm/stack.c diff --git a/lib/arm64/.gitignore b/guest/lib/arm64/.gitignore similarity index 100% rename from lib/arm64/.gitignore rename to guest/lib/arm64/.gitignore diff --git a/lib/arm64/asm-offsets.c b/guest/lib/arm64/asm-offsets.c similarity index 100% rename from lib/arm64/asm-offsets.c rename to guest/lib/arm64/asm-offsets.c diff --git a/lib/arm64/asm/arch_gicv3.h b/guest/lib/arm64/asm/arch_gicv3.h similarity index 100% rename from lib/arm64/asm/arch_gicv3.h rename to guest/lib/arm64/asm/arch_gicv3.h diff --git a/lib/arm64/asm/barrier.h b/guest/lib/arm64/asm/barrier.h similarity index 100% rename from lib/arm64/asm/barrier.h rename to guest/lib/arm64/asm/barrier.h diff --git a/lib/arm64/asm/bitops.h b/guest/lib/arm64/asm/bitops.h similarity index 100% rename from lib/arm64/asm/bitops.h rename to guest/lib/arm64/asm/bitops.h diff --git a/lib/arm64/asm/cpumask.h b/guest/lib/arm64/asm/cpumask.h similarity index 100% rename from lib/arm64/asm/cpumask.h rename to guest/lib/arm64/asm/cpumask.h diff --git a/lib/arm64/asm/delay.h b/guest/lib/arm64/asm/delay.h similarity index 100% rename from lib/arm64/asm/delay.h rename to guest/lib/arm64/asm/delay.h diff --git a/lib/arm64/asm/esr.h b/guest/lib/arm64/asm/esr.h similarity index 100% rename from lib/arm64/asm/esr.h rename to guest/lib/arm64/asm/esr.h diff --git a/lib/arm64/asm/gic-v2.h b/guest/lib/arm64/asm/gic-v2.h similarity index 100% rename from lib/arm64/asm/gic-v2.h rename to guest/lib/arm64/asm/gic-v2.h diff --git a/lib/arm64/asm/gic-v3.h b/guest/lib/arm64/asm/gic-v3.h similarity index 100% rename from lib/arm64/asm/gic-v3.h rename to guest/lib/arm64/asm/gic-v3.h diff --git a/lib/arm64/asm/gic.h b/guest/lib/arm64/asm/gic.h similarity index 100% rename from lib/arm64/asm/gic.h rename to guest/lib/arm64/asm/gic.h diff --git a/lib/arm64/asm/io.h b/guest/lib/arm64/asm/io.h similarity index 100% rename from lib/arm64/asm/io.h rename to guest/lib/arm64/asm/io.h diff --git a/lib/arm64/asm/mmu-api.h b/guest/lib/arm64/asm/mmu-api.h similarity index 100% rename from lib/arm64/asm/mmu-api.h rename to guest/lib/arm64/asm/mmu-api.h diff --git a/lib/arm64/asm/mmu.h b/guest/lib/arm64/asm/mmu.h similarity index 100% rename from lib/arm64/asm/mmu.h rename to guest/lib/arm64/asm/mmu.h diff --git a/lib/arm64/asm/page.h b/guest/lib/arm64/asm/page.h similarity index 100% rename from lib/arm64/asm/page.h rename to guest/lib/arm64/asm/page.h diff --git a/lib/arm64/asm/pci.h b/guest/lib/arm64/asm/pci.h similarity index 100% rename from lib/arm64/asm/pci.h rename to guest/lib/arm64/asm/pci.h diff --git a/lib/arm64/asm/pgtable-hwdef.h b/guest/lib/arm64/asm/pgtable-hwdef.h similarity index 100% rename from lib/arm64/asm/pgtable-hwdef.h rename to guest/lib/arm64/asm/pgtable-hwdef.h diff --git a/lib/arm64/asm/pgtable.h b/guest/lib/arm64/asm/pgtable.h similarity index 100% rename from lib/arm64/asm/pgtable.h rename to guest/lib/arm64/asm/pgtable.h diff --git a/lib/arm64/asm/processor.h b/guest/lib/arm64/asm/processor.h similarity index 100% rename from lib/arm64/asm/processor.h rename to guest/lib/arm64/asm/processor.h diff --git a/lib/arm64/asm/psci.h b/guest/lib/arm64/asm/psci.h similarity index 100% rename from lib/arm64/asm/psci.h rename to guest/lib/arm64/asm/psci.h diff --git a/lib/arm64/asm/ptrace.h b/guest/lib/arm64/asm/ptrace.h similarity index 100% rename from lib/arm64/asm/ptrace.h rename to guest/lib/arm64/asm/ptrace.h diff --git a/lib/arm64/asm/setup.h b/guest/lib/arm64/asm/setup.h similarity index 100% rename from lib/arm64/asm/setup.h rename to guest/lib/arm64/asm/setup.h diff --git a/lib/arm64/asm/smp.h b/guest/lib/arm64/asm/smp.h similarity index 100% rename from lib/arm64/asm/smp.h rename to guest/lib/arm64/asm/smp.h diff --git a/lib/arm64/asm/spinlock.h b/guest/lib/arm64/asm/spinlock.h similarity index 100% rename from lib/arm64/asm/spinlock.h rename to guest/lib/arm64/asm/spinlock.h diff --git a/lib/arm64/asm/stack.h b/guest/lib/arm64/asm/stack.h similarity index 100% rename from lib/arm64/asm/stack.h rename to guest/lib/arm64/asm/stack.h diff --git a/lib/arm64/asm/sysreg.h b/guest/lib/arm64/asm/sysreg.h similarity index 100% rename from lib/arm64/asm/sysreg.h rename to guest/lib/arm64/asm/sysreg.h diff --git a/lib/arm64/asm/thread_info.h b/guest/lib/arm64/asm/thread_info.h similarity index 100% rename from lib/arm64/asm/thread_info.h rename to guest/lib/arm64/asm/thread_info.h diff --git a/lib/arm64/processor.c b/guest/lib/arm64/processor.c similarity index 100% rename from lib/arm64/processor.c rename to guest/lib/arm64/processor.c diff --git a/lib/arm64/spinlock.c b/guest/lib/arm64/spinlock.c similarity index 100% rename from lib/arm64/spinlock.c rename to guest/lib/arm64/spinlock.c diff --git a/lib/asm b/guest/lib/asm similarity index 100% rename from lib/asm rename to guest/lib/asm diff --git a/lib/asm-generic/atomic.h b/guest/lib/asm-generic/atomic.h similarity index 100% rename from lib/asm-generic/atomic.h rename to guest/lib/asm-generic/atomic.h diff --git a/lib/asm-generic/barrier.h b/guest/lib/asm-generic/barrier.h similarity index 100% rename from lib/asm-generic/barrier.h rename to guest/lib/asm-generic/barrier.h diff --git a/lib/asm-generic/io.h b/guest/lib/asm-generic/io.h similarity index 100% rename from lib/asm-generic/io.h rename to guest/lib/asm-generic/io.h diff --git a/lib/asm-generic/page.h b/guest/lib/asm-generic/page.h similarity index 100% rename from lib/asm-generic/page.h rename to guest/lib/asm-generic/page.h diff --git a/lib/asm-generic/pci-host-bridge.h b/guest/lib/asm-generic/pci-host-bridge.h similarity index 100% rename from lib/asm-generic/pci-host-bridge.h rename to guest/lib/asm-generic/pci-host-bridge.h diff --git a/lib/asm-generic/pci.h b/guest/lib/asm-generic/pci.h similarity index 100% rename from lib/asm-generic/pci.h rename to guest/lib/asm-generic/pci.h diff --git a/lib/asm-generic/spinlock.h b/guest/lib/asm-generic/spinlock.h similarity index 100% rename from lib/asm-generic/spinlock.h rename to guest/lib/asm-generic/spinlock.h diff --git a/lib/auxinfo.c b/guest/lib/auxinfo.c similarity index 100% rename from lib/auxinfo.c rename to guest/lib/auxinfo.c diff --git a/lib/auxinfo.h b/guest/lib/auxinfo.h similarity index 100% rename from lib/auxinfo.h rename to guest/lib/auxinfo.h diff --git a/lib/bitops.h b/guest/lib/bitops.h similarity index 100% rename from lib/bitops.h rename to guest/lib/bitops.h diff --git a/lib/chr-testdev.c b/guest/lib/chr-testdev.c similarity index 100% rename from lib/chr-testdev.c rename to guest/lib/chr-testdev.c diff --git a/lib/chr-testdev.h b/guest/lib/chr-testdev.h similarity index 100% rename from lib/chr-testdev.h rename to guest/lib/chr-testdev.h diff --git a/lib/devicetree.c b/guest/lib/devicetree.c similarity index 100% rename from lib/devicetree.c rename to guest/lib/devicetree.c diff --git a/lib/devicetree.h b/guest/lib/devicetree.h similarity index 100% rename from lib/devicetree.h rename to guest/lib/devicetree.h diff --git a/lib/errata.h b/guest/lib/errata.h similarity index 100% rename from lib/errata.h rename to guest/lib/errata.h diff --git a/lib/getchar.c b/guest/lib/getchar.c similarity index 100% rename from lib/getchar.c rename to guest/lib/getchar.c diff --git a/lib/kbuild.h b/guest/lib/kbuild.h similarity index 100% rename from lib/kbuild.h rename to guest/lib/kbuild.h diff --git a/lib/libcflat.h b/guest/lib/libcflat.h similarity index 100% rename from lib/libcflat.h rename to guest/lib/libcflat.h diff --git a/lib/libfdt/Makefile.libfdt b/guest/lib/libfdt/Makefile.libfdt similarity index 100% rename from lib/libfdt/Makefile.libfdt rename to guest/lib/libfdt/Makefile.libfdt diff --git a/lib/libfdt/README b/guest/lib/libfdt/README similarity index 100% rename from lib/libfdt/README rename to guest/lib/libfdt/README diff --git a/lib/libfdt/fdt.c b/guest/lib/libfdt/fdt.c similarity index 100% rename from lib/libfdt/fdt.c rename to guest/lib/libfdt/fdt.c diff --git a/lib/libfdt/fdt.h b/guest/lib/libfdt/fdt.h similarity index 100% rename from lib/libfdt/fdt.h rename to guest/lib/libfdt/fdt.h diff --git a/lib/libfdt/fdt_empty_tree.c b/guest/lib/libfdt/fdt_empty_tree.c similarity index 100% rename from lib/libfdt/fdt_empty_tree.c rename to guest/lib/libfdt/fdt_empty_tree.c diff --git a/lib/libfdt/fdt_ro.c b/guest/lib/libfdt/fdt_ro.c similarity index 100% rename from lib/libfdt/fdt_ro.c rename to guest/lib/libfdt/fdt_ro.c diff --git a/lib/libfdt/fdt_rw.c b/guest/lib/libfdt/fdt_rw.c similarity index 100% rename from lib/libfdt/fdt_rw.c rename to guest/lib/libfdt/fdt_rw.c diff --git a/lib/libfdt/fdt_strerror.c b/guest/lib/libfdt/fdt_strerror.c similarity index 100% rename from lib/libfdt/fdt_strerror.c rename to guest/lib/libfdt/fdt_strerror.c diff --git a/lib/libfdt/fdt_sw.c b/guest/lib/libfdt/fdt_sw.c similarity index 100% rename from lib/libfdt/fdt_sw.c rename to guest/lib/libfdt/fdt_sw.c diff --git a/lib/libfdt/fdt_wip.c b/guest/lib/libfdt/fdt_wip.c similarity index 100% rename from lib/libfdt/fdt_wip.c rename to guest/lib/libfdt/fdt_wip.c diff --git a/lib/libfdt/libfdt.h b/guest/lib/libfdt/libfdt.h similarity index 100% rename from lib/libfdt/libfdt.h rename to guest/lib/libfdt/libfdt.h diff --git a/lib/libfdt/libfdt_env.h b/guest/lib/libfdt/libfdt_env.h similarity index 100% rename from lib/libfdt/libfdt_env.h rename to guest/lib/libfdt/libfdt_env.h diff --git a/lib/libfdt/libfdt_internal.h b/guest/lib/libfdt/libfdt_internal.h similarity index 100% rename from lib/libfdt/libfdt_internal.h rename to guest/lib/libfdt/libfdt_internal.h diff --git a/lib/libfdt/version.lds b/guest/lib/libfdt/version.lds similarity index 100% rename from lib/libfdt/version.lds rename to guest/lib/libfdt/version.lds diff --git a/lib/linux/const.h b/guest/lib/linux/const.h similarity index 100% rename from lib/linux/const.h rename to guest/lib/linux/const.h diff --git a/lib/linux/pci_regs.h b/guest/lib/linux/pci_regs.h similarity index 100% rename from lib/linux/pci_regs.h rename to guest/lib/linux/pci_regs.h diff --git a/lib/linux/psci.h b/guest/lib/linux/psci.h similarity index 100% rename from lib/linux/psci.h rename to guest/lib/linux/psci.h diff --git a/lib/pci-edu.c b/guest/lib/pci-edu.c similarity index 100% rename from lib/pci-edu.c rename to guest/lib/pci-edu.c diff --git a/lib/pci-edu.h b/guest/lib/pci-edu.h similarity index 100% rename from lib/pci-edu.h rename to guest/lib/pci-edu.h diff --git a/lib/pci-host-generic.c b/guest/lib/pci-host-generic.c similarity index 100% rename from lib/pci-host-generic.c rename to guest/lib/pci-host-generic.c diff --git a/lib/pci-host-generic.h b/guest/lib/pci-host-generic.h similarity index 100% rename from lib/pci-host-generic.h rename to guest/lib/pci-host-generic.h diff --git a/lib/pci-testdev.c b/guest/lib/pci-testdev.c similarity index 100% rename from lib/pci-testdev.c rename to guest/lib/pci-testdev.c diff --git a/lib/pci.c b/guest/lib/pci.c similarity index 100% rename from lib/pci.c rename to guest/lib/pci.c diff --git a/lib/pci.h b/guest/lib/pci.h similarity index 100% rename from lib/pci.h rename to guest/lib/pci.h diff --git a/lib/powerpc/.gitignore b/guest/lib/powerpc/.gitignore similarity index 100% rename from lib/powerpc/.gitignore rename to guest/lib/powerpc/.gitignore diff --git a/lib/powerpc/asm/handlers.h b/guest/lib/powerpc/asm/handlers.h similarity index 100% rename from lib/powerpc/asm/handlers.h rename to guest/lib/powerpc/asm/handlers.h diff --git a/lib/powerpc/asm/hcall.h b/guest/lib/powerpc/asm/hcall.h similarity index 100% rename from lib/powerpc/asm/hcall.h rename to guest/lib/powerpc/asm/hcall.h diff --git a/lib/powerpc/asm/ppc_asm.h b/guest/lib/powerpc/asm/ppc_asm.h similarity index 100% rename from lib/powerpc/asm/ppc_asm.h rename to guest/lib/powerpc/asm/ppc_asm.h diff --git a/lib/powerpc/asm/processor.h b/guest/lib/powerpc/asm/processor.h similarity index 100% rename from lib/powerpc/asm/processor.h rename to guest/lib/powerpc/asm/processor.h diff --git a/lib/powerpc/asm/rtas.h b/guest/lib/powerpc/asm/rtas.h similarity index 100% rename from lib/powerpc/asm/rtas.h rename to guest/lib/powerpc/asm/rtas.h diff --git a/lib/powerpc/asm/setup.h b/guest/lib/powerpc/asm/setup.h similarity index 100% rename from lib/powerpc/asm/setup.h rename to guest/lib/powerpc/asm/setup.h diff --git a/lib/powerpc/asm/smp.h b/guest/lib/powerpc/asm/smp.h similarity index 100% rename from lib/powerpc/asm/smp.h rename to guest/lib/powerpc/asm/smp.h diff --git a/lib/powerpc/asm/stack.h b/guest/lib/powerpc/asm/stack.h similarity index 100% rename from lib/powerpc/asm/stack.h rename to guest/lib/powerpc/asm/stack.h diff --git a/lib/powerpc/handlers.c b/guest/lib/powerpc/handlers.c similarity index 100% rename from lib/powerpc/handlers.c rename to guest/lib/powerpc/handlers.c diff --git a/lib/powerpc/hcall.c b/guest/lib/powerpc/hcall.c similarity index 100% rename from lib/powerpc/hcall.c rename to guest/lib/powerpc/hcall.c diff --git a/lib/powerpc/io.c b/guest/lib/powerpc/io.c similarity index 100% rename from lib/powerpc/io.c rename to guest/lib/powerpc/io.c diff --git a/lib/powerpc/io.h b/guest/lib/powerpc/io.h similarity index 100% rename from lib/powerpc/io.h rename to guest/lib/powerpc/io.h diff --git a/lib/powerpc/processor.c b/guest/lib/powerpc/processor.c similarity index 100% rename from lib/powerpc/processor.c rename to guest/lib/powerpc/processor.c diff --git a/lib/powerpc/rtas.c b/guest/lib/powerpc/rtas.c similarity index 100% rename from lib/powerpc/rtas.c rename to guest/lib/powerpc/rtas.c diff --git a/lib/powerpc/setup.c b/guest/lib/powerpc/setup.c similarity index 100% rename from lib/powerpc/setup.c rename to guest/lib/powerpc/setup.c diff --git a/lib/powerpc/smp.c b/guest/lib/powerpc/smp.c similarity index 100% rename from lib/powerpc/smp.c rename to guest/lib/powerpc/smp.c diff --git a/lib/ppc64/.gitignore b/guest/lib/ppc64/.gitignore similarity index 100% rename from lib/ppc64/.gitignore rename to guest/lib/ppc64/.gitignore diff --git a/lib/ppc64/asm-offsets.c b/guest/lib/ppc64/asm-offsets.c similarity index 100% rename from lib/ppc64/asm-offsets.c rename to guest/lib/ppc64/asm-offsets.c diff --git a/lib/ppc64/asm/barrier.h b/guest/lib/ppc64/asm/barrier.h similarity index 100% rename from lib/ppc64/asm/barrier.h rename to guest/lib/ppc64/asm/barrier.h diff --git a/lib/ppc64/asm/bitops.h b/guest/lib/ppc64/asm/bitops.h similarity index 100% rename from lib/ppc64/asm/bitops.h rename to guest/lib/ppc64/asm/bitops.h diff --git a/lib/ppc64/asm/handlers.h b/guest/lib/ppc64/asm/handlers.h similarity index 100% rename from lib/ppc64/asm/handlers.h rename to guest/lib/ppc64/asm/handlers.h diff --git a/lib/ppc64/asm/hcall.h b/guest/lib/ppc64/asm/hcall.h similarity index 100% rename from lib/ppc64/asm/hcall.h rename to guest/lib/ppc64/asm/hcall.h diff --git a/lib/ppc64/asm/io.h b/guest/lib/ppc64/asm/io.h similarity index 100% rename from lib/ppc64/asm/io.h rename to guest/lib/ppc64/asm/io.h diff --git a/lib/ppc64/asm/page.h b/guest/lib/ppc64/asm/page.h similarity index 100% rename from lib/ppc64/asm/page.h rename to guest/lib/ppc64/asm/page.h diff --git a/lib/ppc64/asm/ppc_asm.h b/guest/lib/ppc64/asm/ppc_asm.h similarity index 100% rename from lib/ppc64/asm/ppc_asm.h rename to guest/lib/ppc64/asm/ppc_asm.h diff --git a/lib/ppc64/asm/processor.h b/guest/lib/ppc64/asm/processor.h similarity index 100% rename from lib/ppc64/asm/processor.h rename to guest/lib/ppc64/asm/processor.h diff --git a/lib/ppc64/asm/ptrace.h b/guest/lib/ppc64/asm/ptrace.h similarity index 100% rename from lib/ppc64/asm/ptrace.h rename to guest/lib/ppc64/asm/ptrace.h diff --git a/lib/ppc64/asm/rtas.h b/guest/lib/ppc64/asm/rtas.h similarity index 100% rename from lib/ppc64/asm/rtas.h rename to guest/lib/ppc64/asm/rtas.h diff --git a/lib/ppc64/asm/setup.h b/guest/lib/ppc64/asm/setup.h similarity index 100% rename from lib/ppc64/asm/setup.h rename to guest/lib/ppc64/asm/setup.h diff --git a/lib/ppc64/asm/smp.h b/guest/lib/ppc64/asm/smp.h similarity index 100% rename from lib/ppc64/asm/smp.h rename to guest/lib/ppc64/asm/smp.h diff --git a/lib/ppc64/asm/spinlock.h b/guest/lib/ppc64/asm/spinlock.h similarity index 100% rename from lib/ppc64/asm/spinlock.h rename to guest/lib/ppc64/asm/spinlock.h diff --git a/lib/ppc64/asm/stack.h b/guest/lib/ppc64/asm/stack.h similarity index 100% rename from lib/ppc64/asm/stack.h rename to guest/lib/ppc64/asm/stack.h diff --git a/lib/printf.c b/guest/lib/printf.c similarity index 100% rename from lib/printf.c rename to guest/lib/printf.c diff --git a/lib/report.c b/guest/lib/report.c similarity index 100% rename from lib/report.c rename to guest/lib/report.c diff --git a/lib/s390x/.gitignore b/guest/lib/s390x/.gitignore similarity index 100% rename from lib/s390x/.gitignore rename to guest/lib/s390x/.gitignore diff --git a/lib/s390x/asm-offsets.c b/guest/lib/s390x/asm-offsets.c similarity index 100% rename from lib/s390x/asm-offsets.c rename to guest/lib/s390x/asm-offsets.c diff --git a/lib/s390x/asm/arch_def.h b/guest/lib/s390x/asm/arch_def.h similarity index 100% rename from lib/s390x/asm/arch_def.h rename to guest/lib/s390x/asm/arch_def.h diff --git a/lib/s390x/asm/barrier.h b/guest/lib/s390x/asm/barrier.h similarity index 100% rename from lib/s390x/asm/barrier.h rename to guest/lib/s390x/asm/barrier.h diff --git a/lib/s390x/asm/bitops.h b/guest/lib/s390x/asm/bitops.h similarity index 100% rename from lib/s390x/asm/bitops.h rename to guest/lib/s390x/asm/bitops.h diff --git a/lib/s390x/asm/cpacf.h b/guest/lib/s390x/asm/cpacf.h similarity index 100% rename from lib/s390x/asm/cpacf.h rename to guest/lib/s390x/asm/cpacf.h diff --git a/lib/s390x/asm/facility.h b/guest/lib/s390x/asm/facility.h similarity index 100% rename from lib/s390x/asm/facility.h rename to guest/lib/s390x/asm/facility.h diff --git a/lib/s390x/asm/float.h b/guest/lib/s390x/asm/float.h similarity index 100% rename from lib/s390x/asm/float.h rename to guest/lib/s390x/asm/float.h diff --git a/lib/s390x/asm/interrupt.h b/guest/lib/s390x/asm/interrupt.h similarity index 100% rename from lib/s390x/asm/interrupt.h rename to guest/lib/s390x/asm/interrupt.h diff --git a/lib/s390x/asm/io.h b/guest/lib/s390x/asm/io.h similarity index 100% rename from lib/s390x/asm/io.h rename to guest/lib/s390x/asm/io.h diff --git a/lib/s390x/asm/mem.h b/guest/lib/s390x/asm/mem.h similarity index 100% rename from lib/s390x/asm/mem.h rename to guest/lib/s390x/asm/mem.h diff --git a/lib/s390x/asm/page.h b/guest/lib/s390x/asm/page.h similarity index 100% rename from lib/s390x/asm/page.h rename to guest/lib/s390x/asm/page.h diff --git a/lib/s390x/asm/pgtable.h b/guest/lib/s390x/asm/pgtable.h similarity index 100% rename from lib/s390x/asm/pgtable.h rename to guest/lib/s390x/asm/pgtable.h diff --git a/lib/s390x/asm/spinlock.h b/guest/lib/s390x/asm/spinlock.h similarity index 100% rename from lib/s390x/asm/spinlock.h rename to guest/lib/s390x/asm/spinlock.h diff --git a/lib/s390x/asm/stack.h b/guest/lib/s390x/asm/stack.h similarity index 100% rename from lib/s390x/asm/stack.h rename to guest/lib/s390x/asm/stack.h diff --git a/lib/s390x/interrupt.c b/guest/lib/s390x/interrupt.c similarity index 100% rename from lib/s390x/interrupt.c rename to guest/lib/s390x/interrupt.c diff --git a/lib/s390x/io.c b/guest/lib/s390x/io.c similarity index 100% rename from lib/s390x/io.c rename to guest/lib/s390x/io.c diff --git a/lib/s390x/mmu.c b/guest/lib/s390x/mmu.c similarity index 100% rename from lib/s390x/mmu.c rename to guest/lib/s390x/mmu.c diff --git a/lib/s390x/mmu.h b/guest/lib/s390x/mmu.h similarity index 100% rename from lib/s390x/mmu.h rename to guest/lib/s390x/mmu.h diff --git a/lib/s390x/sclp-ascii.c b/guest/lib/s390x/sclp-ascii.c similarity index 100% rename from lib/s390x/sclp-ascii.c rename to guest/lib/s390x/sclp-ascii.c diff --git a/lib/s390x/sclp.c b/guest/lib/s390x/sclp.c similarity index 100% rename from lib/s390x/sclp.c rename to guest/lib/s390x/sclp.c diff --git a/lib/s390x/sclp.h b/guest/lib/s390x/sclp.h similarity index 100% rename from lib/s390x/sclp.h rename to guest/lib/s390x/sclp.h diff --git a/lib/s390x/stack.c b/guest/lib/s390x/stack.c similarity index 100% rename from lib/s390x/stack.c rename to guest/lib/s390x/stack.c diff --git a/lib/setjmp.h b/guest/lib/setjmp.h similarity index 100% rename from lib/setjmp.h rename to guest/lib/setjmp.h diff --git a/lib/stack.c b/guest/lib/stack.c similarity index 100% rename from lib/stack.c rename to guest/lib/stack.c diff --git a/lib/stack.h b/guest/lib/stack.h similarity index 100% rename from lib/stack.h rename to guest/lib/stack.h diff --git a/lib/string.c b/guest/lib/string.c similarity index 100% rename from lib/string.c rename to guest/lib/string.c diff --git a/lib/string.h b/guest/lib/string.h similarity index 100% rename from lib/string.h rename to guest/lib/string.h diff --git a/lib/util.c b/guest/lib/util.c similarity index 100% rename from lib/util.c rename to guest/lib/util.c diff --git a/lib/util.h b/guest/lib/util.h similarity index 100% rename from lib/util.h rename to guest/lib/util.h diff --git a/lib/virtio-mmio.c b/guest/lib/virtio-mmio.c similarity index 100% rename from lib/virtio-mmio.c rename to guest/lib/virtio-mmio.c diff --git a/lib/virtio-mmio.h b/guest/lib/virtio-mmio.h similarity index 100% rename from lib/virtio-mmio.h rename to guest/lib/virtio-mmio.h diff --git a/lib/virtio.c b/guest/lib/virtio.c similarity index 100% rename from lib/virtio.c rename to guest/lib/virtio.c diff --git a/lib/virtio.h b/guest/lib/virtio.h similarity index 100% rename from lib/virtio.h rename to guest/lib/virtio.h diff --git a/lib/vmalloc.c b/guest/lib/vmalloc.c similarity index 100% rename from lib/vmalloc.c rename to guest/lib/vmalloc.c diff --git a/lib/vmalloc.h b/guest/lib/vmalloc.h similarity index 100% rename from lib/vmalloc.h rename to guest/lib/vmalloc.h diff --git a/lib/x86/acpi.c b/guest/lib/x86/acpi.c similarity index 100% rename from lib/x86/acpi.c rename to guest/lib/x86/acpi.c diff --git a/lib/x86/acpi.h b/guest/lib/x86/acpi.h similarity index 100% rename from lib/x86/acpi.h rename to guest/lib/x86/acpi.h diff --git a/lib/x86/apic-defs.h b/guest/lib/x86/apic-defs.h similarity index 100% rename from lib/x86/apic-defs.h rename to guest/lib/x86/apic-defs.h diff --git a/lib/x86/apic.c b/guest/lib/x86/apic.c similarity index 100% rename from lib/x86/apic.c rename to guest/lib/x86/apic.c diff --git a/lib/x86/apic.h b/guest/lib/x86/apic.h similarity index 100% rename from lib/x86/apic.h rename to guest/lib/x86/apic.h diff --git a/lib/x86/asm/barrier.h b/guest/lib/x86/asm/barrier.h similarity index 100% rename from lib/x86/asm/barrier.h rename to guest/lib/x86/asm/barrier.h diff --git a/lib/x86/asm/bitops.h b/guest/lib/x86/asm/bitops.h similarity index 100% rename from lib/x86/asm/bitops.h rename to guest/lib/x86/asm/bitops.h diff --git a/lib/x86/asm/io.h b/guest/lib/x86/asm/io.h similarity index 100% rename from lib/x86/asm/io.h rename to guest/lib/x86/asm/io.h diff --git a/lib/x86/asm/page.h b/guest/lib/x86/asm/page.h similarity index 100% rename from lib/x86/asm/page.h rename to guest/lib/x86/asm/page.h diff --git a/lib/x86/asm/pci.h b/guest/lib/x86/asm/pci.h similarity index 100% rename from lib/x86/asm/pci.h rename to guest/lib/x86/asm/pci.h diff --git a/lib/x86/asm/spinlock.h b/guest/lib/x86/asm/spinlock.h similarity index 100% rename from lib/x86/asm/spinlock.h rename to guest/lib/x86/asm/spinlock.h diff --git a/lib/x86/asm/stack.h b/guest/lib/x86/asm/stack.h similarity index 100% rename from lib/x86/asm/stack.h rename to guest/lib/x86/asm/stack.h diff --git a/lib/x86/atomic.c b/guest/lib/x86/atomic.c similarity index 100% rename from lib/x86/atomic.c rename to guest/lib/x86/atomic.c diff --git a/lib/x86/atomic.h b/guest/lib/x86/atomic.h similarity index 100% rename from lib/x86/atomic.h rename to guest/lib/x86/atomic.h diff --git a/lib/x86/delay.c b/guest/lib/x86/delay.c similarity index 100% rename from lib/x86/delay.c rename to guest/lib/x86/delay.c diff --git a/lib/x86/delay.h b/guest/lib/x86/delay.h similarity index 100% rename from lib/x86/delay.h rename to guest/lib/x86/delay.h diff --git a/lib/x86/desc.c b/guest/lib/x86/desc.c similarity index 100% rename from lib/x86/desc.c rename to guest/lib/x86/desc.c diff --git a/lib/x86/desc.h b/guest/lib/x86/desc.h similarity index 100% rename from lib/x86/desc.h rename to guest/lib/x86/desc.h diff --git a/lib/x86/fake-apic.h b/guest/lib/x86/fake-apic.h similarity index 100% rename from lib/x86/fake-apic.h rename to guest/lib/x86/fake-apic.h diff --git a/lib/x86/fault_test.c b/guest/lib/x86/fault_test.c similarity index 100% rename from lib/x86/fault_test.c rename to guest/lib/x86/fault_test.c diff --git a/lib/x86/fault_test.h b/guest/lib/x86/fault_test.h similarity index 100% rename from lib/x86/fault_test.h rename to guest/lib/x86/fault_test.h diff --git a/lib/x86/fwcfg.c b/guest/lib/x86/fwcfg.c similarity index 100% rename from lib/x86/fwcfg.c rename to guest/lib/x86/fwcfg.c diff --git a/lib/x86/fwcfg.h b/guest/lib/x86/fwcfg.h similarity index 100% rename from lib/x86/fwcfg.h rename to guest/lib/x86/fwcfg.h diff --git a/lib/x86/intel-iommu.c b/guest/lib/x86/intel-iommu.c similarity index 100% rename from lib/x86/intel-iommu.c rename to guest/lib/x86/intel-iommu.c diff --git a/lib/x86/intel-iommu.h b/guest/lib/x86/intel-iommu.h similarity index 100% rename from lib/x86/intel-iommu.h rename to guest/lib/x86/intel-iommu.h diff --git a/lib/x86/io.c b/guest/lib/x86/io.c similarity index 100% rename from lib/x86/io.c rename to guest/lib/x86/io.c diff --git a/lib/x86/isr.c b/guest/lib/x86/isr.c similarity index 100% rename from lib/x86/isr.c rename to guest/lib/x86/isr.c diff --git a/lib/x86/isr.h b/guest/lib/x86/isr.h similarity index 100% rename from lib/x86/isr.h rename to guest/lib/x86/isr.h diff --git a/lib/x86/msr.h b/guest/lib/x86/msr.h similarity index 100% rename from lib/x86/msr.h rename to guest/lib/x86/msr.h diff --git a/lib/x86/processor.h b/guest/lib/x86/processor.h similarity index 100% rename from lib/x86/processor.h rename to guest/lib/x86/processor.h diff --git a/lib/x86/setjmp32.S b/guest/lib/x86/setjmp32.S similarity index 100% rename from lib/x86/setjmp32.S rename to guest/lib/x86/setjmp32.S diff --git a/lib/x86/setjmp64.S b/guest/lib/x86/setjmp64.S similarity index 100% rename from lib/x86/setjmp64.S rename to guest/lib/x86/setjmp64.S diff --git a/lib/x86/setup.c b/guest/lib/x86/setup.c similarity index 100% rename from lib/x86/setup.c rename to guest/lib/x86/setup.c diff --git a/lib/x86/smp.c b/guest/lib/x86/smp.c similarity index 100% rename from lib/x86/smp.c rename to guest/lib/x86/smp.c diff --git a/lib/x86/smp.h b/guest/lib/x86/smp.h similarity index 100% rename from lib/x86/smp.h rename to guest/lib/x86/smp.h diff --git a/lib/x86/stack.c b/guest/lib/x86/stack.c similarity index 100% rename from lib/x86/stack.c rename to guest/lib/x86/stack.c diff --git a/lib/x86/usermode.c b/guest/lib/x86/usermode.c similarity index 100% rename from lib/x86/usermode.c rename to guest/lib/x86/usermode.c diff --git a/lib/x86/usermode.h b/guest/lib/x86/usermode.h similarity index 100% rename from lib/x86/usermode.h rename to guest/lib/x86/usermode.h diff --git a/lib/x86/vm.c b/guest/lib/x86/vm.c similarity index 100% rename from lib/x86/vm.c rename to guest/lib/x86/vm.c diff --git a/lib/x86/vm.h b/guest/lib/x86/vm.h similarity index 100% rename from lib/x86/vm.h rename to guest/lib/x86/vm.h diff --git a/powerpc/.gitignore b/guest/powerpc/.gitignore similarity index 100% rename from powerpc/.gitignore rename to guest/powerpc/.gitignore diff --git a/powerpc/Makefile b/guest/powerpc/Makefile similarity index 100% rename from powerpc/Makefile rename to guest/powerpc/Makefile diff --git a/powerpc/Makefile.common b/guest/powerpc/Makefile.common similarity index 100% rename from powerpc/Makefile.common rename to guest/powerpc/Makefile.common diff --git a/powerpc/Makefile.ppc64 b/guest/powerpc/Makefile.ppc64 similarity index 100% rename from powerpc/Makefile.ppc64 rename to guest/powerpc/Makefile.ppc64 diff --git a/powerpc/boot_rom.S b/guest/powerpc/boot_rom.S similarity index 100% rename from powerpc/boot_rom.S rename to guest/powerpc/boot_rom.S diff --git a/powerpc/cstart64.S b/guest/powerpc/cstart64.S similarity index 100% rename from powerpc/cstart64.S rename to guest/powerpc/cstart64.S diff --git a/powerpc/emulator.c b/guest/powerpc/emulator.c similarity index 100% rename from powerpc/emulator.c rename to guest/powerpc/emulator.c diff --git a/powerpc/flat.lds b/guest/powerpc/flat.lds similarity index 100% rename from powerpc/flat.lds rename to guest/powerpc/flat.lds diff --git a/powerpc/reloc64.c b/guest/powerpc/reloc64.c similarity index 100% rename from powerpc/reloc64.c rename to guest/powerpc/reloc64.c diff --git a/powerpc/rtas.c b/guest/powerpc/rtas.c similarity index 100% rename from powerpc/rtas.c rename to guest/powerpc/rtas.c diff --git a/powerpc/run b/guest/powerpc/run similarity index 100% rename from powerpc/run rename to guest/powerpc/run diff --git a/powerpc/selftest.c b/guest/powerpc/selftest.c similarity index 100% rename from powerpc/selftest.c rename to guest/powerpc/selftest.c diff --git a/powerpc/spapr.h b/guest/powerpc/spapr.h similarity index 100% rename from powerpc/spapr.h rename to guest/powerpc/spapr.h diff --git a/powerpc/spapr_hcall.c b/guest/powerpc/spapr_hcall.c similarity index 100% rename from powerpc/spapr_hcall.c rename to guest/powerpc/spapr_hcall.c diff --git a/powerpc/sprs.c b/guest/powerpc/sprs.c similarity index 100% rename from powerpc/sprs.c rename to guest/powerpc/sprs.c diff --git a/powerpc/tm.c b/guest/powerpc/tm.c similarity index 100% rename from powerpc/tm.c rename to guest/powerpc/tm.c diff --git a/powerpc/unittests.cfg b/guest/powerpc/unittests.cfg similarity index 100% rename from powerpc/unittests.cfg rename to guest/powerpc/unittests.cfg diff --git a/run_tests.sh b/guest/run_tests.sh similarity index 100% rename from run_tests.sh rename to guest/run_tests.sh diff --git a/s390x/Makefile b/guest/s390x/Makefile similarity index 100% rename from s390x/Makefile rename to guest/s390x/Makefile diff --git a/s390x/cmm.c b/guest/s390x/cmm.c similarity index 100% rename from s390x/cmm.c rename to guest/s390x/cmm.c diff --git a/s390x/cstart64.S b/guest/s390x/cstart64.S similarity index 100% rename from s390x/cstart64.S rename to guest/s390x/cstart64.S diff --git a/s390x/diag10.c b/guest/s390x/diag10.c similarity index 100% rename from s390x/diag10.c rename to guest/s390x/diag10.c diff --git a/s390x/emulator.c b/guest/s390x/emulator.c similarity index 100% rename from s390x/emulator.c rename to guest/s390x/emulator.c diff --git a/s390x/flat.lds b/guest/s390x/flat.lds similarity index 100% rename from s390x/flat.lds rename to guest/s390x/flat.lds diff --git a/s390x/gs.c b/guest/s390x/gs.c similarity index 100% rename from s390x/gs.c rename to guest/s390x/gs.c diff --git a/s390x/iep.c b/guest/s390x/iep.c similarity index 100% rename from s390x/iep.c rename to guest/s390x/iep.c diff --git a/s390x/intercept.c b/guest/s390x/intercept.c similarity index 100% rename from s390x/intercept.c rename to guest/s390x/intercept.c diff --git a/s390x/pfmf.c b/guest/s390x/pfmf.c similarity index 100% rename from s390x/pfmf.c rename to guest/s390x/pfmf.c diff --git a/s390x/run b/guest/s390x/run similarity index 100% rename from s390x/run rename to guest/s390x/run diff --git a/s390x/selftest.c b/guest/s390x/selftest.c similarity index 100% rename from s390x/selftest.c rename to guest/s390x/selftest.c diff --git a/s390x/sieve.c b/guest/s390x/sieve.c similarity index 100% rename from s390x/sieve.c rename to guest/s390x/sieve.c diff --git a/s390x/skey.c b/guest/s390x/skey.c similarity index 100% rename from s390x/skey.c rename to guest/s390x/skey.c diff --git a/s390x/sthyi.c b/guest/s390x/sthyi.c similarity index 100% rename from s390x/sthyi.c rename to guest/s390x/sthyi.c diff --git a/s390x/sthyi.h b/guest/s390x/sthyi.h similarity index 100% rename from s390x/sthyi.h rename to guest/s390x/sthyi.h diff --git a/s390x/unittests.cfg b/guest/s390x/unittests.cfg similarity index 100% rename from s390x/unittests.cfg rename to guest/s390x/unittests.cfg diff --git a/s390x/vector.c b/guest/s390x/vector.c similarity index 100% rename from s390x/vector.c rename to guest/s390x/vector.c diff --git a/scripts/arch-run.bash b/guest/scripts/arch-run.bash similarity index 100% rename from scripts/arch-run.bash rename to guest/scripts/arch-run.bash diff --git a/scripts/asm-offsets.mak b/guest/scripts/asm-offsets.mak similarity index 100% rename from scripts/asm-offsets.mak rename to guest/scripts/asm-offsets.mak diff --git a/scripts/common.bash b/guest/scripts/common.bash similarity index 100% rename from scripts/common.bash rename to guest/scripts/common.bash diff --git a/scripts/git.difforder b/guest/scripts/git.difforder similarity index 100% rename from scripts/git.difforder rename to guest/scripts/git.difforder diff --git a/scripts/mkstandalone.sh b/guest/scripts/mkstandalone.sh similarity index 100% rename from scripts/mkstandalone.sh rename to guest/scripts/mkstandalone.sh diff --git a/scripts/pretty_print_stacks.py b/guest/scripts/pretty_print_stacks.py similarity index 100% rename from scripts/pretty_print_stacks.py rename to guest/scripts/pretty_print_stacks.py diff --git a/scripts/runtime.bash b/guest/scripts/runtime.bash similarity index 100% rename from scripts/runtime.bash rename to guest/scripts/runtime.bash diff --git a/x86/Makefile b/guest/x86/Makefile similarity index 100% rename from x86/Makefile rename to guest/x86/Makefile diff --git a/x86/Makefile.common b/guest/x86/Makefile.common similarity index 100% rename from x86/Makefile.common rename to guest/x86/Makefile.common diff --git a/x86/Makefile.i386 b/guest/x86/Makefile.i386 similarity index 100% rename from x86/Makefile.i386 rename to guest/x86/Makefile.i386 diff --git a/x86/Makefile.x86_64 b/guest/x86/Makefile.x86_64 similarity index 100% rename from x86/Makefile.x86_64 rename to guest/x86/Makefile.x86_64 diff --git a/x86/README b/guest/x86/README similarity index 100% rename from x86/README rename to guest/x86/README diff --git a/x86/access.c b/guest/x86/access.c similarity index 100% rename from x86/access.c rename to guest/x86/access.c diff --git a/x86/apic.c b/guest/x86/apic.c similarity index 100% rename from x86/apic.c rename to guest/x86/apic.c diff --git a/x86/asyncpf.c b/guest/x86/asyncpf.c similarity index 100% rename from x86/asyncpf.c rename to guest/x86/asyncpf.c diff --git a/x86/cmpxchg8b.c b/guest/x86/cmpxchg8b.c similarity index 100% rename from x86/cmpxchg8b.c rename to guest/x86/cmpxchg8b.c diff --git a/x86/cstart.S b/guest/x86/cstart.S similarity index 100% rename from x86/cstart.S rename to guest/x86/cstart.S diff --git a/x86/cstart64.S b/guest/x86/cstart64.S similarity index 100% rename from x86/cstart64.S rename to guest/x86/cstart64.S diff --git a/x86/debug.c b/guest/x86/debug.c similarity index 100% rename from x86/debug.c rename to guest/x86/debug.c diff --git a/x86/emulator.c b/guest/x86/emulator.c similarity index 100% rename from x86/emulator.c rename to guest/x86/emulator.c diff --git a/x86/eventinj.c b/guest/x86/eventinj.c similarity index 100% rename from x86/eventinj.c rename to guest/x86/eventinj.c diff --git a/x86/flat.lds b/guest/x86/flat.lds similarity index 100% rename from x86/flat.lds rename to guest/x86/flat.lds diff --git a/x86/hypercall.c b/guest/x86/hypercall.c similarity index 100% rename from x86/hypercall.c rename to guest/x86/hypercall.c diff --git a/x86/hyperv.c b/guest/x86/hyperv.c similarity index 100% rename from x86/hyperv.c rename to guest/x86/hyperv.c diff --git a/x86/hyperv.h b/guest/x86/hyperv.h similarity index 100% rename from x86/hyperv.h rename to guest/x86/hyperv.h diff --git a/x86/hyperv_clock.c b/guest/x86/hyperv_clock.c similarity index 100% rename from x86/hyperv_clock.c rename to guest/x86/hyperv_clock.c diff --git a/x86/hyperv_connections.c b/guest/x86/hyperv_connections.c similarity index 100% rename from x86/hyperv_connections.c rename to guest/x86/hyperv_connections.c diff --git a/x86/hyperv_stimer.c b/guest/x86/hyperv_stimer.c similarity index 100% rename from x86/hyperv_stimer.c rename to guest/x86/hyperv_stimer.c diff --git a/x86/hyperv_synic.c b/guest/x86/hyperv_synic.c similarity index 100% rename from x86/hyperv_synic.c rename to guest/x86/hyperv_synic.c diff --git a/x86/idt_test.c b/guest/x86/idt_test.c similarity index 100% rename from x86/idt_test.c rename to guest/x86/idt_test.c diff --git a/x86/init.c b/guest/x86/init.c similarity index 100% rename from x86/init.c rename to guest/x86/init.c diff --git a/x86/intel-iommu.c b/guest/x86/intel-iommu.c similarity index 100% rename from x86/intel-iommu.c rename to guest/x86/intel-iommu.c diff --git a/x86/ioapic.c b/guest/x86/ioapic.c similarity index 100% rename from x86/ioapic.c rename to guest/x86/ioapic.c diff --git a/x86/ioram.h b/guest/x86/ioram.h similarity index 100% rename from x86/ioram.h rename to guest/x86/ioram.h diff --git a/x86/kvmclock.c b/guest/x86/kvmclock.c similarity index 100% rename from x86/kvmclock.c rename to guest/x86/kvmclock.c diff --git a/x86/kvmclock.h b/guest/x86/kvmclock.h similarity index 100% rename from x86/kvmclock.h rename to guest/x86/kvmclock.h diff --git a/x86/kvmclock_test.c b/guest/x86/kvmclock_test.c similarity index 100% rename from x86/kvmclock_test.c rename to guest/x86/kvmclock_test.c diff --git a/x86/memory.c b/guest/x86/memory.c similarity index 100% rename from x86/memory.c rename to guest/x86/memory.c diff --git a/x86/msr.c b/guest/x86/msr.c similarity index 100% rename from x86/msr.c rename to guest/x86/msr.c diff --git a/x86/pcid.c b/guest/x86/pcid.c similarity index 100% rename from x86/pcid.c rename to guest/x86/pcid.c diff --git a/x86/pku.c b/guest/x86/pku.c similarity index 100% rename from x86/pku.c rename to guest/x86/pku.c diff --git a/x86/pmu.c b/guest/x86/pmu.c similarity index 100% rename from x86/pmu.c rename to guest/x86/pmu.c diff --git a/x86/port80.c b/guest/x86/port80.c similarity index 100% rename from x86/port80.c rename to guest/x86/port80.c diff --git a/x86/realmode.c b/guest/x86/realmode.c similarity index 100% rename from x86/realmode.c rename to guest/x86/realmode.c diff --git a/x86/realmode.lds b/guest/x86/realmode.lds similarity index 100% rename from x86/realmode.lds rename to guest/x86/realmode.lds diff --git a/x86/rmap_chain.c b/guest/x86/rmap_chain.c similarity index 100% rename from x86/rmap_chain.c rename to guest/x86/rmap_chain.c diff --git a/x86/run b/guest/x86/run similarity index 100% rename from x86/run rename to guest/x86/run diff --git a/x86/s3.c b/guest/x86/s3.c similarity index 100% rename from x86/s3.c rename to guest/x86/s3.c diff --git a/x86/setjmp.c b/guest/x86/setjmp.c similarity index 100% rename from x86/setjmp.c rename to guest/x86/setjmp.c diff --git a/x86/sieve.c b/guest/x86/sieve.c similarity index 100% rename from x86/sieve.c rename to guest/x86/sieve.c diff --git a/x86/smap.c b/guest/x86/smap.c similarity index 100% rename from x86/smap.c rename to guest/x86/smap.c diff --git a/x86/smptest.c b/guest/x86/smptest.c similarity index 100% rename from x86/smptest.c rename to guest/x86/smptest.c diff --git a/x86/svm.c b/guest/x86/svm.c similarity index 100% rename from x86/svm.c rename to guest/x86/svm.c diff --git a/x86/svm.h b/guest/x86/svm.h similarity index 100% rename from x86/svm.h rename to guest/x86/svm.h diff --git a/x86/syscall.c b/guest/x86/syscall.c similarity index 100% rename from x86/syscall.c rename to guest/x86/syscall.c diff --git a/x86/taskswitch.c b/guest/x86/taskswitch.c similarity index 100% rename from x86/taskswitch.c rename to guest/x86/taskswitch.c diff --git a/x86/taskswitch2.c b/guest/x86/taskswitch2.c similarity index 100% rename from x86/taskswitch2.c rename to guest/x86/taskswitch2.c diff --git a/x86/tsc.c b/guest/x86/tsc.c similarity index 100% rename from x86/tsc.c rename to guest/x86/tsc.c diff --git a/x86/tsc_adjust.c b/guest/x86/tsc_adjust.c similarity index 100% rename from x86/tsc_adjust.c rename to guest/x86/tsc_adjust.c diff --git a/x86/tscdeadline_latency.c b/guest/x86/tscdeadline_latency.c similarity index 100% rename from x86/tscdeadline_latency.c rename to guest/x86/tscdeadline_latency.c diff --git a/x86/types.h b/guest/x86/types.h similarity index 100% rename from x86/types.h rename to guest/x86/types.h diff --git a/x86/umip.c b/guest/x86/umip.c similarity index 100% rename from x86/umip.c rename to guest/x86/umip.c diff --git a/x86/unittests.cfg b/guest/x86/unittests.cfg similarity index 100% rename from x86/unittests.cfg rename to guest/x86/unittests.cfg diff --git a/x86/vmexit.c b/guest/x86/vmexit.c similarity index 100% rename from x86/vmexit.c rename to guest/x86/vmexit.c diff --git a/x86/vmware_backdoors.c b/guest/x86/vmware_backdoors.c similarity index 100% rename from x86/vmware_backdoors.c rename to guest/x86/vmware_backdoors.c diff --git a/x86/vmx.c b/guest/x86/vmx.c similarity index 100% rename from x86/vmx.c rename to guest/x86/vmx.c diff --git a/x86/vmx.h b/guest/x86/vmx.h similarity index 100% rename from x86/vmx.h rename to guest/x86/vmx.h diff --git a/x86/vmx_tests.c b/guest/x86/vmx_tests.c similarity index 100% rename from x86/vmx_tests.c rename to guest/x86/vmx_tests.c diff --git a/x86/xsave.c b/guest/x86/xsave.c similarity index 100% rename from x86/xsave.c rename to guest/x86/xsave.c diff --git a/lib/arm/asm/asm-offsets.h b/lib/arm/asm/asm-offsets.h deleted file mode 100644 index d370ee3..0000000 --- a/lib/arm/asm/asm-offsets.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/lib/arm64/asm/asm-offsets.h b/lib/arm64/asm/asm-offsets.h deleted file mode 100644 index d370ee3..0000000 --- a/lib/arm64/asm/asm-offsets.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/lib/generated/.gitignore b/lib/generated/.gitignore deleted file mode 100644 index 72e8ffc..0000000 --- a/lib/generated/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/lib/ppc64/asm/asm-offsets.h b/lib/ppc64/asm/asm-offsets.h deleted file mode 100644 index d370ee3..0000000 --- a/lib/ppc64/asm/asm-offsets.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/lib/s390x/asm/asm-offsets.h b/lib/s390x/asm/asm-offsets.h deleted file mode 100644 index a6d7af8..0000000 --- a/lib/s390x/asm/asm-offsets.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) 2017 Red Hat Inc - * - * Authors: - * David Hildenbrand - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU Library General Public License version 2. - */ -#include From 23cad73f87ee38d7ae40f30803e97356e0f6c2e6 Mon Sep 17 00:00:00 2001 From: Yin Fengwei Date: Tue, 30 Oct 2018 10:03:36 +0800 Subject: [PATCH 06/18] acrn-unit-test: add README/COPYRIGHT Signed-off-by: Yin Fengwei --- COPYRIGHT | 5 +++++ README | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 COPYRIGHT create mode 100644 README diff --git a/COPYRIGHT b/COPYRIGHT new file mode 100644 index 0000000..2cc47a9 --- /dev/null +++ b/COPYRIGHT @@ -0,0 +1,5 @@ +There are two parts unit-test: + - guest based unit test. This is inherited from kvm-unit-test and inherit the kvm-unit-test + license. + - host base unit test. This is free software and can be redistributed and/or modified under + BSD license. diff --git a/README b/README new file mode 100644 index 0000000..44fc4e5 --- /dev/null +++ b/README @@ -0,0 +1,3 @@ +This is the unit-test for ACRN project. We have two type of unit-test: + - guest side. The unit-test will be run as a ACRN guest + - host side. The uni-test will be run at ACRN host side. From 6e5c23d33c7d0c0d200401d3fcd191c7a3a685d9 Mon Sep 17 00:00:00 2001 From: Yin Fengwei Date: Tue, 4 Dec 2018 15:44:11 +0800 Subject: [PATCH 07/18] acrn-unit-test: Enable 2 cpu core in guest testing. So we could test the smp related operations. Signed-off-by: Yin Fengwei --- guest/lib/x86/fwcfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guest/lib/x86/fwcfg.c b/guest/lib/x86/fwcfg.c index 4ead167..b175266 100644 --- a/guest/lib/x86/fwcfg.c +++ b/guest/lib/x86/fwcfg.c @@ -41,5 +41,5 @@ uint64_t fwcfg_get_u64(unsigned index) unsigned fwcfg_get_nb_cpus(void) { - return 1; + return 2; } From 73efe103968986b932c46edf1c599eb38463bf73 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Sat, 2 Feb 2019 16:05:29 +0800 Subject: [PATCH 08/18] bugfix: cstart64: update selectors after switching GDT on BSP There is no guarantee on the exact values in the selectors of data segments, including DS, ES, FS, GS and SS, at the time an OS is invoked, according to Section 3.2, Multiboot Specification 0.6.96. Not re-initializing the selectors can lead to segmentation faults the first time a reload of segment base address is needed. Signed-off-by: Junjie Mao --- guest/x86/cstart64.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/guest/x86/cstart64.S b/guest/x86/cstart64.S index f220b4e..fc6e815 100644 --- a/guest/x86/cstart64.S +++ b/guest/x86/cstart64.S @@ -148,6 +148,12 @@ switch_to_5level: prepare_64: lgdt gdt64_desc + mov $0x10, %ax + mov %ax, %ds + mov %ax, %es + mov %ax, %fs + mov %ax, %gs + mov %ax, %ss enter_long_mode: mov %cr4, %eax From 3bda028ea35da3bd5c89e5d86ea5e8cb868a6e24 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Wed, 9 Jan 2019 13:16:33 +0800 Subject: [PATCH 09/18] cstart: initialize .bss The initialization of .bss is available only when the test is loaded by an ELF loader, which is not the case when it is started directly by a multiboot-compliant bootloader. This patch explicitly clears .bss, except the stack which is already in use when initializing .bss. Signed-off-by: Junjie Mao --- guest/lib/x86/setup.c | 6 ++++++ guest/x86/cstart64.S | 3 ++- guest/x86/flat.lds | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/guest/lib/x86/setup.c b/guest/lib/x86/setup.c index ff7c8d3..d445005 100644 --- a/guest/lib/x86/setup.c +++ b/guest/lib/x86/setup.c @@ -9,6 +9,7 @@ #include "fwcfg.h" #include "alloc_phys.h" +extern char bss_start; extern char edata; struct mbi_bootinfo { @@ -42,6 +43,11 @@ u32 initrd_size; static char env[ENV_SIZE]; +void bss_init(void) +{ + memset(&bss_start, 0, &edata - &bss_start); +} + void setup_multiboot(struct mbi_bootinfo *bootinfo) { struct mbi_module *mods; diff --git a/guest/x86/cstart64.S b/guest/x86/cstart64.S index fc6e815..0aaffea 100644 --- a/guest/x86/cstart64.S +++ b/guest/x86/cstart64.S @@ -12,7 +12,7 @@ ipi_vector = 0x20 max_cpus = 64 -.bss +.section stack . = . + 4096 * max_cpus .align 16 @@ -226,6 +226,7 @@ ap_start64: jmp 1b start64: + call bss_init call load_tss call mask_pic_interrupts call enable_apic diff --git a/guest/x86/flat.lds b/guest/x86/flat.lds index a278b56..d2d9b00 100644 --- a/guest/x86/flat.lds +++ b/guest/x86/flat.lds @@ -13,6 +13,9 @@ SECTIONS . = ALIGN(16); .rodata : { *(.rodata) } . = ALIGN(16); + .stack : { *(stack) } + . = ALIGN(16); + bss_start = .; .bss : { *(.bss) } . = ALIGN(4K); edata = .; From 3896eab277a8ee989fa7f0981013c7be36861087 Mon Sep 17 00:00:00 2001 From: Huihuang Shi Date: Tue, 2 Apr 2019 16:46:12 +0800 Subject: [PATCH 10/18] setting esp to init stack fix bug because of cstart.S not init esp. Signed-off-by: Huihuang Shi --- guest/x86/cstart.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guest/x86/cstart.S b/guest/x86/cstart.S index deb8cb5..fc97c44 100644 --- a/guest/x86/cstart.S +++ b/guest/x86/cstart.S @@ -94,13 +94,13 @@ MSR_GS_BASE = 0xc0000101 .globl start start: + mov $stacktop, %esp push %ebx call setup_multiboot call setup_libcflat mov mb_cmdline(%ebx), %eax mov %eax, __args call __setup_args - mov $stacktop, %esp setup_percpu_area call prepare_32 jmpl $8, $start32 From 4449b8c30c9f750c093edb0973e0bb3b8682b130 Mon Sep 17 00:00:00 2001 From: nwang Date: Thu, 4 Apr 2019 07:02:15 +0800 Subject: [PATCH 11/18] fix byg of cstart.S which didn't initialize ds/es/fs/gs/ss --- guest/x86/cstart.S | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/guest/x86/cstart.S b/guest/x86/cstart.S index deb8cb5..7819e19 100644 --- a/guest/x86/cstart.S +++ b/guest/x86/cstart.S @@ -94,13 +94,13 @@ MSR_GS_BASE = 0xc0000101 .globl start start: + mov $stacktop, %esp push %ebx call setup_multiboot call setup_libcflat mov mb_cmdline(%ebx), %eax mov %eax, __args call __setup_args - mov $stacktop, %esp setup_percpu_area call prepare_32 jmpl $8, $start32 @@ -145,6 +145,12 @@ ap_start32: jmp 1b start32: + mov $0x10, %ax + mov %ax, %ds + mov %ax, %es + mov %ax, %fs + mov %ax, %gs + mov %ax, %ss call load_tss call mask_pic_interrupts call enable_apic From d5def37ff0552df870d2102a516b54833f93abe5 Mon Sep 17 00:00:00 2001 From: yuandengliang Date: Fri, 26 Apr 2019 17:28:26 +0800 Subject: [PATCH 12/18] reset tss_desc to default value --- guest/x86/cstart64.S | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 guest/x86/cstart64.S diff --git a/guest/x86/cstart64.S b/guest/x86/cstart64.S old mode 100644 new mode 100755 index f220b4e..57aad4c --- a/guest/x86/cstart64.S +++ b/guest/x86/cstart64.S @@ -263,6 +263,10 @@ load_tss: shr $24, %eax mov %eax, %ebx shl $4, %ebx + movl $0, tss_descr+8(%rbx) + movl $0, tss_descr+12(%rbx) + movl $0x00008900, tss_descr+4(%rbx) + movl $0x0000ffff, tss_descr(%rbx) mov $((tss_end - tss) / max_cpus), %edx imul %edx add $tss, %rax From e545def1e985a9f7ce2b4eedf688b6359722681b Mon Sep 17 00:00:00 2001 From: yuandengliang Date: Fri, 26 Apr 2019 17:30:11 +0800 Subject: [PATCH 13/18] reset tss_desc to default value --- guest/x86/cstart.S | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 guest/x86/cstart.S diff --git a/guest/x86/cstart.S b/guest/x86/cstart.S old mode 100644 new mode 100755 index 7819e19..a36f1a4 --- a/guest/x86/cstart.S +++ b/guest/x86/cstart.S @@ -172,6 +172,10 @@ load_tss: shr $24, %eax mov %eax, %ebx shl $3, %ebx + movl $0, tss_descr+8(%ebx) + movl $0, tss_descr+12(%ebx) + movl $0x00008900, tss_descr+4(%ebx) + movl $0x0000ffff, tss_descr(%ebx) mov $((tss_end - tss) / max_cpus), %edx imul %edx add $tss, %eax From 73d9c8a9d4119f3013725b703a482854a00110ec Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Wed, 9 Jan 2019 13:13:17 +0800 Subject: [PATCH 14/18] Makefile: generate raw binaries which can be loaded directly Raw binaries can be used as a multiboot module passed to ACRN hypervisor by the physical bootloader. This allows the hypervisor to load a unit test without additional logic for loading ELF files. v1 -> v2: * Do not rely on the code starting at exact 4M. Instead prepending zeros at the beginning of the image to locate the code right at the position decided at link-time. Due to the impreciseness of stext, the starting address of .text section is used as the beginning of the image. Signed-off-by: Junjie Mao --- .gitignore | 1 + guest/x86/Makefile.common | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2405a80..c4d4f7a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.o *.flat *.elf +*.raw .pc patches .stgit-* diff --git a/guest/x86/Makefile.common b/guest/x86/Makefile.common index e612dbe..72249f0 100644 --- a/guest/x86/Makefile.common +++ b/guest/x86/Makefile.common @@ -35,7 +35,7 @@ KEEP_FRAME_POINTER := y libgcc := $(shell $(CC) -m$(bits) --print-libgcc-file-name) -# We want to keep intermediate file: %.elf and %.o +# We want to keep intermediate file: %.elf and %.o .PRECIOUS: %.elf %.o FLATLIBS = lib/libcflat.a $(libgcc) @@ -48,6 +48,13 @@ FLATLIBS = lib/libcflat.a $(libgcc) $(OBJCOPY) -O elf32-i386 $^ $@ @chmod a-x $@ +%.raw: %.elf + $(OBJCOPY) -O binary $^ $@.tmp + dd if=/dev/zero of=$@ bs=1 count=$(shell echo $$((0x`readelf -S $< | grep "\.text" | grep -E -o "[0-9a-f]{16}"` - 0x400000))) + dd if=$@.tmp of=$@ conv=notrunc oflag=append + @rm $@.tmp + @chmod a-x $@ + tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \ $(TEST_DIR)/smptest.flat $(TEST_DIR)/port80.flat \ $(TEST_DIR)/realmode.flat $(TEST_DIR)/msr.flat \ From a76b9f628addf43ec16caaa16122710d4f5c18b1 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Sun, 3 Feb 2019 11:15:58 +0800 Subject: [PATCH 15/18] intel-iommu: rename to intel_iommu When stitching multiple tests into a single executable, names of the test files will be used in function identifiers which cannot contain any dash. Signed-off-by: Junjie Mao --- guest/x86/Makefile.x86_64 | 2 +- guest/x86/{intel-iommu.c => intel_iommu.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename guest/x86/{intel-iommu.c => intel_iommu.c} (100%) diff --git a/guest/x86/Makefile.x86_64 b/guest/x86/Makefile.x86_64 index 51f9b80..24e7b01 100644 --- a/guest/x86/Makefile.x86_64 +++ b/guest/x86/Makefile.x86_64 @@ -17,7 +17,7 @@ tests += $(TEST_DIR)/syscall.flat tests += $(TEST_DIR)/svm.flat tests += $(TEST_DIR)/vmx.flat tests += $(TEST_DIR)/tscdeadline_latency.flat -tests += $(TEST_DIR)/intel-iommu.flat +tests += $(TEST_DIR)/intel_iommu.flat tests += $(TEST_DIR)/vmware_backdoors.flat include $(SRCDIR)/$(TEST_DIR)/Makefile.common diff --git a/guest/x86/intel-iommu.c b/guest/x86/intel_iommu.c similarity index 100% rename from guest/x86/intel-iommu.c rename to guest/x86/intel_iommu.c From 234774c477ea0ffec18a74e244f693f3ad2aabc3 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Sun, 3 Feb 2019 11:19:21 +0800 Subject: [PATCH 16/18] make: stitch all tests together Having each test as a separate binary can easily lead to the explosion of file numbers, considering the number of cases that will be written for thorough testing. This also leads to difficulties for running multiple tests in a partition-mode configuration where guest binaries are always loaded by the physical bootloader. This patch introduces a 2-phase link approach to allow the tests to be linked in either one-per-test or all-in-one. The trick behind the scene is that sources of each test are first compiled and linked before the following object-level modifications are conducted. 1. All symbols are converted local, except the function main(). 2. The symbol main() is duplicated to main_() which has global linkage. 3. The symbol main() is converted weak global. The edited object files are named following the convention _prelink.o. Each of them can be compiled with the other libraries to generate an executable ELF, as is done previously, or linked together to generate one stitched executable that contains all tests indexed by the generated case_table.c. Signed-off-by: Junjie Mao --- guest/Makefile | 2 ++ guest/scripts/mkcasetable.sh | 30 ++++++++++++++++++++++++++++ guest/x86/.gitignore | 1 + guest/x86/Makefile.common | 38 +++++++++++++++++++++++++++++------- guest/x86/Makefile.x86_64 | 5 +---- guest/x86/stitched.c | 33 +++++++++++++++++++++++++++++++ guest/x86/stitched.h | 13 ++++++++++++ 7 files changed, 111 insertions(+), 11 deletions(-) create mode 100755 guest/scripts/mkcasetable.sh create mode 100644 guest/x86/.gitignore create mode 100644 guest/x86/stitched.c create mode 100644 guest/x86/stitched.h diff --git a/guest/Makefile b/guest/Makefile index 05d8133..c91385a 100644 --- a/guest/Makefile +++ b/guest/Makefile @@ -101,6 +101,8 @@ all: directories $(shell cd $(SRCDIR) && git rev-parse --verify --short=8 HEAD > standalone: all @scripts/mkstandalone.sh +stitched: $(TEST_DIR)/stitched.raw + install: standalone mkdir -p $(DESTDIR) install tests/* $(DESTDIR) diff --git a/guest/scripts/mkcasetable.sh b/guest/scripts/mkcasetable.sh new file mode 100755 index 0000000..b940c43 --- /dev/null +++ b/guest/scripts/mkcasetable.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +output=$1 +shift 1 + +cat < $output +#include "stitched.h" + +EOF + +IFS=$'\n' tests=($(sort <<< "$*")) +unset IFS + +for test in ${tests[*]}; do + echo "extern int main_$test(int ac, char **av);" >> $output +done + +cat <> $output + +struct unit_test unit_tests[] = { +EOF + +for test in ${tests[*]}; do + echo "{ .name = \"$test\", .fn = main_$test }," >> $output +done + +cat <> $output +{ .name = NULL, .fn = NULL }, +}; +EOF diff --git a/guest/x86/.gitignore b/guest/x86/.gitignore new file mode 100644 index 0000000..93a8bea --- /dev/null +++ b/guest/x86/.gitignore @@ -0,0 +1 @@ +case_table.c \ No newline at end of file diff --git a/guest/x86/Makefile.common b/guest/x86/Makefile.common index 72249f0..c1da835 100644 --- a/guest/x86/Makefile.common +++ b/guest/x86/Makefile.common @@ -36,10 +36,10 @@ KEEP_FRAME_POINTER := y libgcc := $(shell $(CC) -m$(bits) --print-libgcc-file-name) # We want to keep intermediate file: %.elf and %.o -.PRECIOUS: %.elf %.o +.PRECIOUS: %.elf %.o $(TEST_DIR)/%_prelink.o FLATLIBS = lib/libcflat.a $(libgcc) -%.elf: %.o $(FLATLIBS) $(SRCDIR)/x86/flat.lds $(cstart.o) +%.elf: %_prelink.o $(FLATLIBS) $(SRCDIR)/x86/flat.lds $(cstart.o) $(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,$(SRCDIR)/x86/flat.lds \ $(filter %.o, $^) $(FLATLIBS) @chmod a-x $@ @@ -75,6 +75,27 @@ endif test_cases: $(tests-common) $(tests) $(tests-api) +unstitched-test-cases = $(TEST_DIR)/realmode.flat +stitched-test-cases = $(filter-out $(unstitched-test-cases),$(tests-common) $(tests)) +case_table.o = $(TEST_DIR)/case_table.o +stitched.o = $(TEST_DIR)/stitched.o + +$(case_table.o:.o=.c): + scripts/mkcasetable.sh $@ $(patsubst $(TEST_DIR)/%.flat,%,$(stitched-test-cases)) + +$(TEST_DIR)/stitched.elf: $(stitched-test-cases:.flat=_prelink.o) $(FLATLIBS) $(SRCDIR)/x86/flat.lds $(cstart.o) $(case_table.o) $(stitched.o) + $(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,$(SRCDIR)/x86/flat.lds \ + $(filter %.o, $^) $(FLATLIBS) + @chmod a-x $@ + +$(TEST_DIR)/%_prelink.o: $(TEST_DIR)/%.o + $(LD) -r -o $@ $^ + @$(OBJCOPY) \ + --keep-global-symbol=main \ + --add-symbol main_$*=.text:0x`nm $@ | grep "T main" | egrep -o "[0-9a-f]{16}"`,function,global \ + --weaken-symbol=main \ + $@ + $(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I $(SRCDIR)/lib -I $(SRCDIR)/lib/x86 -I lib $(TEST_DIR)/realmode.elf: $(TEST_DIR)/realmode.o @@ -82,18 +103,21 @@ $(TEST_DIR)/realmode.elf: $(TEST_DIR)/realmode.o $(TEST_DIR)/realmode.o: bits = 32 -$(TEST_DIR)/kvmclock_test.elf: $(TEST_DIR)/kvmclock.o +$(TEST_DIR)/kvmclock_test_prelink.o: $(TEST_DIR)/kvmclock.o + +$(TEST_DIR)/hyperv_synic_prelink.o: $(TEST_DIR)/hyperv.o -$(TEST_DIR)/hyperv_synic.elf: $(TEST_DIR)/hyperv.o +$(TEST_DIR)/hyperv_stimer_prelink.o: $(TEST_DIR)/hyperv.o -$(TEST_DIR)/hyperv_stimer.elf: $(TEST_DIR)/hyperv.o +$(TEST_DIR)/hyperv_connections_prelink.o: $(TEST_DIR)/hyperv.o -$(TEST_DIR)/hyperv_connections.elf: $(TEST_DIR)/hyperv.o +$(TEST_DIR)/vmx_prelink.o: $(TEST_DIR)/vmx_tests.o arch_clean: $(RM) $(TEST_DIR)/*.o $(TEST_DIR)/*.flat $(TEST_DIR)/*.elf \ $(TEST_DIR)/.*.d lib/x86/.*.d \ - $(tests-api) api/*.o api/*.a api/.*.d + $(tests-api) api/*.o api/*.a api/.*.d \ + $(case_table.o:.o=.c) api/%.o: CXXFLAGS += -m32 -std=gnu++11 diff --git a/guest/x86/Makefile.x86_64 b/guest/x86/Makefile.x86_64 index 24e7b01..2540096 100644 --- a/guest/x86/Makefile.x86_64 +++ b/guest/x86/Makefile.x86_64 @@ -19,9 +19,6 @@ tests += $(TEST_DIR)/vmx.flat tests += $(TEST_DIR)/tscdeadline_latency.flat tests += $(TEST_DIR)/intel_iommu.flat tests += $(TEST_DIR)/vmware_backdoors.flat +tests += $(TEST_DIR)/hyperv_clock.flat include $(SRCDIR)/$(TEST_DIR)/Makefile.common - -$(TEST_DIR)/hyperv_clock.elf: $(TEST_DIR)/hyperv_clock.o - -$(TEST_DIR)/vmx.elf: $(TEST_DIR)/vmx_tests.o diff --git a/guest/x86/stitched.c b/guest/x86/stitched.c new file mode 100644 index 0000000..54e7111 --- /dev/null +++ b/guest/x86/stitched.c @@ -0,0 +1,33 @@ +#include "stitched.h" + +int main(int ac, char **av) +{ + struct unit_test *ut; + + if (ac > 0) { + ut = unit_tests; + while (ut->fn != NULL) { + if (strcmp(av[0], ut->name) == 0) { + printf("Run test %s\n", av[0]); + return ut->fn(ac, av); + } else { + ut++; + } + } + + printf("No test found for %s\n", av[0]); + } + + /* Print the list of available tests */ + printf("Available tests:\n"); + + ut = unit_tests; + while (ut->fn != NULL) { + printf("\t%s\n", ut->name); + ut++; + } + + printf("End of available tests\n"); + + return 0; +} diff --git a/guest/x86/stitched.h b/guest/x86/stitched.h new file mode 100644 index 0000000..fe4aa05 --- /dev/null +++ b/guest/x86/stitched.h @@ -0,0 +1,13 @@ +#ifndef __MAIN_H +#define __MAIN_H + +#include "libcflat.h" + +struct unit_test { + const char *name; + int (*fn)(int ac, char **av); +}; + +extern struct unit_test unit_tests[]; + +#endif From 94a8189d2cfa43eb0a24022f0357ad1500c25d00 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Sun, 28 Apr 2019 15:57:51 +0800 Subject: [PATCH 17/18] flat.lds: discard .comment and .note Compilers like gcc may place information like compiler versions, build IDs, etc. into dedicate sections called .comment or .note. These sections may be placed even before the entry point if the linker script does not specify how these sections shall be handled. This can be problematic as it is assumed that the beginning of the image is a 12-byte multiboot header, followed by the entry point of the image. It has also been met that ignoring these sections in the linker script leads to a very small bss_start (mostly <1K), which leads the test program to crash when it tries to initialize its .bss section. Discard these sections as these sections contain compiler/linker-specific information which is mostyl useless at runtime. Signed-off-by: Junjie Mao --- guest/x86/flat.lds | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/guest/x86/flat.lds b/guest/x86/flat.lds index d2d9b00..90d4fb0 100644 --- a/guest/x86/flat.lds +++ b/guest/x86/flat.lds @@ -19,6 +19,10 @@ SECTIONS .bss : { *(.bss) } . = ALIGN(4K); edata = .; + + /DISCARD/ : { + *(.comment .comment.* .note .note.*) + } } ENTRY(start) From bfacda930e279b7f4fcbfde2f7d3ef08b27e0443 Mon Sep 17 00:00:00 2001 From: Yi Sun Date: Thu, 30 May 2019 13:40:37 +0800 Subject: [PATCH 18/18] Tuned arguments of QEMU to fit for acrn-unit-test Added memory size (1G) and smp supported (4 cores). Specified the CPU model and some flags, which is supported by ACRN. Refined Makefile to run unit-test by command 'unit': 'make unit file=xxx' 'xxx' stands for case name, no extension followed. Signed-off-by: Yi Sun --- guest/Makefile | 3 +++ guest/x86/run | 3 +++ 2 files changed, 6 insertions(+) diff --git a/guest/Makefile b/guest/Makefile index c91385a..abfe2a7 100644 --- a/guest/Makefile +++ b/guest/Makefile @@ -125,3 +125,6 @@ cscope: find -L $(cscope_dirs) -maxdepth 1 \ -name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files cscope -bk + +unit: all + x86/run x86/$(file).flat diff --git a/guest/x86/run b/guest/x86/run index 1ac91f1..598eaa3 100755 --- a/guest/x86/run +++ b/guest/x86/run @@ -15,6 +15,8 @@ ACCEL=$(get_qemu_accelerator) || qemu=$(search_qemu_binary) || exit $? +cpu_info = Nehalem,+sse,+avx,+xsave,+sse2,+sse3,+mpx,+fpu,level=13 + if ! ${qemu} -device '?' 2>&1 | grep -F -e \"testdev\" -e \"pc-testdev\" > /dev/null; then echo "No Qemu test device support found" @@ -38,6 +40,7 @@ else fi command="${qemu} -nodefaults $pc_testdev -vnc none -serial stdio $pci_testdev" +command+=" -smp cpus=4 -m 1024M $cpu_info" command+=" -machine accel=$ACCEL -kernel" command="$(timeout_cmd) $command"