Re: [linux-sunxi] Re: xen on sun7i successful

2015-09-23 Thread ghl . bhrt
On Wednesday, August 12, 2015 at 1:28:20 PM UTC+5:30, Ian Campbell wrote:
> On Tue, 2015-08-11 at 03:39 -0700, ghl.b...@gmail.com wrote:
> > On Tuesday, August 11, 2015 at 1:10:45 PM UTC+5:30, Ian Campbell 
> > wrote:
> > > On Mon, 2015-08-10 at 12:27 +0200, Michal Suchanek wrote:
> > > > >> 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.
> > > 
> > > 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.
> 
> 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.
> 
> [...]
> > 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.
> 
> [...]
> > 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: xen on sun7i successful

2015-08-11 Thread ghl . bhrt
On Tuesday, August 11, 2015 at 1:10:45 PM UTC+5:30, Ian Campbell wrote:
 On Mon, 2015-08-10 at 12:27 +0200, Michal Suchanek wrote:
   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.
 
 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.