[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 0/4] mini-os: initial ARM support



Hi Thomas, all

Thank you,
it is very interesting for me since I am trying to port XEN stuff to embedded OS and using Mini-OS
as example.

I tried to run Mini-OS as domU and I got a hypervisor crash at an early initialization stage (

I took Mini-OS from github:
https://github.com/talex5/xen ("proposed" branch)
As I understand correctly this branch contains all necessary patches to build
and verify Mini-OS on ARM (I so have thought because the last 4 commits from this
branch correspond to patch series in current thread). Is it correct?

My configuration:
- hypervisor - XEN 4.4.0
- platform - ARM32
- dom0 - Linux Kernel 3.8
- domU - Mini-OS

/ # (d1) dtb_pointer : 87fff000
(XEN) Guest data abort: Translation fault at level 2
(XEN)ÂÂÂÂ gva=7002e65c
(XEN)ÂÂÂÂ gpa=000000007002e65c
(XEN)ÂÂÂÂ size=2 sign=0 write=0 reg=1
(XEN)ÂÂÂÂ eat=0 cm=0 s1ptw=0 dfsc=6
(XEN) dom1 IPA 0x000000007002e65c
(XEN) P2M @ 02840080 mfn:0xc2004
(XEN) 1ST[0x1] = 0x00400000c200367f
(XEN) 2ND[0x180] = 0x0000000000000000
(XEN) ----[ Xen-4.4.0 arm32 debug=y Not tainted ]----
(XEN) CPU:ÂÂÂ 0
(XEN) PC:ÂÂÂÂ 8000d14c
(XEN) CPSR:ÂÂ 600001d3 MODE:32-bit Guest SVC
(XEN)ÂÂÂÂÂ R0: 8001a22c R1: 8002b218 R2: 7002e65c R3: 7002e65c
(XEN)ÂÂÂÂÂ R4: 87fff000 R5: 00000000 R6: 00000000 R7: 00000000
(XEN)ÂÂÂÂÂ R8: 00000000 R9: 00000000 R10:00000000 R11:8001ff74 R12:deadbeef
(XEN) USR: SP: 00000000 LR: 00000000
(XEN) SVC: SP: 8001ff60 LR: 8000d468 SPSR:00000000
(XEN) ABT: SP: 00000000 LR: 00000000 SPSR:00000000
(XEN) UND: SP: 00000000 LR: 00000000 SPSR:00000000
(XEN) IRQ: SP: 00000000 LR: 00000000 SPSR:00000000
(XEN) FIQ: SP: 00000000 LR: c2c2c2c2 SPSR:00000000
(XEN) FIQ: R8: 00000000 R9: 00000000 R10:00000000 R11:00000000 R12:00000000
(XEN)
(XEN)ÂÂÂÂÂ SCTLR: 00c50078
(XEN)ÂÂÂÂÂÂÂ TCR: 00000000
(XEN)ÂÂÂÂÂ TTBR0: 0000000080024000
(XEN)ÂÂÂÂÂ TTBR1: 0000000000000000
(XEN)ÂÂÂÂÂÂ IFAR: 00000000, IFSR: 00000000
(XEN)ÂÂÂÂÂÂ DFAR: 00000000, DFSR: 00000000
(XEN)
(XEN)ÂÂ VTCR_EL2: 80002558
(XEN)Â VTTBR_EL2: 00020000c2004000
(XEN)
(XEN)Â SCTLR_EL2: 30cd187f
(XEN)ÂÂÂ HCR_EL2: 0000000000282835
(XEN)Â TTBR0_EL2: 00000000fecdf000
(XEN)
(XEN)ÂÂÂ ESR_EL2: 93810006
(XEN)Â HPFAR_EL2: 00000000007002e0
(XEN)ÂÂÂÂÂ HDFAR: 7002e65c
(XEN)ÂÂÂÂÂ HIFAR: 00000000
(XEN)
(XEN) Guest stack trace from sp=8001ff60:
(XEN)ÂÂÂ 8002b218 8001a22c 80019324 8002b218 c2c2c2c2 8001ff8c 8001ff38 00000000
(XEN)ÂÂÂ 80022230 000003ff 00000000 80022230 00000000 00000000 800175bc 00000001
(XEN)ÂÂÂ 00000001 00000000 00000003 000003ff 8001ffbc 80017604 8001ffcc 8000d728
(XEN)ÂÂÂ 8001fffc 8001792c 8001a22c 87fff000 ffffffff 8002820c 00000000 87fff000
(XEN)ÂÂÂ 00007ff0 00000000 00000000 00000000 00080022 00000000 00000000 80008038
(XEN) domain_crash_sync called from traps.c:1573
(XEN) Domain 1 (vcpu#0) crashed on cpu#0:
(XEN) ----[ Xen-4.4.0 arm32 debug=y Not tainted ]----
(XEN) CPU:ÂÂÂ 0
(XEN) PC:ÂÂÂÂ 8000d14c
(XEN) CPSR:ÂÂ 600001d3 MODE:32-bit Guest SVC
(XEN)ÂÂÂÂÂ R0: 8001a22c R1: 8002b218 R2: 7002e65c R3: 7002e65c
(XEN)ÂÂÂÂÂ R4: 87fff000 R5: 00000000 R6: 00000000 R7: 00000000
(XEN)ÂÂÂÂÂ R8: 00000000 R9: 00000000 R10:00000000 R11:8001ff74 R12:deadbeef
(XEN) USR: SP: 00000000 LR: 00000000
(XEN) SVC: SP: 8001ff60 LR: 8000d468 SPSR:00000000
(XEN) ABT: SP: 00000000 LR: 00000000 SPSR:00000000
(XEN) UND: SP: 00000000 LR: 00000000 SPSR:00000000
(XEN) IRQ: SP: 00000000 LR: 00000000 SPSR:00000000
(XEN) FIQ: SP: 00000000 LR: c2c2c2c2 SPSR:00000000
(XEN) FIQ: R8: 00000000 R9: 00000000 R10:00000000 R11:00000000 R12:00000000
(XEN)
(XEN)ÂÂÂÂÂ SCTLR: 00c50078
(XEN)ÂÂÂÂÂÂÂ TCR: 00000000
(XEN)ÂÂÂÂÂ TTBR0: 0000000080024000
(XEN)ÂÂÂÂÂ TTBR1: 0000000000000000
(XEN)ÂÂÂÂÂÂ IFAR: 00000000, IFSR: 00000000
(XEN)ÂÂÂÂÂÂ DFAR: 00000000, DFSR: 00000000
(XEN)
(XEN)ÂÂ VTCR_EL2: 80002558
(XEN)Â VTTBR_EL2: 00020000c2004000
(XEN)
(XEN)Â SCTLR_EL2: 30cd187f
(XEN)ÂÂÂ HCR_EL2: 0000000000282835
(XEN)Â TTBR0_EL2: 00000000fecdf000
(XEN)
(XEN)ÂÂÂ ESR_EL2: 93810006
(XEN)Â HPFAR_EL2: 00000000007002e0
(XEN)ÂÂÂÂÂ HDFAR: 7002e65c
(XEN)ÂÂÂÂÂ HIFAR: 00000000
(XEN)
(XEN) Guest stack trace from sp=8001ff60:
(XEN)ÂÂÂ 8002b218 8001a22c 80019324 8002b218 c2c2c2c2 8001ff8c 8001ff38 00000000
(XEN)ÂÂÂ 80022230 000003ff 00000000 80022230 00000000 00000000 800175bc 00000001
(XEN)ÂÂÂ 00000001 00000000 00000003 000003ff 8001ffbc 80017604 8001ffcc 8000d728
(XEN)ÂÂÂ 8001fffc 8001792c 8001a22c 87fff000 ffffffff 8002820c 00000000 87fff000
(XEN)ÂÂÂ 00007ff0 00000000 00000000 00000000 00080022 00000000 00000000 80008038
(XEN) mm.c:1192:d0 gnttab_mark_dirty not implemented yet

But the Mini-OS from "next" branch boots without crashes (I changed GIC addresses only):

diff --git a/extras/mini-os/drivers/gic.c b/extras/mini-os/drivers/gic.c
index 6b3fd93..ef567d2 100644
--- a/extras/mini-os/drivers/gic.c
+++ b/extras/mini-os/drivers/gic.c
@@ -184,6 +184,12 @@ void gic_init(void) {
ÂÂÂÂÂÂÂÂÂÂÂÂ }
ÂÂÂÂÂÂÂÂÂÂÂÂ gic.gicd_base = (char *) (long) fdt64_to_cpu(reg[0]);
ÂÂÂÂÂÂÂÂÂÂÂÂ gic.gicc_base = (char *) (long) fdt64_to_cpu(reg[2]);
+ÂÂÂÂÂÂÂÂÂÂÂ unsignedÂÂ cbar;
+ __asm__ __volatile__("mrc p15, 4, %0, c15, c0, 0" : "=r"(cbar));
+
+ÂÂÂÂÂÂÂÂÂÂÂ gic.gicd_base = (char *) (cbar + 0x1000);
+ÂÂÂÂÂÂÂÂÂÂÂ gic.gicc_base = (char *) (cbar + 0x2000);
+
ÂÂÂÂÂÂÂÂÂÂÂÂ printk("Found GIC: gicd_base = %p, gicc_base = %p\n", gic.gicd_base, gic.gicc_base);
ÂÂÂÂÂÂÂÂÂÂÂÂ break;
ÂÂÂÂÂÂÂÂ }


Also, could you, please, explain me some generic things about Mini-OS:
1. Is HAVE_LIBC a necessary config? I mean if I build Mini-OS without proper LIBC support will the Mini-OS to operate fully
(are there any restrictions?)
2. If yes, what should I do to build Mini-OS with proper LIBC support? Unfortunately, it is not clear for me.


On Mon, Jun 2, 2014 at 8:49 PM, Thomas Leonard <talex5@xxxxxxxxx> wrote:
This series is Karim's initial ARM support, broken up into smaller patches.
I removed some debug code from the patch, fixed it to work on x86 again,
and replaced memmove with a BSD-licensed version.

I also added a fix so that Mini-OS doesn't shut down immediately. This is
for x86 too, but I needed it because otherwise it's hard to test it.

It's probably not worth worrying too much about the ARM support itself (there
will be more patches coming shortly!) - the main thing is refactoring Mini-OS
to support the new architecture.

Karim Raslan (3):
 mini-os: Tidied up code
 mini-os: Initial commit to port minios to ARM
 mini-os: Added FDT support on ARM

Thomas Leonard (1):
 mini-os: Fixed shutdown thread

Âextras/mini-os/ARM-TODO.txt            Â|  19 +
Âextras/mini-os/COPYING Â Â Â Â Â Â Â Â Â Â Â Â Â Â | Â 27 +
Âextras/mini-os/Config.mk              |  Â2 +
Âextras/mini-os/Makefile              Â|  23 +
Âextras/mini-os/README Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â| Â Â7 +-
Âextras/mini-os/arch/arm/Makefile          |  33 +
Âextras/mini-os/arch/arm/arch.mk          Â|  Â6 +
Âextras/mini-os/arch/arm/arm32.S Â Â Â Â Â Â Â Â Â Â| Â211 +++
Âextras/mini-os/arch/arm/divsi3.S Â Â Â Â Â Â Â Â Â | Â404 ++++++
Âextras/mini-os/arch/arm/events.c          |  24 +
Âextras/mini-os/arch/arm/hypercalls32.S Â Â Â Â Â Â | Â 88 ++
Âextras/mini-os/arch/arm/ldivmod.S Â Â Â Â Â Â Â Â Â| Â 67 +
Âextras/mini-os/arch/arm/ldivmod_helper.c      |  66 +
Âextras/mini-os/arch/arm/minios-arm32.lds      |  73 +
Âextras/mini-os/arch/arm/mm.c            |  44 +
Âextras/mini-os/arch/arm/qdivrem.c         Â| Â270 ++++
Âextras/mini-os/arch/arm/sched.c          Â|  32 +
Âextras/mini-os/arch/arm/setup.c          Â|  55 +
Âextras/mini-os/arch/arm/time.c           | Â232 +++
Âextras/mini-os/arch/arm/xenbus.c          |  36 +
Âextras/mini-os/arch/x86/events.c          |  28 +
Âextras/mini-os/arch/x86/setup.c          Â|  44 +-
Âextras/mini-os/arch/x86/time.c           |  Â6 +-
Âextras/mini-os/arch/x86/x86_32.S Â Â Â Â Â Â Â Â Â | Â Â2 +-
Âextras/mini-os/arch/x86/x86_64.S Â Â Â Â Â Â Â Â Â | Â Â2 +-
Âextras/mini-os/arch/x86/xenbus.c          |  10 +
Âextras/mini-os/console/console.c          |  Â4 +-
Âextras/mini-os/drivers/gic.c            | Â179 +++
Âextras/mini-os/events.c              Â|  35 +-
Âextras/mini-os/gntmap.c              Â|  34 +-
Âextras/mini-os/gnttab.c              Â|  Â1 +
Âextras/mini-os/hypervisor.c            Â|  20 +-
Âextras/mini-os/include/arm/arch_limits.h      |  Â9 +
Âextras/mini-os/include/arm/arch_mm.h        |  37 +
Âextras/mini-os/include/arm/arch_sched.h      Â|  22 +
Âextras/mini-os/include/arm/arch_spinlock.h     |  49 +
Âextras/mini-os/include/arm/hypercall-arm32.h    | Â173 +++
Âextras/mini-os/include/arm/os.h          Â| Â314 +++++
Âextras/mini-os/include/arm/traps.h         |  20 +
Âextras/mini-os/include/console.h          |  Â1 +
Âextras/mini-os/include/fdt.h            |  60 +
Âextras/mini-os/include/hypervisor.h        Â|  19 +-
Âextras/mini-os/include/lib.h            |  Â4 +-
Âextras/mini-os/include/libfdt.h          Â| 1478 ++++++++++++++++++++
Âextras/mini-os/include/libfdt_env.h        Â|  37 +
Âextras/mini-os/include/mm.h            Â|  Â2 +
Âextras/mini-os/include/types.h           |  73 +-
Âextras/mini-os/include/x86/arch_mm.h        |  Â2 +
Âextras/mini-os/include/x86/arch_spinlock.h     |  Â2 +-
Âextras/mini-os/include/x86/os.h          Â|  19 +-
Â.../mini-os/include/x86/x86_64/hypercall-x86_64.h Â| Â Â1 +
Âextras/mini-os/kernel.c              Â|  94 +-
Âextras/mini-os/lib/fdt/fdt.c            | Â222 +++
Âextras/mini-os/lib/fdt/fdt_empty_tree.c      Â|  84 ++
Âextras/mini-os/lib/fdt/fdt_ro.c          Â| Â574 ++++++++
Âextras/mini-os/lib/fdt/fdt_rw.c          Â| Â492 +++++++
Âextras/mini-os/lib/fdt/fdt_strerror.c       Â|  96 ++
Âextras/mini-os/lib/fdt/fdt_sw.c          Â| Â256 ++++
Âextras/mini-os/lib/fdt/fdt_wip.c          | Â118 ++
Âextras/mini-os/lib/fdt/libfdt_internal.h      |  95 ++
Âextras/mini-os/lib/memmove.c            |  45 +
Âextras/mini-os/lib/string.c            Â|  12 +
Âextras/mini-os/main.c               Â|  Â2 +-
Âextras/mini-os/mm.c                Â|  Â9 +-
Âextras/mini-os/sched.c               |  12 +-
Âextras/mini-os/time.c               Â|  12 +
Âextras/mini-os/xenbus/xenbus.c           |  20 +-
Â67 files changed, 6410 insertions(+), 139 deletions(-)
Âcreate mode 100644 extras/mini-os/ARM-TODO.txt
Âcreate mode 100755 extras/mini-os/arch/arm/Makefile
Âcreate mode 100644 extras/mini-os/arch/arm/arch.mk
Âcreate mode 100644 extras/mini-os/arch/arm/arm32.S
Âcreate mode 100644 extras/mini-os/arch/arm/divsi3.S
Âcreate mode 100644 extras/mini-os/arch/arm/events.c
Âcreate mode 100644 extras/mini-os/arch/arm/hypercalls32.S
Âcreate mode 100644 extras/mini-os/arch/arm/ldivmod.S
Âcreate mode 100644 extras/mini-os/arch/arm/ldivmod_helper.c
Âcreate mode 100755 extras/mini-os/arch/arm/minios-arm32.lds
Âcreate mode 100644 extras/mini-os/arch/arm/mm.c
Âcreate mode 100644 extras/mini-os/arch/arm/qdivrem.c
Âcreate mode 100644 extras/mini-os/arch/arm/sched.c
Âcreate mode 100644 extras/mini-os/arch/arm/setup.c
Âcreate mode 100644 extras/mini-os/arch/arm/time.c
Âcreate mode 100644 extras/mini-os/arch/arm/xenbus.c
Âcreate mode 100644 extras/mini-os/arch/x86/events.c
Âcreate mode 100644 extras/mini-os/arch/x86/xenbus.c
Âcreate mode 100644 extras/mini-os/drivers/gic.c
Âcreate mode 100644 extras/mini-os/include/arm/arch_limits.h
Âcreate mode 100644 extras/mini-os/include/arm/arch_mm.h
Âcreate mode 100644 extras/mini-os/include/arm/arch_sched.h
Âcreate mode 100755 extras/mini-os/include/arm/arch_spinlock.h
Âcreate mode 100644 extras/mini-os/include/arm/hypercall-arm32.h
Âcreate mode 100644 extras/mini-os/include/arm/os.h
Âcreate mode 100644 extras/mini-os/include/arm/traps.h
Âcreate mode 100644 extras/mini-os/include/fdt.h
Âcreate mode 100644 extras/mini-os/include/libfdt.h
Âcreate mode 100644 extras/mini-os/include/libfdt_env.h
Âcreate mode 100644 extras/mini-os/lib/fdt/fdt.c
Âcreate mode 100644 extras/mini-os/lib/fdt/fdt_empty_tree.c
Âcreate mode 100644 extras/mini-os/lib/fdt/fdt_ro.c
Âcreate mode 100644 extras/mini-os/lib/fdt/fdt_rw.c
Âcreate mode 100644 extras/mini-os/lib/fdt/fdt_strerror.c
Âcreate mode 100644 extras/mini-os/lib/fdt/fdt_sw.c
Âcreate mode 100644 extras/mini-os/lib/fdt/fdt_wip.c
Âcreate mode 100644 extras/mini-os/lib/fdt/libfdt_internal.h
Âcreate mode 100644 extras/mini-os/lib/memmove.c
Âcreate mode 100644 extras/mini-os/time.c

--
1.9.3


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel



--

Oleksandr Tyshchenko | Embedded Dev
GlobalLogic
www.globallogic.com
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.