[PATCH 2/5] inmates: x86: move cmdline section to 0x1000

5 views
Skip to first unread message

Ralf Ramsauer

unread,
May 22, 2018, 10:19:34 AM5/22/18
to jailho...@googlegroups.com, Jan Kiszka, Ralf Ramsauer
Now all architectures use the same address for the cmdline section to
ease the use of the cmdline.

Signed-off-by: Ralf Ramsauer <ralf.r...@oth-regensburg.de>
---
Documentation/debug-output.md | 2 +-
inmates/lib/x86/inmate.lds | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/debug-output.md b/Documentation/debug-output.md
index fda38680..e0a7ff31 100644
--- a/Documentation/debug-output.md
+++ b/Documentation/debug-output.md
@@ -146,7 +146,7 @@ Example command line parameters for PIO based debug output on x86, where the
inmate will initialise UART:

jailhouse cell load foocell inmate.bin \
- -s "con-base=0x3f8 con-divider=1" -a 0x100
+ -s "con-base=0x3f8 con-divider=1" -a 0x1000

Example configuration for MMIO based debug output on ARM using the 8250 driver:

diff --git a/inmates/lib/x86/inmate.lds b/inmates/lib/x86/inmate.lds
index 526cf3b6..95c6ec97 100644
--- a/inmates/lib/x86/inmate.lds
+++ b/inmates/lib/x86/inmate.lds
@@ -41,7 +41,7 @@ SECTIONS
. = 0;
.boot : { *(.boot) }

- . = 0x100;
+ . = 0x1000;
.cmdline : {
*(.cmdline)
BYTE(0); /* empty string in case no buffer is provided */
--
2.17.0

Ralf Ramsauer

unread,
May 22, 2018, 10:22:57 AM5/22/18
to jailho...@googlegroups.com, Jan Kiszka
Hi,

I'm missing one thing here: maintaining the linux loader for x86, as I
don't understand this piece in jailhouse-cell-linux:

class X86:
[...]
def params_address(self):
return self._cpu_reset_address + 0x6000

Why is the params_address _cpu_reset_address + 0x6000 at the moment? I
would expect + 0x100...

Thanks
Ralf

Jan Kiszka

unread,
May 22, 2018, 10:25:02 AM5/22/18
to Ralf Ramsauer, jailho...@googlegroups.com
There is some reference to this address in README.md as well. [And I
will have to update jailhouse-images - that's a note to myself]

You already noticed that the linux loader requires an update as well.

Jan

Jan Kiszka

unread,
May 22, 2018, 10:27:36 AM5/22/18
to Ralf Ramsauer, jailho...@googlegroups.com
On 2018-05-22 16:22, Ralf Ramsauer wrote:
> Hi,
>
> I'm missing one thing here: maintaining the linux loader for x86, as I
> don't understand this piece in jailhouse-cell-linux:
>
> class X86:
> [...]
> def params_address(self):
> return self._cpu_reset_address + 0x6000
>
> Why is the params_address _cpu_reset_address + 0x6000 at the moment? I
> would expect + 0x100...

These params are not the command line (the loader stub used none), it's
the Zero Page and related data for the kernel boot protocol. See also
ZERO_PAGE_ADDR = HEAP_BASE = hmmm... typically 0x6000. Looks like this
address dates back from a more stable memory layout on x86 (prio to
moving to reset address 0).

Jan

Ralf Ramsauer

unread,
May 22, 2018, 10:30:00 AM5/22/18
to Jan Kiszka, jailho...@googlegroups.com


On 05/22/2018 04:27 PM, Jan Kiszka wrote:
> On 2018-05-22 16:22, Ralf Ramsauer wrote:
>> Hi,
>>
>> I'm missing one thing here: maintaining the linux loader for x86, as I
>> don't understand this piece in jailhouse-cell-linux:
>>
>> class X86:
>> [...]
>> def params_address(self):
>> return self._cpu_reset_address + 0x6000
>>
>> Why is the params_address _cpu_reset_address + 0x6000 at the moment? I
>> would expect + 0x100...
>
> These params are not the command line (the loader stub used none), it's
> the Zero Page and related data for the kernel boot protocol. See also
> ZERO_PAGE_ADDR = HEAP_BASE = hmmm... typically 0x6000. Looks like this
> address dates back from a more stable memory layout on x86 (prio to
> moving to reset address 0).

Ahh, okay. This is a bit confusing, as the semantics of params_address()
for x86 are different from the other architectures.

So everything should be fine -- including x86.

Thanks
Ralf

Jan Kiszka

unread,
May 22, 2018, 10:31:01 AM5/22/18
to Ralf Ramsauer, jailho...@googlegroups.com
On 2018-05-22 16:29, Ralf Ramsauer wrote:
>
>
> On 05/22/2018 04:27 PM, Jan Kiszka wrote:
>> On 2018-05-22 16:22, Ralf Ramsauer wrote:
>>> Hi,
>>>
>>> I'm missing one thing here: maintaining the linux loader for x86, as I
>>> don't understand this piece in jailhouse-cell-linux:
>>>
>>> class X86:
>>> [...]
>>> def params_address(self):
>>> return self._cpu_reset_address + 0x6000
>>>
>>> Why is the params_address _cpu_reset_address + 0x6000 at the moment? I
>>> would expect + 0x100...
>>
>> These params are not the command line (the loader stub used none), it's
>> the Zero Page and related data for the kernel boot protocol. See also
>> ZERO_PAGE_ADDR = HEAP_BASE = hmmm... typically 0x6000. Looks like this
>> address dates back from a more stable memory layout on x86 (prio to
>> moving to reset address 0).
>
> Ahh, okay. This is a bit confusing, as the semantics of params_address()
> for x86 are different from the other architectures.
>

Yeah.

> So everything should be fine -- including x86.
>

Likely. Testing would be good, though.

Jan

Ralf Ramsauer

unread,
May 22, 2018, 4:19:47 PM5/22/18
to Jan Kiszka, jailho...@googlegroups.com, Ralf Ramsauer
Now all architectures use the same address for the cmdline section to
ease the use of the cmdline.

Signed-off-by: Ralf Ramsauer <ralf.r...@oth-regensburg.de>
---

since v1: align README.md

Documentation/debug-output.md | 2 +-
README.md | 4 ++--
inmates/lib/x86/inmate.lds | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/debug-output.md b/Documentation/debug-output.md
index fda38680..e0a7ff31 100644
--- a/Documentation/debug-output.md
+++ b/Documentation/debug-output.md
@@ -146,7 +146,7 @@ Example command line parameters for PIO based debug output on x86, where the
inmate will initialise UART:

jailhouse cell load foocell inmate.bin \
- -s "con-base=0x3f8 con-divider=1" -a 0x100
+ -s "con-base=0x3f8 con-divider=1" -a 0x1000

Example configuration for MMIO based debug output on ARM using the 8250 driver:

diff --git a/README.md b/README.md
index 1e8433a7..ca90ca35 100644
--- a/README.md
+++ b/README.md
@@ -338,7 +338,7 @@ commands:

jailhouse cell create /path/to/pci-demo.cell
jailhouse cell load pci-demo /path/to/pci-demo.bin \
- -s "con-base=0x2f8" -a 0x100
+ -s "con-base=0x2f8" -a 0x1000
jailhouse cell start pci-demo

The pci-demo will use the second serial port provided by QEMU. You will find
@@ -351,7 +351,7 @@ reload and restart the tiny-demo, issue the following commands:

jailhouse cell start apic-demo
jailhouse cell load pci-demo /path/to/pci-demo.bin \
- -s "con-base=0x2f8" -a 0x100
+ -s "con-base=0x2f8" -a 0x1000
jailhouse cell start pci-demo

Finally, Jailhouse is can be stopped completely again:
Reply all
Reply to author
Forward
0 new messages