We will reuse them non-x86 architectures.

Signed-off-by: Jan Kiszka <[email protected]>
---
 configs/f2a88xm-hd3.c                      | 26 +++++++++++---------
 configs/h87i.c                             | 26 +++++++++++---------
 configs/imb-a180.c                         | 10 +++++---
 configs/qemu-vm.c                          | 18 ++++++++------
 hypervisor/include/jailhouse/cell-config.h | 39 ++++++++++++++++--------------
 hypervisor/pci.c                           |  6 ++---
 tools/root-cell-config.c.tmpl              | 38 +++++++++++++++--------------
 7 files changed, 88 insertions(+), 75 deletions(-)

diff --git a/configs/f2a88xm-hd3.c b/configs/f2a88xm-hd3.c
index b7926bc..4963ee0 100644
--- a/configs/f2a88xm-hd3.c
+++ b/configs/f2a88xm-hd3.c
@@ -40,18 +40,20 @@ struct {
                .debug_console = {
                        .phys_start = 0x3f8,
                },
-               .platform_info.x86 = {
-                       .mmconfig_base = 0xe0000000,
-                       .mmconfig_end_bus = 0xff,
-                       .pm_timer_address = 0x808,
-                       .iommu_units = {
-                               {
-                                       .base = 0xfeb80000,
-                                       .size = 0x80000,
-                                       .amd_bdf = 0x02,
-                                       .amd_base_cap = 0x40,
-                                       .amd_msi_cap = 0x54,
-                                       .amd_features = 0x80048824,
+               .platform_info = {
+                       .pci_mmconfig_base = 0xe0000000,
+                       .pci_mmconfig_end_bus = 0xff,
+                       .x86 = {
+                               .pm_timer_address = 0x808,
+                               .iommu_units = {
+                                       {
+                                               .base = 0xfeb80000,
+                                               .size = 0x80000,
+                                               .amd_bdf = 0x02,
+                                               .amd_base_cap = 0x40,
+                                               .amd_msi_cap = 0x54,
+                                               .amd_features = 0x80048824,
+                                       },
                                },
                        },
                },
diff --git a/configs/h87i.c b/configs/h87i.c
index 7f0407c..7aed2cf 100644
--- a/configs/h87i.c
+++ b/configs/h87i.c
@@ -35,18 +35,20 @@ struct {
                .debug_console = {
                        .phys_start = 0xe010,
                },
-               .platform_info.x86 = {
-                       .mmconfig_base = 0xf8000000,
-                       .mmconfig_end_bus = 0x3f,
-                       .pm_timer_address = 0x1808,
-                       .iommu_units = {
-                               {
-                                       .base = 0xfed90000,
-                                       .size = 0x1000,
-                               },
-                               {
-                                       .base = 0xfed91000,
-                                       .size = 0x1000,
+               .platform_info = {
+                       .pci_mmconfig_base = 0xf8000000,
+                       .pci_mmconfig_end_bus = 0x3f,
+                       .x86 = {
+                               .pm_timer_address = 0x1808,
+                               .iommu_units = {
+                                       {
+                                               .base = 0xfed90000,
+                                               .size = 0x1000,
+                                       },
+                                       {
+                                               .base = 0xfed91000,
+                                               .size = 0x1000,
+                                       },
                                },
                        },
                },
diff --git a/configs/imb-a180.c b/configs/imb-a180.c
index 0b23dae..8a67bdd 100644
--- a/configs/imb-a180.c
+++ b/configs/imb-a180.c
@@ -39,10 +39,12 @@ struct {
                .debug_console = {
                        .phys_start = 0x3f8,
                },
-               .platform_info.x86 = {
-                       .mmconfig_base = 0xe0000000,
-                       .mmconfig_end_bus = 0xff,
-                       .pm_timer_address = 0x808,
+               .platform_info = {
+                       .pci_mmconfig_base = 0xe0000000,
+                       .pci_mmconfig_end_bus = 0xff,
+                       .x86 = {
+                               .pm_timer_address = 0x808,
+                       },
                },
                .root_cell = {
                        .name = "IMB-A180",
diff --git a/configs/qemu-vm.c b/configs/qemu-vm.c
index 5f5b0b6..3bc7625 100644
--- a/configs/qemu-vm.c
+++ b/configs/qemu-vm.c
@@ -49,14 +49,16 @@ struct {
                .debug_console = {
                        .phys_start = 0x3f8,
                },
-               .platform_info.x86 = {
-                       .mmconfig_base = 0xb0000000,
-                       .mmconfig_end_bus = 0xff,
-                       .pm_timer_address = 0x608,
-                       .iommu_units = {
-                               {
-                                       .base = 0xfed90000,
-                                       .size = 0x1000,
+               .platform_info = {
+                       .pci_mmconfig_base = 0xb0000000,
+                       .pci_mmconfig_end_bus = 0xff,
+                       .x86 = {
+                               .pm_timer_address = 0x608,
+                               .iommu_units = {
+                                       {
+                                               .base = 0xfed90000,
+                                               .size = 0x1000,
+                                       },
                                },
                        },
                },
diff --git a/hypervisor/include/jailhouse/cell-config.h 
b/hypervisor/include/jailhouse/cell-config.h
index a139f97..75f5ea4 100644
--- a/hypervisor/include/jailhouse/cell-config.h
+++ b/hypervisor/include/jailhouse/cell-config.h
@@ -175,24 +175,27 @@ struct jailhouse_system {
        /** Jailhouse's location in memory */
        struct jailhouse_memory hypervisor_memory;
        struct jailhouse_memory debug_console;
-       union {
-               struct {
-                       __u64 mmconfig_base;
-                       __u8 mmconfig_end_bus;
-                       __u8 padding[5];
-                       __u16 pm_timer_address;
-                       struct jailhouse_iommu
-                               iommu_units[JAILHOUSE_MAX_IOMMU_UNITS];
-               } __attribute__((packed)) x86;
-               struct {
-                       u64 gicd_base;
-                       u64 gicc_base;
-                       u64 gich_base;
-                       u64 gicv_base;
-                       u64 gicr_base;
-                       u8 maintenance_irq;
-                       u8 padding[3];
-               } __attribute__((packed)) arm;
+       struct {
+               __u64 pci_mmconfig_base;
+               __u8 pci_mmconfig_end_bus;
+               __u8 padding;
+               union {
+                       struct {
+                               __u16 pm_timer_address;
+                               __u8 padding[4];
+                               struct jailhouse_iommu
+                                       iommu_units[JAILHOUSE_MAX_IOMMU_UNITS];
+                       } __attribute__((packed)) x86;
+                       struct {
+                               u64 gicd_base;
+                               u64 gicc_base;
+                               u64 gich_base;
+                               u64 gicv_base;
+                               u64 gicr_base;
+                               u8 maintenance_irq;
+                               u8 padding[3];
+                       } __attribute__((packed)) arm;
+               } __attribute__((packed));
        } __attribute__((packed)) platform_info;
        __u32 interrupt_limit;
        struct jailhouse_cell_desc root_cell;
diff --git a/hypervisor/pci.c b/hypervisor/pci.c
index d92ce3b..8567788 100644
--- a/hypervisor/pci.c
+++ b/hypervisor/pci.c
@@ -72,7 +72,7 @@ unsigned int pci_mmio_count_regions(struct cell *cell)
                jailhouse_cell_pci_devices(cell->config);
        unsigned int n, regions = 0;
 
-       if (system_config->platform_info.x86.mmconfig_base)
+       if (system_config->platform_info.pci_mmconfig_base)
                regions++;
 
        for (n = 0; n < cell->config->num_pci_devices; n++)
@@ -359,9 +359,9 @@ enum pci_access pci_cfg_write_moderate(struct pci_device 
*device, u16 address,
  */
 int pci_init(void)
 {
-       mmcfg_start = system_config->platform_info.x86.mmconfig_base;
+       mmcfg_start = system_config->platform_info.pci_mmconfig_base;
        if (mmcfg_start != 0) {
-               end_bus = system_config->platform_info.x86.mmconfig_end_bus;
+               end_bus = system_config->platform_info.pci_mmconfig_end_bus;
                mmcfg_size = (end_bus + 1) * 256 * 4096;
 
                pci_space = paging_map_device(mmcfg_start, mmcfg_size);
diff --git a/tools/root-cell-config.c.tmpl b/tools/root-cell-config.c.tmpl
index b4522ef..6a271c7 100644
--- a/tools/root-cell-config.c.tmpl
+++ b/tools/root-cell-config.c.tmpl
@@ -62,26 +62,28 @@ struct {
                .debug_console = {
                        .phys_start = 0x3f8,
                },
-               .platform_info.x86 = {
-                       .mmconfig_base = ${hex(mmconfig.base)},
-                       .mmconfig_end_bus = ${hex(mmconfig.end_bus)},
-                       .pm_timer_address = ${hex(pm_timer_base)},
-                       % if iommu_units:
-                       .iommu_units = {
-                               % for unit in iommu_units:
-                               {
-                                       .base = ${hex(unit.base_addr)},
-                                       .size = ${hex(unit.mmio_size)},
-                                       % if unit.is_amd_iommu:
-                                       .amd_bdf = ${hex(unit.amd_bdf)},
-                                       .amd_base_cap = 
${hex(unit.amd_base_cap)},
-                                       .amd_msi_cap = ${hex(unit.amd_msi_cap)},
-                                       .amd_features = 
${hex(unit.amd_features)},
-                                       % endif
+               .platform_info = {
+                       .pci_mmconfig_base = ${hex(mmconfig.base)},
+                       .pci_mmconfig_end_bus = ${hex(mmconfig.end_bus)},
+                       .x86 = {
+                               .pm_timer_address = ${hex(pm_timer_base)},
+                               % if iommu_units:
+                               .iommu_units = {
+                                       % for unit in iommu_units:
+                                       {
+                                               .base = ${hex(unit.base_addr)},
+                                               .size = ${hex(unit.mmio_size)},
+                                               % if unit.is_amd_iommu:
+                                               .amd_bdf = ${hex(unit.amd_bdf)},
+                                               .amd_base_cap = 
${hex(unit.amd_base_cap)},
+                                               .amd_msi_cap = 
${hex(unit.amd_msi_cap)},
+                                               .amd_features = 
${hex(unit.amd_features)},
+                                               % endif
+                                       },
+                                       % endfor
                                },
-                               % endfor
+                               % endif
                        },
-                       % endif
                },
                .interrupt_limit = 256,
                .root_cell = {
-- 
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.

Reply via email to