cpu specific kernel call

Stefan Kalkowski stefan.kalkowski at genode-labs.com
Fri Mar 5 12:08:44 CET 2021


Hello Michael,

On Wed, Mar 03, 2021 at 11:22:33PM +0100, Michael Grunditz wrote:
> Hi,
> 
> I have a kernel call that starts RISC OS, and uses psci. I wonder , where 
> should I put that very aarch64 dependent code. I somehow need to be able 
> to call it from userspace.
> 
> Regarding kernel calls in general , what is the best way of calling them? 
> Right now I do "MOV x0,#number ; SVC" , probably not very Genode style! :)

Actually, there is already support for what you are looking for, I
think. As far as I understood it correctly, you want to wake up the
Cortex-M4 (side-) processor, after you've prepared RiscOS to run on top of it?

Of course, you should not just add a system call that can be executed
by every component to do something like this ;-). But we already had
similar needs, when doing power control inside of the platform driver
for i.MX 8M. There are some GPC controls that are done by the ARM
Trusted firmware. Therefore we extended a previously existent
privilege to the so called "managing_system" privilege that can be
given when creating a new PD resp. component. This privilege is
typically given only to the platform driver. With it a component can
do a "managing_system(State&)" call on its PD session. This call transfers
registers (State == Cpu_state) to core, which on will do a "secure
monitor call" with the given registers (at least on ARMv8).
For further understanding, please grep for "managing_system" inside
base and base-hw.

To sum it up, you could define a specific "Power_domain" for the M4 in
the platform driver of your board, and then do the corresponding SMC
call therein using the managing_system call. Your application doing
the RiscOS loading just needs to acquire the device with the M4
Power_domain from the platform driver at the point where you want to
power it, and release it again when you want to power it off.

This way, you will have a secure and sane integration of the M4
handling.

I hope I could somehow express myself comprehensivly.

Best regards
Stefan

> 
> 
> 
> 
> -- 
>        Michael Grunditz
> Sent from my RISC OS workstation..
> 
> _______________________________________________
> Genode users mailing list
> users at lists.genode.org
> https://lists.genode.org/listinfo/users

-- 
Stefan Kalkowski
Genode labs

https://github.com/skalk | https://genode.org



More information about the users mailing list