dpotop
Posts: 78
Joined: Mon Nov 24, 2014 2:14 pm

Coherency when starting in EL3

Mon Mar 11, 2019 10:09 pm

Hello,

I have a weird problem - when booting in EL3 I can't seem to be able to enable coherency between cores.
I have two boot settings:
- in the first I boot in EL2 (classical)
- in the second I boot in EL3
In both cases, the configuration for EL2 and EL1 is exactly the same,
both for MMU and for processor registers. When booting in EL3 I spend
only little time in EL3 - I simply configure cptr_el3 and scr_el3 before
entering EL2 (I perform no cache/MMU configuration).

However, in the end, when I start in EL2 memory ends up (after config)
coherent, whereas when I start in EL3 I end up in a state where caches
seem to be on, but non-coherent. I always have to perform explicit cache
operations (cleans and invalidates) in order to communicate.

Do any of you have an idea of what happens ? I'm really at my wits' end.

Best,
Dpotop
dpotop

LdB
Posts: 1284
Joined: Wed Dec 07, 2016 2:29 pm

Re: Coherency when starting in EL3

Tue Mar 12, 2019 2:30 am

CPUECTLR_EL1 bit 6 .. read what it does
[6] SMPEN Enable hardware management of data coherency with other cores in the cluster.
Needs to be turned on and you can write to it in EL3 and EL2 .. so set it :-)

It is down at EL1 so you can do cache control from there without having to elevate however access at EL1 can be blocked at EL2 and EL3

For example bit 0 and bit 1
http://infocenter.arm.com/help/index.js ... EAHEF.html

dpotop
Posts: 78
Joined: Mon Nov 24, 2014 2:14 pm

Re: Coherency when starting in EL3

Tue Mar 12, 2019 9:07 am

Thanks LdB,

I had completely overlooked the Cortex-A53-specifics.

Is register CPUECTLR_EL1 the only one I should be concerned
with? Are there other registers of interest?
In the manual I see there are lots of "implementation-defined"
registers besides this one.

Regards,
Dumitru
dpotop

LdB
Posts: 1284
Joined: Wed Dec 07, 2016 2:29 pm

Re: Coherency when starting in EL3

Tue Mar 12, 2019 9:24 am

For the cache that is the only one but remember I don't know what you are really doing in EL2 and EL3 and it depends what you are virtualizing.
I have not run across any "implementation-defined" that need setting but that does not mean they don't exist :-)
I have only played with EL2 with project XEN and nothing much with EL3 so my knowledge is very limited but I had run into that problem.

Return to “Bare metal, Assembly language”