[U-Boot] [PATCH] armv8: Remove the codes about switching to EL1 before jumping to kernel

Huan Wang alison.wang at nxp.com
Mon Sep 5 10:24:33 CEST 2016


> > On 08/29/2016 11:29 AM, Huan Wang wrote:
> > >> On 18.07.16 05:24, Huan Wang wrote:
> > >>> Hi, Alex,
> > >>>
> > >>>
> > >>>
> > >>>                As there is strong objection to remove the codes
> > >>> about switching to EL1, I think we have to remain it, do you agree?
> > >> I agree, yes.
> > >>
> > >>>                  If it is remained, I think your suggestion about
> > >>> **always** jumping to ep for both switching to AArch64 and AArch32
> > >>> modes will make the code hard to realize and very complicated. So
> > >>> I prefer to  keep the process in v4 patches. What is your opinion?
> > >> I think we should still convert it to a function call based
> approach.
> > >> You can either just convert the current flow to functions:
> > >>
> > >> static void enter_in_el1(...)
> > >> {
> > >>      call_in_el1(payload_pc, payload_bits, ...); }
> > >>
> > >> #ifdef ENTER_PAYLOAD_IN_EL1
> > >> call_in_el2(enter_in_el1, 64bit, ...); #else
> > >> call_in_el2(payload_pc, payload_bits, ...); #endif
> > >>
> > >> Or you could add a check in the EL1 caller if you are in EL3 that
> > >> you want to go to EL2 first:
> > >>
> > >> long call_in_el1(...)
> > >> {
> > >>    if (current_el() == 3)
> > >>      return call_in_el2(call_in_el1, ...);
> > >>
> > >>    asm_call_in_el1(...);
> > >> }
> > >>
> > >>
> > > [Alison Wang] Yes, it can work for primary core and secondary cores
> > for LayerScape.
> > >
> > > For other ARMv8 platforms, such as
> > > arch/arm/mach-exynos/soc.c,
> > > void lowlevel_init(void)
> > > {
> > >          armv8_switch_to_el2();
> > >          armv8_switch_to_el1();
> > > }
> > > Is there any appropriate ep we can transfer for these functions?
> >
> > First off, I'd be surprised if the sequence above even works at all,
> > as you also need to set up your page tables for el2/el1 if you want to
> > get into those.
> >
> > IMHO the best path for this case is to remove the function :). But
> > double-check with the Samsung folks first. I don't see why they can't
> > use the generic one.
> [Alison Wang]
> 
> I have some questions about the following function. Could you help to
> answer?
> 
> arch/arm/mach-exynos/soc.c,
> void lowlevel_init(void)
> {
> 	armv8_switch_to_el2();
> 	armv8_switch_to_el1();
> }
> 
> Is this function necessary for exynos platforms? Why not to use the
> generic lowlevel_init function?
> 
Could you help to answer the question?

Thanks.


Best Regards,
Alison Wang


More information about the U-Boot mailing list