Zephyr as a Jailhouse inmate

36 views
Skip to first unread message

Manivannan Sadhasivam

unread,
Dec 2, 2019, 1:43:52 PM12/2/19
to Jailhouse
Hello,

I can see that the Zephyr RTOS has been mentioned in the FAQ as
one of the ported OS for non-root cells.

Is there any reference code I can look into?

Thanks,
Mani

Jan Kiszka

unread,
Dec 5, 2019, 2:06:17 AM12/5/19
to Manivannan Sadhasivam, Jailhouse
There is x86 support for Zephyr as Jailhouse "inmate". Check out
zephyr/boards/x86/x86_jailhouse/doc/board.rst. If you run into trouble,
report to the communities.

We could probably also easily support ARM, but the last time this
question came up, there was still not A-core support in Zephyr which is
a precondition.

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

Mani Sadhasivam

unread,
Dec 5, 2019, 2:14:15 AM12/5/19
to Jan Kiszka, Jailhouse
Hi Jan,

On Thu, Dec 5, 2019 at 12:36 PM Jan Kiszka <jan.k...@siemens.com> wrote:
On 02.12.19 19:43, Manivannan Sadhasivam wrote:
> Hello,
>
> I can see that the Zephyr RTOS has been mentioned in the FAQ as
> one of the ported OS for non-root cells.
>
> Is there any reference code I can look into?

There is x86 support for Zephyr as Jailhouse "inmate". Check out
zephyr/boards/x86/x86_jailhouse/doc/board.rst. If you run into trouble,
report to the communities.

 

We could probably also easily support ARM, but the last time this
question came up, there was still not A-core support in Zephyr which is
a precondition.

That's what I'm trying to do on IMX8M EVK in spare time. There is an ongoing
PR for adding Cortex-A support in Zephyr, so I'm planning to utilize that.

Thanks,
Mani
 

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


--
மணிவண்ணன் சதாசிவம்

Jan Kiszka

unread,
Dec 5, 2019, 2:39:19 AM12/5/19
to Mani Sadhasivam, Jailhouse
On 05.12.19 08:14, Mani Sadhasivam wrote:
> Hi Jan,
>
> On Thu, Dec 5, 2019 at 12:36 PM Jan Kiszka <jan.k...@siemens.com
> <mailto:jan.k...@siemens.com>> wrote:
>
> On 02.12.19 19:43, Manivannan Sadhasivam wrote:
> > Hello,
> >
> > I can see that the Zephyr RTOS has been mentioned in the FAQ as
> > one of the ported OS for non-root cells.
> >
> > Is there any reference code I can look into?
>
> There is x86 support for Zephyr as Jailhouse "inmate". Check out
> zephyr/boards/x86/x86_jailhouse/doc/board.rst. If you run into trouble,
> report to the communities.
>
>
> Ah, just noticed that it got removed some time ago:
> https://github.com/zephyrproject-rtos/zephyr/commit/f3611fdd0c8ca54a9f19bc56a14b4a2fdadaffe3#diff-bb9445fa64739ef6a5a6b59d520deb07
>

Too bad they didn't reach out...

> But this could be helpful!
>  

Partly. For ARM, you likely don't need so may changes, see below.

>
>
> We could probably also easily support ARM, but the last time this
> question came up, there was still not A-core support in Zephyr which is
> a precondition.
>
>
> That's what I'm trying to do on IMX8M EVK in spare time. There is an ongoing
> PR for adding Cortex-A support in Zephyr, so I'm planning to utilize that.

That is good news. If you combine that with the device tree description
for inmates, actually those for the Linux cells, you should be able to
boot without code modifications.

Jan Kiszka

unread,
Dec 5, 2019, 3:08:41 AM12/5/19
to Mani Sadhasivam, Jailhouse
[re-adding the mailing list]

On 05.12.19 09:07, Jan Kiszka wrote:
> On 05.12.19 08:49, Mani Sadhasivam wrote:
>>
>>
>> On Thu, Dec 5, 2019 at 1:09 PM Jan Kiszka <jan.k...@siemens.com
>> <mailto:jan.k...@siemens.com>> wrote:
>>
>> On 05.12.19 08:14, Mani Sadhasivam wrote:
>> > Hi Jan,
>> >
>> > On Thu, Dec 5, 2019 at 12:36 PM Jan Kiszka <jan.k...@siemens.com
>> <mailto:jan.k...@siemens.com>
>> > <mailto:jan.k...@siemens.com <mailto:jan.k...@siemens.com>>>
>> Don't we need MMU support in inmate? The current ARMv8 PR doesn't have the
>> MMU support.
>
> Technically, we don't. Earlier versions of our demo inmates were running
> without MMU as well, but as that implies running without caches as well,
> we changed that. In any case, the inmate starts in reset state, means
> with MMU (and caches) off.

Peng Fan

unread,
Dec 5, 2019, 3:44:42 AM12/5/19
to Mani Sadhasivam, Jan Kiszka, Jailhouse
Sorry for top post.

Would you mind share what products would you use i.MX8M EVK for?

Also Could you please share the armv8 PR for zephyr?

Thanks,
Peng.

From: jailho...@googlegroups.com <jailho...@googlegroups.com> On Behalf Of Mani Sadhasivam
Sent: 2019年12月5日 15:14
To: Jan Kiszka <jan.k...@siemens.com>
Cc: Jailhouse <jailho...@googlegroups.com>
Subject: Re: Zephyr as a Jailhouse inmate

Hi Jan,

On Thu, Dec 5, 2019 at 12:36 PM Jan Kiszka <mailto:jan.k...@siemens.com> wrote:
On 02.12.19 19:43, Manivannan Sadhasivam wrote:
> Hello,
>
> I can see that the Zephyr RTOS has been mentioned in the FAQ as
> one of the ported OS for non-root cells.
>
> Is there any reference code I can look into?

There is x86 support for Zephyr as Jailhouse "inmate". Check out
zephyr/boards/x86/x86_jailhouse/doc/board.rst. If you run into trouble,
report to the communities.

Ah, just noticed that it got removed some time ago:
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fzephyr%2Fcommit%2Ff3611fdd0c8ca54a9f19bc56a14b4a2fdadaffe3%23diff-bb9445fa64739ef6a5a6b59d520deb07&data=02%7C01%7Cpeng.fan%40nxp.com%7C3e79e9ef68d24b68d9b808d77952bcf3%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637111268572956815&sdata=8SkuxLhNQarhgoTD8u1%2BvD6HJtByb%2BNhaTxiUbGIDIw%3D&reserved=0

But this could be helpful!
 

We could probably also easily support ARM, but the last time this
question came up, there was still not A-core support in Zephyr which is
a precondition.

That's what I'm trying to do on IMX8M EVK in spare time. There is an ongoing
PR for adding Cortex-A support in Zephyr, so I'm planning to utilize that.

Thanks,
Mani
 

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux



--
மணிவண்ணன் சதாசிவம்
--
You received this message because you are subscribed to the Google Groups "Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:jailhouse-de...@googlegroups.com.
To view this discussion on the web visit https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fjailhouse-dev%2FCANBTL1VsEGSiqZe5SG4EQ3sn4KbcvKQqYLERCT-NbqxZK5ZBKQ%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=02%7C01%7Cpeng.fan%40nxp.com%7C3e79e9ef68d24b68d9b808d77952bcf3%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637111268572966810&sdata=CoOfSEdyP2GQjOiwCvjWQ9UlrD0vqtKTYuaeSYca96k%3D&reserved=0.

Mani Sadhasivam

unread,
Dec 5, 2019, 4:51:41 AM12/5/19
to Peng Fan, Jailhouse
+ mailing list

On Thu, Dec 5, 2019 at 2:52 PM Mani Sadhasivam <manivan...@gmail.com> wrote:
Hi Peng,

On Thu, Dec 5, 2019 at 2:14 PM Peng Fan <peng...@nxp.com> wrote:
Sorry for top post.

Would you mind share what products would you use i.MX8M EVK for?

It is just a spare time project I'm doing for fun.
 

Also Could you please share the armv8 PR for zephyr?

Jan Kiszka

unread,
Dec 6, 2019, 3:09:37 AM12/6/19
to Mani Sadhasivam, Jailhouse
On 05.12.19 20:32, Mani Sadhasivam wrote:
> Hi Jan,
>
> On Thu, Dec 5, 2019 at 1:38 PM Jan Kiszka <jan.k...@siemens.com
> <mailto:jan.k...@siemens.com>> wrote:
>
> [re-adding the mailing list]
>
> On 05.12.19 09:07, Jan Kiszka wrote:
> > On 05.12.19 08:49, Mani Sadhasivam wrote:
> >>
> >>
> >> On Thu, Dec 5, 2019 at 1:09 PM Jan Kiszka <jan.k...@siemens.com
> <mailto:jan.k...@siemens.com>
> I got it working partially(not fully though). What would be the Flash and
> SRAM address would you recommend? The Flash start address should
> be 0x0 since that's the CPU default start address, how about SRAM?

I didn't play with targets where SRAM was involved so far, but I could
imagine that it will be easiest to map it at a location where it would
appear physically in exclusive use as well.

Mani Sadhasivam

unread,
Dec 14, 2019, 4:51:47 AM12/14/19
to Jan Kiszka, Jailhouse, Peng Fan
I just got it working. FWIW, the wip commits are here: https://github.com/Mani-Sadhasivam/zephyr/commits/jailhouse

There are couple of caveats though:

1. Zephyr places the vector table at the start/base address and the reset entry next to it. But jailhouse didn't seem to find the reset entry and it always tries to start from the base address. Is there any config option available for fixing this? Since the vector table size is fixed, it should be relatively simple to make it start from that address I believe. 

2. Currently the GICv3 Rdist address is hardcoded for 2nd core but in ideal case we should find it based on MPIDR value as done in jailhouse inmate demo. I'm getting faults while trying to read MPIDR_EL1 system register, so need to debug it. 

Thanks, 
Mani

Jan Kiszka

unread,
Dec 14, 2019, 5:21:35 AM12/14/19
to Mani Sadhasivam, Jailhouse, Peng Fan
On 14.12.19 10:51, Mani Sadhasivam wrote:
>
>
> On Fri, 6 Dec, 2019, 1:39 PM Jan Kiszka, <jan.k...@siemens.com
> <mailto:jan.k...@siemens.com>> wrote:
>
> On 05.12.19 20:32, Mani Sadhasivam wrote:
> > Hi Jan,
> >
> > On Thu, Dec 5, 2019 at 1:38 PM Jan Kiszka <jan.k...@siemens.com
> <mailto:jan.k...@siemens.com>
> > <mailto:jan.k...@siemens.com <mailto:jan.k...@siemens.com>>>
> wrote:
> >
> >     [re-adding the mailing list]
> >
> >     On 05.12.19 09:07, Jan Kiszka wrote:
> >     > On 05.12.19 08:49, Mani Sadhasivam wrote:
> >     >>
> >     >>
> >     >> On Thu, Dec 5, 2019 at 1:09 PM Jan Kiszka
> <jan.k...@siemens.com <mailto:jan.k...@siemens.com>
> >     <mailto:jan.k...@siemens.com <mailto:jan.k...@siemens.com>>
> >     >> <mailto:jan.k...@siemens.com
> <mailto:jan.k...@siemens.com> <mailto:jan.k...@siemens.com
> <mailto:jan.k...@siemens.com>>>>
> >     wrote:
> >     >>
> >     >>     On 05.12.19 08:14, Mani Sadhasivam wrote:
> >     >>     > Hi Jan,
> >     >>     >
> >     >>     > On Thu, Dec 5, 2019 at 12:36 PM Jan Kiszka
> >     <jan.k...@siemens.com <mailto:jan.k...@siemens.com>
> <mailto:jan.k...@siemens.com <mailto:jan.k...@siemens.com>>
> >     >>     <mailto:jan.k...@siemens.com
> <mailto:jan.k...@siemens.com> <mailto:jan.k...@siemens.com
> <mailto:jan.k...@siemens.com>>>
> >     >>     > <mailto:jan.k...@siemens.com
> <mailto:jan.k...@siemens.com>
> >     <mailto:jan.k...@siemens.com
> <mailto:jan.k...@siemens.com>> <mailto:jan.k...@siemens.com
> <mailto:jan.k...@siemens.com>
> >     <mailto:jan.k...@siemens.com <mailto:jan.k...@siemens.com>>>>>
You can set jailhouse_cell_desc.cpu_reset_address for that.

>
> 2. Currently the GICv3 Rdist address is hardcoded for 2nd core but in
> ideal case we should find it based on MPIDR value as done in jailhouse
> inmate demo. I'm getting faults while trying to read MPIDR_EL1 system
> register, so need to debug it. 
>

Sounds promising! Maybe I will find some time to give it a try during
the holiday season.

Jan

Mani Sadhasivam

unread,
Dec 18, 2019, 1:45:43 PM12/18/19
to Jan Kiszka, Jailhouse, Peng Fan
Hi,

Yes, this helps :)
 

>
> 2. Currently the GICv3 Rdist address is hardcoded for 2nd core but in
> ideal case we should find it based on MPIDR value as done in jailhouse
> inmate demo. I'm getting faults while trying to read MPIDR_EL1 system
> register, so need to debug it. 
>

Sounds promising! Maybe I will find some time to give it a try during
the holiday season.

I have fixed the above mentioned issues and now Zephyr can fully run
as a Jailhouse inmate on IMX8MM.


Thanks,
Mani
 

Jan
Reply all
Reply to author
Forward
0 new messages