Discussion:
Re: xen on sun7i successful
(too old to reply)
Bharat Gohil
2015-08-10 07:38:49 UTC
Permalink
hi, list
i have successful run xen on a sun7i(A20) STB, it should be work on cb2
and cb3(AKA cubietruck) and
http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions/Allwinner.
maybe someone is interested in try this.
BTW: i fail in try the ehci, does anyone has successful exprience about
this on sun7i?
thanks
bamvor
Hi,

I working on porting xen to Orange Pi 2(Allwinner H3) board.
When I try to boot xen on it, Shows following message.

- UART enabled -
- CPU booting -
- Xen must be entered in NS Hyp mode -
- Boot failed -

I assume that all allwinner core enable in hyp mode and following code
checks for hyp mode in u-boot( in start.S)

mrs r0, cpsr
and r1, r0, #0x1f @ mask mode bits
teq r1, #0x1a @ test for HYP mode
bicne r0, r0, #0x1f @ clear all mode bits
orrne r0, r0, #0x13 @ set SVC mode
orr r0, r0, #0xc0 @ disable FIQ and IRQ
msr cpsr,r0

But didn't works for me.

Can you help/guide me to enter into hyp mode in Allwinner H3 based board?

I am stuck at this point because it link with SOC manufacture.

Thanks and Regards,
Bharat Gohil
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Chen-Yu Tsai
2015-08-10 08:55:05 UTC
Permalink
Post by Bharat Gohil
hi, list
i have successful run xen on a sun7i(A20) STB, it should be work on cb2
and cb3(AKA cubietruck) and
http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions/Allwinner.
maybe someone is interested in try this.
BTW: i fail in try the ehci, does anyone has successful exprience about
this on sun7i?
thanks
bamvor
Hi,
I working on porting xen to Orange Pi 2(Allwinner H3) board.
When I try to boot xen on it, Shows following message.
- UART enabled -
- CPU booting -
- Xen must be entered in NS Hyp mode -
- Boot failed -
I assume that all allwinner core enable in hyp mode and following code
checks for hyp mode in u-boot( in start.S)
HYP mode requires PSCI and HYP support in U-boot. Last I checked we don't
support the H3 yet.
Post by Bharat Gohil
mrs r0, cpsr
msr cpsr,r0
But didn't works for me.
Can you help/guide me to enter into hyp mode in Allwinner H3 based board?
I am stuck at this point because it link with SOC manufacture.
Thanks and Regards,
Bharat Gohil
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michal Suchanek
2015-08-10 10:27:34 UTC
Permalink
Hello,
Post by Chen-Yu Tsai
Post by Bharat Gohil
hi, list
i have successful run xen on a sun7i(A20) STB, it should be work on cb2
and cb3(AKA cubietruck) and
http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions/Allwinner.
maybe someone is interested in try this.
BTW: i fail in try the ehci, does anyone has successful exprience about
this on sun7i?
thanks
bamvor
Hi,
I working on porting xen to Orange Pi 2(Allwinner H3) board.
When I try to boot xen on it, Shows following message.
- UART enabled -
- CPU booting -
- Xen must be entered in NS Hyp mode -
- Boot failed -
I assume that all allwinner core enable in hyp mode and following code
checks for hyp mode in u-boot( in start.S)
HYP mode requires PSCI and HYP support in U-boot. Last I checked we don't
support the H3 yet.
I vaguely recall some patches for Xen support in u-boot.

Maybe check u-boot mainline or ask at their mailinglist about the status?

Thanks

Michal
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ian Campbell
2015-08-11 07:40:38 UTC
Permalink
Post by Michal Suchanek
Post by Chen-Yu Tsai
Post by Bharat Gohil
I assume that all allwinner core enable in hyp mode and following
code
Post by Chen-Yu Tsai
Post by Bharat Gohil
checks for hyp mode in u-boot( in start.S)
HYP mode requires PSCI and HYP support in U-boot. Last I checked we don't
support the H3 yet.
I vaguely recall some patches for Xen support in u-boot.
Given a u-boot which launches the kernel in HYP mode and supports PSCI
for SMP then Xen needs nothing else special from u-boot, it can all be
scripted in a boot.scr using the fdt comman.

Ian.
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g***@gmail.com
2015-08-11 10:39:15 UTC
Permalink
Post by Ian Campbell
Post by Michal Suchanek
Post by Chen-Yu Tsai
Post by Bharat Gohil
I assume that all allwinner core enable in hyp mode and following
code
Post by Chen-Yu Tsai
Post by Bharat Gohil
checks for hyp mode in u-boot( in start.S)
HYP mode requires PSCI and HYP support in U-boot. Last I checked we don't
support the H3 yet.
I vaguely recall some patches for Xen support in u-boot.
Given a u-boot which launches the kernel in HYP mode and supports PSCI
for SMP then Xen needs nothing else special from u-boot, it can all be
scripted in a boot.scr using the fdt comman.
Ian.
Thanks! Ian

My problem is before xen start.I am not able to enter in to HYP mode.

TRY #1:

I tried using PSCI patch which is available in latest u-boot.
Let me describe the problem.after applied PSCI patch,

CPU does not switch properly to HYP mode as the execution hangs.
The problem is that the processor is already in NS SVC mode when the
armv7_switch_nonsec() is invoked: the assembly routine _nonsec_init in
nonsec_virt.S file fails when it tries to write the MVBAR register, only
accessible from a secure mode. Unfortunately the function (or some of its
instructions) cannot be simply bypassed, as it holds all the set-up needed
to be done in the secure state before actually switching to HYP mode: it
sets up vector table and registers needed to enable the hypervisor call
(hvc #0) instruction

TRY #2
Assume the my allwinner H3 board start in HYP mode so let u-boot continue to run HYP mode using following patch in
arch/arm/cpu/start.S

mrs r0, cpsr
and r1, r0, #0x1f @ mask mode bits
teq r1, #0x1a @ test for HYP mode
bicne r0, r0, #0x1f @ clear all mode bits
orrne r0, r0, #0x13 @ set SVC mode
orr r0, r0, #0xc0 @ disable FIQ and IRQ
msr cpsr,r0

As mention in TRY #2 works for Cubieboard which has Allwinner A20 SoC but not works for my Allwinner H3 orange pi mini 2 board.

I think allwinner people can answer this question because they know its is possible or not to enter into HYP in Allwinner H3 device.If yes then how.
As of now I dont have contact from allwinner.
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ian Campbell
2015-08-12 07:58:15 UTC
Permalink
Post by Bharat Gohil
Post by Ian Campbell
Post by Michal Suchanek
Post by Chen-Yu Tsai
Post by Bharat Gohil
I assume that all allwinner core enable in hyp mode and
following
Post by Ian Campbell
Post by Michal Suchanek
code
Post by Chen-Yu Tsai
Post by Bharat Gohil
checks for hyp mode in u-boot( in start.S)
HYP mode requires PSCI and HYP support in U-boot. Last I
checked we don't
Post by Ian Campbell
Post by Michal Suchanek
Post by Chen-Yu Tsai
support the H3 yet.
I vaguely recall some patches for Xen support in u-boot.
Given a u-boot which launches the kernel in HYP mode and supports
PSCI
Post by Ian Campbell
for SMP then Xen needs nothing else special from u-boot, it can all
be
Post by Ian Campbell
scripted in a boot.scr using the fdt comman.
Ian.
Thanks! Ian
My problem is before xen start.I am not able to enter in to HYP mode.
It sounds like you are using Allwinners boot0 together with a regular u
-boot? I think that is the current state of the art for H3.

In order to support PSCI and HYP mode u-boot needs to be launched in
secure world so that it can do the necessary setup which requires those
privileges before dropping to Non-Secure world and HYP mode itself
leaving the necessary infrastructure (monitor mode stub for PSCI) setup
behind itself.

If Allwinner's boot0 is not launching u-boot in Secure mode (which
seems to be the case) then no amount of patching of the main u-boot
image or assuming it to be otherwise is going to help, sorry.

The solution to this is to get proper SPL mode support working with u
-boot to replace the Allwinner boot0.

[...]
Post by Bharat Gohil
CPU does not switch properly to HYP mode as the execution hangs.
The problem is that the processor is already in NS SVC mode
If u-boot is in NS SVC mode when it is launched then PSCI and/or HYP
mode is not an option.

[...]
Post by Bharat Gohil
Assume the my allwinner H3 board start in HYP mode
You can't just assume this, it is either factually true or not, which
would need to be confirmed not guessed.

Also as I say above u-boot requires to be started in Secure world and
to manage the transition to NS world itself, otherwise PSCI cannot
work. It might be possible to get uni-processor Xen working if u-boot
is launched in NS HYP mode but PSCI can't work in this case.

Ian.
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g***@gmail.com
2015-09-23 10:47:31 UTC
Permalink
Post by Ian Campbell
Post by Bharat Gohil
Post by Ian Campbell
Post by Michal Suchanek
Post by Chen-Yu Tsai
Post by Bharat Gohil
I assume that all allwinner core enable in hyp mode and
following
Post by Ian Campbell
Post by Michal Suchanek
code
Post by Chen-Yu Tsai
Post by Bharat Gohil
checks for hyp mode in u-boot( in start.S)
HYP mode requires PSCI and HYP support in U-boot. Last I
checked we don't
Post by Ian Campbell
Post by Michal Suchanek
Post by Chen-Yu Tsai
support the H3 yet.
I vaguely recall some patches for Xen support in u-boot.
Given a u-boot which launches the kernel in HYP mode and supports
PSCI
Post by Ian Campbell
for SMP then Xen needs nothing else special from u-boot, it can all
be
Post by Ian Campbell
scripted in a boot.scr using the fdt comman.
Ian.
Thanks! Ian
My problem is before xen start.I am not able to enter in to HYP mode.
It sounds like you are using Allwinners boot0 together with a regular u
-boot? I think that is the current state of the art for H3.
In order to support PSCI and HYP mode u-boot needs to be launched in
secure world so that it can do the necessary setup which requires those
privileges before dropping to Non-Secure world and HYP mode itself
leaving the necessary infrastructure (monitor mode stub for PSCI) setup
behind itself.
If Allwinner's boot0 is not launching u-boot in Secure mode (which
seems to be the case) then no amount of patching of the main u-boot
image or assuming it to be otherwise is going to help, sorry.
The solution to this is to get proper SPL mode support working with u
-boot to replace the Allwinner boot0.
[...]
Post by Bharat Gohil
CPU does not switch properly to HYP mode as the execution hangs.
The problem is that the processor is already in NS SVC mode
If u-boot is in NS SVC mode when it is launched then PSCI and/or HYP
mode is not an option.
[...]
Post by Bharat Gohil
Assume the my allwinner H3 board start in HYP mode
You can't just assume this, it is either factually true or not, which
would need to be confirmed not guessed.
Also as I say above u-boot requires to be started in Secure world and
to manage the transition to NS world itself, otherwise PSCI cannot
work. It might be possible to get uni-processor Xen working if u-boot
is launched in NS HYP mode but PSCI can't work in this case.
Ian.
Thank you very much for explanation.
Understood the problem.
If internal bootROM code lauches the boot0 to in Non-Secure SVC mode then there is noway to run virtualization on such SOC.

Let me update if you have any information regarding virtulization on allwinner H3 SoC.

Regards,
Bharat Gohil

Regards,
Bharat Gohil
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
c***@gmail.com
2018-02-04 19:28:18 UTC
Permalink
Hi found this topic and want to ask if there are any experience out there
about AllWinner H5 support for Xen.

I saw a vid that this will be possible, but the blog somehow wasnt finished
quiet well.
Is someone here in contact with someone who knows more about running xen on
AllWinner H5? OrangePi PC 2 in detail?

thanks
jonny
hi, list
i have successful run xen on a sun7i(A20) STB, it should be work on cb2
http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions/Allwinner.
maybe someone is interested in try this.
BTW: i fail in try the ehci, does anyone has successful exprience about
this on sun7i?
thanks
bamvor
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
André Przywara
2018-02-04 23:02:25 UTC
Permalink
On 04/02/18 20:28, ***@gmail.com wrote:

Hi,
Post by c***@gmail.com
Hi found this topic and want to ask if there are any experience out
there about AllWinner H5 support for Xen.
I saw a vid that this will be possible, but the blog somehow wasnt
finished quiet well.
Is someone here in contact with someone who knows more about running xen
on AllWinner H5? OrangePi PC 2 in detail?
Yes, I ran it on the PC 2. The A64 and the H5 are supported since Xen 4.10.
Just compile a normal arm64 Xen binary, make sure your arm64 Dom0 kernel
has H5 support and enables Xen Dom0 support (defconfig should work).
Then follow the instructions on the Xen Wiki to get it to boot:
https://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions/Allwinner

Awais (on CC:) was also running Xen on the PC2, he actually triggered
the official Xen support.

Cheers,
Andre.
Post by c***@gmail.com
hi, list
i have successful run xen on a sun7i(A20) STB, it should be work on
http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions/Allwinner
<http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions/Allwinner>.
maybe someone is interested in try this.
BTW: i fail in try the ehci, does anyone has successful exprience
about this on sun7i?
thanks
bamvor
--
You received this message because you are subscribed to the Google
Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
bharat gohil
2018-02-05 09:05:43 UTC
Permalink
I had successfully run Xen 4.10 with latest kernel as DOM0(4.12) and
DomU(4.12) on Orangepi PC2. I also experiment some pass-through and device
emulation under Xen on OrangePI PC2.
It really state-forward.
Post by André Przywara
Hi,
Post by c***@gmail.com
Hi found this topic and want to ask if there are any experience out
there about AllWinner H5 support for Xen.
I saw a vid that this will be possible, but the blog somehow wasnt
finished quiet well.
Is someone here in contact with someone who knows more about running xen
on AllWinner H5? OrangePi PC 2 in detail?
Yes, I ran it on the PC 2. The A64 and the H5 are supported since Xen 4.10.
Just compile a normal arm64 Xen binary, make sure your arm64 Dom0 kernel
has H5 support and enables Xen Dom0 support (defconfig should work).
https://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions/Allwinner
Awais (on CC:) was also running Xen on the PC2, he actually triggered
the official Xen support.
Cheers,
Andre.
Post by c***@gmail.com
hi, list
i have successful run xen on a sun7i(A20) STB, it should be work on
http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_
Extensions/Allwinner
Post by c***@gmail.com
<http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_
Extensions/Allwinner>.
Post by c***@gmail.com
maybe someone is interested in try this.
BTW: i fail in try the ehci, does anyone has successful exprience
about this on sun7i?
thanks
bamvor
--
You received this message because you are subscribed to the Google
Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "linux-sunxi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/linux-sunxi/xJmrbUR6UEg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
Regards,
Bharat Gohil
Principal Engineer
***@harman.com
+919427054633
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
c***@gmail.com
2018-02-06 07:59:57 UTC
Permalink
Sounds great! I will try my best to succeed either. atm I first try to run
armbian as first step, but first attempts with 4.14 failed.
Not sure if its image side or board side but none of the status LEDs shine
up after plugging in the power supply. Maybe i have to get a new one tho.

Someone who knows similar issues with this board?

Thanks,
Jonny
Post by bharat gohil
I had successfully run Xen 4.10 with latest kernel as DOM0(4.12) and
DomU(4.12) on Orangepi PC2. I also experiment some pass-through and device
emulation under Xen on OrangePI PC2.
It really state-forward.
Post by André Przywara
Hi,
Post by c***@gmail.com
Hi found this topic and want to ask if there are any experience out
there about AllWinner H5 support for Xen.
I saw a vid that this will be possible, but the blog somehow wasnt
finished quiet well.
Is someone here in contact with someone who knows more about running xen
on AllWinner H5? OrangePi PC 2 in detail?
Yes, I ran it on the PC 2. The A64 and the H5 are supported since Xen 4.10.
Just compile a normal arm64 Xen binary, make sure your arm64 Dom0 kernel
has H5 support and enables Xen Dom0 support (defconfig should work).
https://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions/Allwinner
Awais (on CC:) was also running Xen on the PC2, he actually triggered
the official Xen support.
Cheers,
Andre.
Post by c***@gmail.com
hi, list
i have successful run xen on a sun7i(A20) STB, it should be work on
http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions/Allwinner
Post by c***@gmail.com
<
http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions/Allwinner
Post by c***@gmail.com
.
maybe someone is interested in try this.
BTW: i fail in try the ehci, does anyone has successful exprience
about this on sun7i?
thanks
bamvor
--
You received this message because you are subscribed to the Google
Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "linux-sunxi" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/linux-sunxi/xJmrbUR6UEg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
Regards,
Bharat Gohil
Principal Engineer
+919427054633
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...