Obvious what happens here: Align the root cell template.

Signed-off-by: Ralf Ramsauer <[email protected]>
---
 tools/jailhouse-cell-linux    |  2 +-
 tools/root-cell-config.c.tmpl | 22 +++++++++-------------
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/tools/jailhouse-cell-linux b/tools/jailhouse-cell-linux
index 49babd92..160b8869 100755
--- a/tools/jailhouse-cell-linux
+++ b/tools/jailhouse-cell-linux
@@ -565,7 +565,7 @@ class Irqchip:
 
 class Config:
     _HEADER_FORMAT = '6sH32s4xIIIIIIIIIQ8x32x'
-    _HEADER_REVISION = 10
+    _HEADER_REVISION = 11
 
     def __init__(self, config_file):
         self.data = config_file.read()
diff --git a/tools/root-cell-config.c.tmpl b/tools/root-cell-config.c.tmpl
index 512b9f0d..d24a3666 100644
--- a/tools/root-cell-config.c.tmpl
+++ b/tools/root-cell-config.c.tmpl
@@ -47,7 +47,7 @@ struct {
        __u64 cpus[${int((cpucount + 63) / 64)}];
        struct jailhouse_memory mem_regions[${len(regions)}];
        struct jailhouse_irqchip irqchips[${len(irqchips)}];
-       __u8 pio_bitmap[0x2000];
+       struct jailhouse_pio pio_regions[6];
        struct jailhouse_pci_device pci_devices[${len(pcidevices)}];
        struct jailhouse_pci_capability pci_caps[${len(pcicaps)}];
 } __attribute__((packed)) config = {
@@ -109,7 +109,7 @@ struct {
                        .cpu_set_size = sizeof(config.cpus),
                        .num_memory_regions = ARRAY_SIZE(config.mem_regions),
                        .num_irqchips = ARRAY_SIZE(config.irqchips),
-                       .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap),
+                       .num_pio_regions = ARRAY_SIZE(config.pio_regions),
                        .num_pci_devices = ARRAY_SIZE(config.pci_devices),
                        .num_pci_caps = ARRAY_SIZE(config.pci_caps),
                },
@@ -152,17 +152,13 @@ struct {
                % endfor
        },
 
-       .pio_bitmap = {
-               [     0/8 ...   0x3f/8] = -1,
-               [  0x40/8 ...   0x47/8] = 0xf0, /* PIT */
-               [  0x48/8 ...   0x5f/8] = -1,
-               [  0x60/8 ...   0x67/8] = 0xec, /* HACK: NMI status/control */
-               [  0x68/8 ...   0x6f/8] = -1,
-               [  0x70/8 ...   0x77/8] = 0xfc, /* RTC */
-               [  0x78/8 ...  0x3af/8] = -1,
-               [ 0x3b0/8 ...  0x3df/8] = 0x00, /* VGA */
-               [ 0x3e0/8 ...  0xcff/8] = -1,
-               [ 0xd00/8 ... 0xffff/8] = 0, /* HACK: PCI bus */
+       .pio_regions = {
+               PIO_RANGE(0x40, 4), /* PIT */
+               PIO_RANGE(0x60, 2), /* HACK: NMI status/control */
+               PIO_RANGE(0x64, 1), /* I8042 */
+               PIO_RANGE(0x70, 2), /* RTC */
+               PIO_RANGE(0x3b0, 0x30), /* VGA */
+               PIO_RANGE(0xd00, 0xf300), /* HACK: PCI bus */
        },
 
        .pci_devices = {
-- 
2.22.0

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/20190725171123.9266-5-ralf.ramsauer%40oth-regensburg.de.

Reply via email to