Skip to contentSkip to conversation

32-bit ARM guest on 64-bit ARM Xen

DISCUSSION Robert VanVossen 4 participants 7 messages Apr 28, 2015 – May 1, 2015

lore
Share & tools
lore
#0 lore raw

Hello,

I was wondering, what is the current state of running a 32-bit ARM guest running on a 64-bit Xen for ARM. I was working on getting the minios from
https://github.com/talex5/xen/commits/next built and running as a guest on an emulated Cortex-A53. I have gotten Xen and 64-bit Linux guests running in the emulated environment, but I ran into some issues with the 32-bit guests.

When I tried to run them, I got the following:

Parsing config from /etc/xen/mini.cfg
(XEN) Hypervisor Trap. HSR=0x2000000 EC=0x0 IL=1 Syndrome=0x0 (XEN) CPU0: Unexpected Trap: Hypervisor
(XEN) ----[ Xen-4.6-unstable arm64 debug=y Not tainted ]----

(XEN) CPU:    0
(XEN) PC:     00000000002413c8 schedule_tail+0x248/0x2dc
(XEN) LR:     0000000000241300
(XEN) SP:     000080003ef5fe80
(XEN) CPSR:   600003c9 MODE:64-bit EL2h (Hypervisor, handler)
(XEN)      X0: 0000000000000000  X1: 0000000000000000  X2: 0000000000000000
(XEN)      X3: 0000000000000000  X4: 0000000000000000  X5: 0000000000000008
(XEN)      X6: 0000000040011100  X7: 0000000000000000  X8: 000080003ef632e0
(XEN)      X9: 000080003ef5feb0 X10: 0000000100000000 X11: aea06b1800000000
(XEN)     X12: 000000000000007f X13: 2f3b52d000000000 X14: 0000000100000000
(XEN)     X15: 0000007fae98c598 X16: 0000000000000024 X17: 0000007fae908b50
(XEN)     X18: 0000007ffb53e170 X19: 000080003efdb000 X20: 000080003ef63000
(XEN)     X21: 0000000000000000 X22: 0000000000000000 X23: 0000000000000000
(XEN)     X24: 0000000000000000 X25: 0000000000000000 X26: 0000000000000000
(XEN)     X27: 0000000000000000 X28: 0000000000000000  FP: 000080003ef5fe80

(XEN)
(XEN) VTCR_EL2: 80023558
(XEN) VTTBR_EL2: 000200003ef66000
(XEN)
(XEN) SCTLR_EL2: 30cd187d
(XEN) HCR_EL2: 000000000038643f
(XEN) TTBR0_EL2: 000000003eef4000
(XEN)
(XEN) ESR_EL2: 02000000
(XEN) HPFAR_EL2: 0000000000f90100
(XEN) FAR_EL2: ffffff8000000f00
(XEN)
(XEN) Xen stack trace from sp=000080003ef5fe80:

(XEN)    000080003ef5fea0 0000000000241468 0000000000000000 0000000000000000
(XEN)    0000000000000000 000000000024145c 0000000000000000 00000000ffffffff
(XEN)    0000000047fff000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000040008000 00000000000001d3
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN) Xen call trace:
(XEN)    [<00000000002413c8>] schedule_tail+0x248/0x2dc (PC)
(XEN)    [<0000000000241300>] schedule_tail+0x180/0x2dc (LR)
(XEN)    [<0000000000241468>] continue_new_vcpu+0xc/0xa4
(XEN)    [<000000000024145c>] continue_new_vcpu+0/0xa4

(XEN)
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) CPU0: Unexpected Trap: Hypervisor
(XEN)
(XEN) ****************************************
(XEN)
(XEN) Reboot in five seconds...

I was trying to figure out if it had to do with issues with mini-os in general, or if it had to do with the fact that mini-os can currently only be built with 32-bit support. So I took a 32-bit linux kernel that had xen guest support enabled. I tried to boot that guest, and I got the exact same error. I tried to do some searching on the wiki and on the mailing list and I couldn't find any references to this issue. Is this a known bug and are there any plans to fix this?

Thanks,
Robbie VanVossen
DornerWorks

#1 lore raw
Quoted 1 line · Robert VanVossen

Hello,

Hi Robert,

Quoted 5 lines

I was wondering, what is the current state of running a 32-bit ARM guest running on a 64-bit Xen for ARM. I was working on getting the minios from
https://github.com/talex5/xen/commits/next built and running as a guest on an emulated Cortex-A53. I have gotten Xen and 64-bit Linux guests running in the emulated environment, but I ran into some issues with the 32-bit guests.

I used 32-bit kernel on 64-bit hardware recently without no issue. AFAICT, 32-bit guest as always worked on Xen. Which version on Xen are you running?

Also, silly question, does your hardware supports 32-bit instructions? I.e were you able to run Linux 32-bit on baremetal?

Quoted 4 lines

When I tried to run them, I got the following:

Parsing config from /etc/xen/mini.cfg
(XEN) Hypervisor Trap. HSR=0x2000000 EC=0x0 IL=1 Syndrome=0x0

This looks like an issue with Xen running on your hardware. EC = 0x0 means "Exception with an Unkwnown reasons".

Quoted 4 lines

(XEN) CPU0: Unexpected Trap: Hypervisor
(XEN) ----[ Xen-4.6-unstable arm64 debug=y Not tainted ]----
(XEN) CPU: 0
(XEN) PC: 00000000002413c8 schedule_tail+0x248/0x2dc

schedule_tail contains the code to context switch from one domain to another one.

Can you run addr2line on the xen-syms with the address in PC and give the result?

Regards,

Signature · 1 line
Julien Grall
#6 lore raw
In reply to Robert VanVossen
Quoted 7 lines · Robert VanVossen

Hello,

I was wondering, what is the current state of running a 32-bit ARM guest running on a 64-bit Xen for ARM. I was working on getting the minios from
https://github.com/talex5/xen/commits/next built and running as a guest on an emulated Cortex-A53. I have gotten Xen and 64-bit Linux guests running in the emulated environment, but I ran into some issues with the 32-bit guests.

Hi Robert,

If this is with the QEMU models for Xilinx ZynqMP it's not unexpected. We don't really support 32-bit guests at the moment.

If you can provide some more details on where it is failing I can have a look at it.

Cheers,
Edgar

Quoted 77 lines

When I tried to run them, I got the following:

Parsing config from /etc/xen/mini.cfg
(XEN) Hypervisor Trap. HSR=0x2000000 EC=0x0 IL=1 Syndrome=0x0 (XEN) CPU0: Unexpected Trap: Hypervisor
(XEN) ----[ Xen-4.6-unstable arm64 debug=y Not tainted ]----

(XEN) CPU:    0
(XEN) PC:     00000000002413c8 schedule_tail+0x248/0x2dc
(XEN) LR:     0000000000241300
(XEN) SP:     000080003ef5fe80
(XEN) CPSR:   600003c9 MODE:64-bit EL2h (Hypervisor, handler)
(XEN)      X0: 0000000000000000  X1: 0000000000000000  X2: 0000000000000000
(XEN)      X3: 0000000000000000  X4: 0000000000000000  X5: 0000000000000008
(XEN)      X6: 0000000040011100  X7: 0000000000000000  X8: 000080003ef632e0
(XEN)      X9: 000080003ef5feb0 X10: 0000000100000000 X11: aea06b1800000000
(XEN)     X12: 000000000000007f X13: 2f3b52d000000000 X14: 0000000100000000
(XEN)     X15: 0000007fae98c598 X16: 0000000000000024 X17: 0000007fae908b50
(XEN)     X18: 0000007ffb53e170 X19: 000080003efdb000 X20: 000080003ef63000
(XEN)     X21: 0000000000000000 X22: 0000000000000000 X23: 0000000000000000
(XEN)     X24: 0000000000000000 X25: 0000000000000000 X26: 0000000000000000
(XEN)     X27: 0000000000000000 X28: 0000000000000000  FP: 000080003ef5fe80

(XEN)
(XEN) VTCR_EL2: 80023558
(XEN) VTTBR_EL2: 000200003ef66000
(XEN)
(XEN) SCTLR_EL2: 30cd187d
(XEN) HCR_EL2: 000000000038643f
(XEN) TTBR0_EL2: 000000003eef4000
(XEN)
(XEN) ESR_EL2: 02000000
(XEN) HPFAR_EL2: 0000000000f90100
(XEN) FAR_EL2: ffffff8000000f00
(XEN)
(XEN) Xen stack trace from sp=000080003ef5fe80:

(XEN)    000080003ef5fea0 0000000000241468 0000000000000000 0000000000000000
(XEN)    0000000000000000 000000000024145c 0000000000000000 00000000ffffffff
(XEN)    0000000047fff000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000040008000 00000000000001d3
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN) Xen call trace:
(XEN)    [<00000000002413c8>] schedule_tail+0x248/0x2dc (PC)
(XEN)    [<0000000000241300>] schedule_tail+0x180/0x2dc (LR)
(XEN)    [<0000000000241468>] continue_new_vcpu+0xc/0xa4
(XEN)    [<000000000024145c>] continue_new_vcpu+0/0xa4

(XEN)
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) CPU0: Unexpected Trap: Hypervisor
(XEN)
(XEN) ****************************************
(XEN)
(XEN) Reboot in five seconds...

I was trying to figure out if it had to do with issues with mini-os in general, or if it had to do with the fact that mini-os can currently only be built with 32-bit support. So I took a 32-bit linux kernel that had xen guest support enabled. I tried to boot that guest, and I got the exact same error. I tried to do some searching on the wiki and on the mailing list and I couldn't find any references to this issue. Is this a known bug and are there any plans to fix this?

Thanks,
Robbie VanVossen
DornerWorks

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
In reply to Julien Grall
Quoted 12 lines · Julien Grall
Quoted 1 line · Robert VanVossen

Hello,

Hi Robert,

Quoted 5 lines

I was wondering, what is the current state of running a 32-bit ARM guest running on a 64-bit Xen for ARM. I was working on getting the minios from
https://github.com/talex5/xen/commits/next built and running as a guest on an emulated Cortex-A53. I have gotten Xen and 64-bit Linux guests running in the emulated environment, but I ran into some issues with the 32-bit guests.

Quoted 4 lines

I used 32-bit kernel on 64-bit hardware recently without no issue. AFAICT, 32-bit guest as always worked on Xen. Which version on Xen are you running?

I thought that should be the case, but I couldn't find confirmation anywhere online.

I am building from master, more specifically commit 123c7793...

Quoted 3 lines

Also, silly question, does your hardware supports 32-bit instructions? I.e were you able to run Linux 32-bit on baremetal?

I had assumed that all cortex-A53 implementations had to support 32-bit instructions, but that might not be the case. At least, the emulated model might not. I will have to look more into that.

Quoted 13 lines
Quoted 4 lines

When I tried to run them, I got the following:

Parsing config from /etc/xen/mini.cfg
(XEN) Hypervisor Trap. HSR=0x2000000 EC=0x0 IL=1 Syndrome=0x0

This looks like an issue with Xen running on your hardware. EC = 0x0 means "Exception with an Unkwnown reasons".

Quoted 4 lines

(XEN) CPU0: Unexpected Trap: Hypervisor
(XEN) ----[ Xen-4.6-unstable arm64 debug=y Not tainted ]----
(XEN) CPU: 0
(XEN) PC: 00000000002413c8 schedule_tail+0x248/0x2dc

Quoted 6 lines

schedule_tail contains the code to context switch from one domain to another one.

Can you run addr2line on the xen-syms with the address in PC and give the result?

This yields xen/xen/arch/arm/domain.c:208 which has the following line:

WRITE_SYSREG32(n->arch.teecr, TEECR32_EL1);

Thanks,
Robbie VanVossen

#3 lore raw
Quoted 3 lines · Robert VanVossen

This yields xen/xen/arch/arm/domain.c:208 which has the following line:

WRITE_SYSREG32(n->arch.teecr, TEECR32_EL1);

This is in a "if ( is_32bit_domain(p->domain) && cpu_has_thumbee )" condition, so if it isn't a 32-bit model issue it might be a ThumbEE one?

Ian.

#4 lore raw

Hi,

Quoted 8 lines · Ian Campbell
Quoted 3 lines · Robert VanVossen

This yields xen/xen/arch/arm/domain.c:208 which has the following line:

WRITE_SYSREG32(n->arch.teecr, TEECR32_EL1);

This is in a "if ( is_32bit_domain(p->domain) && cpu_has_thumbee )" condition, so if it isn't a 32-bit model issue it might be a ThumbEE one?

Robert, can you confirm that you aren't using the QEMU models for Xilinx ZynqMP? If not, based on Edgar's mail [1] I think it's not a bug in Xen.

Regards,

[1] http://lists.xen.org/archives/html/xen-devel/2015-04/msg03033.html

Signature · 1 line
Julien Grall
#5 lore raw

Hello,

Quoted 6 lines · Julien Grall

Hi,

Quoted 3 lines · Ian Campbell
Quoted 2 lines · Robert VanVossen

This yields xen/xen/arch/arm/domain.c:208 which has the following line:

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

WRITE_SYSREG32(n->arch.teecr, TEECR32_EL1);

This is in a "if ( is_32bit_domain(p->domain) && cpu_has_thumbee )" condition, so if it isn't a 32-bit model issue it might be a ThumbEE one?

Robert, can you confirm that you aren't using the QEMU models for Xilinx ZynqMP? If not, based on Edgar's mail [1] I think it's not a bug in Xen.

Yes, I am using the QEMU model for the Xilinx ZynqMP, so it does not appear to be a bug in Xen.

Thank you for the help.

-Robbie VanVossen