From: Jan Kiszka <[email protected]> Stresses PCI device assignment, including MSI-X. Now the earlier introduced PCI device reset comes into play as it safes Linux from stumbling over unmasked but unused vectors of the device.
In order to reuse the configuration on physical hosts, the QEMU device is opt-in, to be enabled in config.h via CONFIG_QEMU_E1000E_ASSIGNMENT. Signed-off-by: Jan Kiszka <[email protected]> --- configs/linux-x86-demo.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/configs/linux-x86-demo.c b/configs/linux-x86-demo.c index f98a7c6..b1f829a 100644 --- a/configs/linux-x86-demo.c +++ b/configs/linux-x86-demo.c @@ -20,10 +20,19 @@ struct { struct jailhouse_cell_desc cell; __u64 cpus[1]; +#ifdef CONFIG_QEMU_E1000E_ASSIGNMENT + struct jailhouse_memory mem_regions[8]; +#else struct jailhouse_memory mem_regions[4]; +#endif struct jailhouse_cache cache_regions[1]; __u8 pio_bitmap[0x2000]; +#ifdef CONFIG_QEMU_E1000E_ASSIGNMENT + struct jailhouse_pci_device pci_devices[2]; +#else struct jailhouse_pci_device pci_devices[1]; +#endif + struct jailhouse_pci_capability pci_caps[6]; } __attribute__((packed)) config = { .cell = { .signature = JAILHOUSE_CELL_DESC_SIGNATURE, @@ -37,7 +46,7 @@ struct { .num_irqchips = 0, .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap), .num_pci_devices = ARRAY_SIZE(config.pci_devices), - .num_pci_caps = 0, + .num_pci_caps = ARRAY_SIZE(config.pci_caps), }, .cpus = { @@ -75,6 +84,36 @@ struct { .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_ROOTSHARED, }, +#ifdef CONFIG_QEMU_E1000E_ASSIGNMENT + /* MemRegion: feb40000-feb7ffff : 0000:00:02.0 */ + { + .phys_start = 0xfeb40000, + .virt_start = 0xfeb40000, + .size = 0x40000, + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE, + }, + /* MemRegion: feb80000-feb9ffff : e1000e */ + { + .phys_start = 0xfeb80000, + .virt_start = 0xfeb80000, + .size = 0x20000, + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE, + }, + /* MemRegion: feba0000-febbffff : e1000e */ + { + .phys_start = 0xfeba0000, + .virt_start = 0xfeba0000, + .size = 0x20000, + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE, + }, + /* MemRegion: febd1000-febd3fff : e1000e */ + { + .phys_start = 0xfebd1000, + .virt_start = 0xfebd1000, + .size = 0x3000, + .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE, + }, +#endif }, .cache_regions = { @@ -106,5 +145,62 @@ struct { .shmem_region = 3, .shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH, }, +#ifdef CONFIG_QEMU_E1000E_ASSIGNMENT + { /* e1000e */ + .type = JAILHOUSE_PCI_TYPE_DEVICE, + .domain = 0x0000, + .bdf = 0x0010, + .bar_mask = { + 0xfffe0000, 0xfffe0000, 0xffffffe0, + 0xffffc000, 0x00000000, 0x00000000, + }, + .caps_start = 0, + .num_caps = 6, + .num_msi_vectors = 1, + .msi_64bits = 1, + .num_msix_vectors = 5, + .msix_region_size = 0x1000, + .msix_address = 0xfebd0000, + }, +#endif }, + + .pci_caps = { + { /* e1000e */ + .id = 0x1, + .start = 0xc8, + .len = 8, + .flags = JAILHOUSE_PCICAPS_WRITE, + }, + { + .id = 0x5, + .start = 0xd0, + .len = 14, + .flags = JAILHOUSE_PCICAPS_WRITE, + }, + { + .id = 0x10, + .start = 0xe0, + .len = 20, + .flags = JAILHOUSE_PCICAPS_WRITE, + }, + { + .id = 0x11, + .start = 0xa0, + .len = 12, + .flags = JAILHOUSE_PCICAPS_WRITE, + }, + { + .id = 0x1 | JAILHOUSE_PCI_EXT_CAP, + .start = 0x100, + .len = 4, + .flags = 0, + }, + { + .id = 0x3 | JAILHOUSE_PCI_EXT_CAP, + .start = 0x140, + .len = 4, + .flags = 0, + }, + } }; -- 2.1.4 -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
