Issue: Invalid argument

223 views
Skip to first unread message

Sophie Sanger

unread,
Nov 3, 2015, 7:10:49 AM11/3/15
to jailho...@googlegroups.com
Hi,

after running jailhouse in qemu, I wanted to test it on real hardware .
The setup is a IMB-A180-H board (AMD) with a 4.2.5 kernel (Arch Linux)
Memory was mapped according to imb-a180.c (memmap=0x4200000$0x3b000000)

Enabling the provided imb-a180.cell, however fails with
JAILHOUSE_ENABLE: Invalid argument

The serial output is
Initializing Jailhouse hypervisor v0.5 (132-g61a1b18) on CPU 0
Code location: 0xfffffffff0000030
Using xAPIC
Page pool usage after early setup: mem 43/16353, remap 65/131072
Initializing processors:
CPU 0... (APIC ID 0) OK
CPU 1... (APIC ID 1) OK



As I can not run the script for generating the configuration (no IOMMU),
I'm not sure how to proceed.

Is there either a way to generate a basic config file nevertheless or to
get a more detailed error message to modify the provided cell
accordingly ?


Thanks
Sophie

Valentine Sinitsyn

unread,
Nov 3, 2015, 7:35:13 AM11/3/15
to Sophie Sanger, jailho...@googlegroups.com
Hi Sopie,
Grep the script for IOMMU error you see and change exception to return.
Alternatively, define CONFIG_TRACE_ERROR in
hypervisor/include/jailhouse/config.h to see, where the error happens,
and send it here.


Regards,
Valentine

Sophie Sanger

unread,
Nov 3, 2015, 11:17:36 AM11/3/15
to jailho...@googlegroups.com
> Grep the script for IOMMU error you see and change exception to return.
The error I get from the script is
FileNotFoundError: [Errno 2] No such file or directory:
'//sys/firmware/acpi/tables/IVRS'

Not sure if disabling the ivrs parsing makes any sense, but enabling the
resulting cell fails with

Initializing Jailhouse hypervisor v0.5 (132-g61a1b18) on CPU 1
Code location: 0xfffffffff0000030
Using xAPIC
Page pool usage after early setup: mem 35/16353, remap 33/131072
Initializing processors:
CPU 1... (APIC ID 1) OK
CPU 0... (APIC ID 0) OK
WARNING: AMD IOMMU support is not implemented yet
Adding PCI device 00:00.0 to cell "RootCell"
Adding PCI device 00:01.0 to cell "RootCell"
Adding PCI device 00:01.1 to cell "RootCell"
Adding PCI device 00:02.0 to cell "RootCell"
Adding PCI device 00:02.3 to cell "RootCell"
Adding PCI device 00:02.4 to cell "RootCell"
Adding PCI device 00:10.0 to cell "RootCell"
Adding PCI device 00:11.0 to cell "RootCell"
Adding PCI device 00:12.0 to cell "RootCell"
Adding PCI device 00:12.2 to cell "RootCell"
Adding PCI device 00:13.0 to cell "RootCell"
Adding PCI device 00:13.2 to cell "RootCell"
Adding PCI device 00:14.0 to cell "RootCell"
Adding PCI device 00:14.2 to cell "RootCell"
Adding PCI device 00:14.3 to cell "RootCell"
Adding PCI device 00:18.0 to cell "RootCell"
Adding PCI device 00:18.1 to cell "RootCell"
Adding PCI device 00:18.2 to cell "RootCell"
Adding PCI device 00:18.3 to cell "RootCell"
Adding PCI device 00:18.4 to cell "RootCell"
Adding PCI device 00:18.5 to cell "RootCell"
Adding PCI device 01:00.0 to cell "RootCell"
Adding PCI device 01:00.1 to cell "RootCell"
Adding PCI device 01:00.2 to cell "RootCell"
Adding PCI device 01:00.3 to cell "RootCell"
Adding PCI device 02:00.0 to cell "RootCell"
Page pool usage after late setup: mem 181/16353, remap 65577/131072
ActivaFATAL: Invalid PIO read, port: 414 size: 1
RIP: 0xffffffffa016c65d RSP: 0xffffffff81803dc8 FLAGS: 93
RAX: 0x4ec4ec4ec4ec4e00 RBX: 0xffff88013a88a890 RCX: 0x0000000000000017
RDX: 0x0000000000000414 RSI: 0xffffffffa01710a0 RDI: 0xffff88013a88a890
CS: 10 BASE: 0x0000000000000000 AR-BYTES: a9b EFER.LMA 1
CR0: 0x0000000080050033 CR3: 0x0000000098cef000 CR4: 0x00000000000406f0
EFER: 0x0000000000001d01
Parking CPU 0 (Cell: "RootCell")


> Alternatively, define CONFIG_TRACE_ERROR in
> hypervisor/include/jailhouse/config.h to see, where the error happens,
> and send it here.
Unfortunately setting CONFIG_TRACE_ERROR doesn't change anything.

Valentine Sinitsyn

unread,
Nov 3, 2015, 12:04:54 PM11/3/15
to Sophie Sanger, jailho...@googlegroups.com
Hi Sophie,

(sorry I misspelled your name last time)

On 03.11.2015 21:17, Sophie Sanger wrote:
>> Grep the script for IOMMU error you see and change exception to return.
> The error I get from the script is
> FileNotFoundError: [Errno 2] No such file or directory:
> '//sys/firmware/acpi/tables/IVRS'
>
> Not sure if disabling the ivrs parsing makes any sense, but enabling the
It does; you don't have an IOMMU, and Jailhouse doesn't support AMD
IOMMU in master/next.
You need to adjust pio_bitmap. Maybe even start with it equal to {0}
(everything permitted).
>
>
>> Alternatively, define CONFIG_TRACE_ERROR in
>> hypervisor/include/jailhouse/config.h to see, where the error happens,
>> and send it here.
> Unfortunately setting CONFIG_TRACE_ERROR doesn't change anything.
Did you recompile Jailhouse and reinstall the image after that? Given
the last output, I'd suspect your CPU has two cores, mine had four. So
Jailhouse complained about invalid CPU ID somewhere in bitmaps.

Valentine

Jan Kiszka

unread,
Nov 3, 2015, 12:26:28 PM11/3/15
to Sophie Sanger, jailho...@googlegroups.com
The kernel wants to access IO port 414h - see /proc/ioports for what is
behind it. You need to tune the pio_bitmap in the config to allow this
access (and maybe more) in order to keep the root cell running.

IO ports are not yet processed by the config generator, so get it
running won't help for this case.

Jan

> RIP: 0xffffffffa016c65d RSP: 0xffffffff81803dc8 FLAGS: 93
> RAX: 0x4ec4ec4ec4ec4e00 RBX: 0xffff88013a88a890 RCX: 0x0000000000000017
> RDX: 0x0000000000000414 RSI: 0xffffffffa01710a0 RDI: 0xffff88013a88a890
> CS: 10 BASE: 0x0000000000000000 AR-BYTES: a9b EFER.LMA 1
> CR0: 0x0000000080050033 CR3: 0x0000000098cef000 CR4: 0x00000000000406f0
> EFER: 0x0000000000001d01
> Parking CPU 0 (Cell: "RootCell")
>
>
>> Alternatively, define CONFIG_TRACE_ERROR in
>> hypervisor/include/jailhouse/config.h to see, where the error happens,
>> and send it here.
> Unfortunately setting CONFIG_TRACE_ERROR doesn't change anything.
>

--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux

Sophie Sanger

unread,
Nov 5, 2015, 9:23:57 AM11/5/15
to jailho...@googlegroups.com
Thanks.
The hypervisor does indeed start after setting
[ 0x3e0/8 ... 0xcff/8 ] = 0

If I then try to create the cell for the apic-cemo however, I get a
JAILHOUSE_CELL_CREATE: Device or resource busy

Am I right to assume that this is still due to an incorrect pio_bitmap,
or is this an unrelated error?


My /proc/ioports:

0000-03af : PCI Bus 0000:00
0000-001f : dma1
0020-0021 : pic1
0040-0043 : timer0
0050-0053 : timer1
0060-0060 : keyboard
0061-0061 : PNP0800:00
0064-0064 : keyboard
0070-0071 : rtc0
0080-008f : dma page reg
00a0-00a1 : pic2
00c0-00df : dma2
00f0-00ff : PNP0C04:00
00f0-00ff : fpu
0290-0297 : pnp 00:02
02e8-02ef : serial
02f8-02ff : serial
0378-037a : parport0
037b-037f : parport0
03b0-03df : PCI Bus 0000:00
03e0-0cf7 : PCI Bus 0000:00
03e8-03ef : serial
03f8-03ff : serial
040b-040b : pnp 00:0d
04d0-04d1 : pnp 00:0c
04d0-04d1 : pnp 00:0d
04d6-04d6 : pnp 00:0d
0800-0803 : ACPI PM1a_EVT_BLK
0804-0805 : ACPI PM1a_CNT_BLK
0808-080b : ACPI PM_TMR
0810-0815 : ACPI CPU throttle
0820-0827 : ACPI GPE0_BLK
0900-090f : pnp 00:0d
0910-091f : pnp 00:0d
0b00-0b07 : piix4_smbus
0b20-0b3f : pnp 00:0d
0b20-0b27 : piix4_smbus
0c00-0c01 : pnp 00:0d
0c14-0c14 : pnp 00:0d
0c50-0c51 : pnp 00:0d
0c52-0c52 : pnp 00:0d
0c6c-0c6c : pnp 00:0d
0c6f-0c6f : pnp 00:0d
0cd0-0cd1 : pnp 00:0d
0cd2-0cd3 : pnp 00:0d
0cd4-0cd5 : pnp 00:0d
0cd6-0cd7 : pnp 00:0d
0cd8-0cdf : pnp 00:0d
0cf8-0cff : PCI conf1
0d00-ffff : PCI Bus 0000:00
d000-dfff : PCI Bus 0000:02
d000-d0ff : 0000:02:00.0
d000-d0ff : r8169
e000-efff : PCI Bus 0000:01
e000-e0ff : 0000:01:00.3
e400-e4ff : 0000:01:00.2
e800-e8ff : 0000:01:00.1
ec00-ecff : 0000:01:00.0
ec00-ecff : r8169
f000-f0ff : 0000:00:01.0
f100-f10f : 0000:00:11.0
f100-f10f : ahci
f110-f113 : 0000:00:11.0
f110-f113 : ahci
f120-f127 : 0000:00:11.0
f120-f127 : ahci
f130-f133 : 0000:00:11.0
f130-f133 : ahci
f140-f147 : 0000:00:11.0
f140-f147 : ahci
fe00-fefe : pnp 00:0d

Jan Kiszka

unread,
Nov 5, 2015, 9:32:23 AM11/5/15
to Sophie Sanger, jailho...@googlegroups.com
That's a little bit too much (/wrt isolation) but ok for now.

>
> If I then try to create the cell for the apic-cemo however, I get a
> JAILHOUSE_CELL_CREATE: Device or resource busy
>
> Am I right to assume that this is still due to an incorrect pio_bitmap,
> or is this an unrelated error?

Your CPU only has 2 cores, right? Then you need to change the
apic-demo.c config to run the demo on core 1 instead of (non-existent)
core 3.

Jan
Reply all
Reply to author
Forward
0 new messages