]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core: Adapt config structures for non-Intel IOMMU
authorValentine Sinitsyn <valentine.sinitsyn@gmail.com>
Wed, 11 Mar 2015 19:36:13 +0000 (00:36 +0500)
committerJan Kiszka <jan.kiszka@siemens.com>
Fri, 20 Mar 2015 06:10:39 +0000 (07:10 +0100)
Rename dmar_units_base to iommu_base, and JAILHOUSE_MAX_DMAR_UNITS to
JAILHOUSE_MAX_IOMMU_UNITS.

Update configuration files and root cell config template to account for
new cell definition parameters names.

Signed-off-by: Valentine Sinitsyn <valentine.sinitsyn@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
configs/h87i.c
configs/qemu-vm.c
hypervisor/arch/x86/vtd.c
hypervisor/include/jailhouse/cell-config.h
tools/jailhouse-config-create
tools/root-cell-config.c.tmpl

index 92b1989ada1d6c1fc5dae966092afa4077f56cf3..c5473ac1e56501b52b95220bb48d32bc91768c31 100644 (file)
@@ -35,7 +35,7 @@ struct {
                        .mmconfig_base = 0xf8000000,
                        .mmconfig_end_bus = 0x3f,
                        .pm_timer_address = 0x1808,
-                       .dmar_unit_base = {
+                       .iommu_base = {
                                0xfed90000,
                                0xfed91000,
                        },
index b11bc9eb9877f7f924b7a6ce5e5637c167c3677f..3a9f3099841c9928032bc1c1dba58e334aa5a676 100644 (file)
@@ -47,7 +47,7 @@ struct {
                        .mmconfig_base = 0xb0000000,
                        .mmconfig_end_bus = 0xff,
                        .pm_timer_address = 0x608,
-                       .dmar_unit_base = {
+                       .iommu_base = {
                                0xfed90000,
                        },
                },
index e1aad59dd4fd2cd4eb02d9e1457431e053e627c3..16fc1ae83061c48ab530de601b5d5568495f114d 100644 (file)
@@ -69,7 +69,7 @@ static unsigned int dmar_pt_levels;
 static unsigned int dmar_num_did = ~0U;
 static unsigned int fault_reporting_cpu_id;
 static DEFINE_SPINLOCK(inv_queue_lock);
-static struct vtd_emulation root_cell_units[JAILHOUSE_MAX_DMAR_UNITS];
+static struct vtd_emulation root_cell_units[JAILHOUSE_MAX_IOMMU_UNITS];
 static bool dmar_units_initialized;
 
 static unsigned int inv_queue_write(void *inv_queue, unsigned int index,
@@ -355,7 +355,7 @@ int iommu_mmio_access_handler(bool is_write, u64 addr, u32 *value)
                return 0;
 
        for (n = 0; n < dmar_units; n++) {
-               base_addr = system_config->platform_info.x86.dmar_unit_base[n];
+               base_addr = system_config->platform_info.x86.iommu_base[n];
                if (addr >= base_addr && addr < base_addr + PAGE_SIZE)
                        return vtd_unit_access_handler(n, is_write,
                                                       addr - base_addr,
@@ -465,7 +465,7 @@ int iommu_init(void)
 
        int_remap_table_size_log2 = n;
 
-       while (system_config->platform_info.x86.dmar_unit_base[units])
+       while (system_config->platform_info.x86.iommu_base[units])
                units++;
        if (units == 0)
                return -EINVAL;
@@ -476,7 +476,7 @@ int iommu_init(void)
                return -ENOMEM;
 
        for (n = 0; n < units; n++) {
-               base_addr = system_config->platform_info.x86.dmar_unit_base[n];
+               base_addr = system_config->platform_info.x86.iommu_base[n];
 
                reg_base = dmar_reg_base + n * PAGE_SIZE;
 
index e5331275259b48dcd69accf958e62095764d075d..da3d0c49c45d43e6f5571c04b2c3bff5b9ef5886 100644 (file)
@@ -89,7 +89,7 @@ struct jailhouse_pci_capability {
        __u16 flags;
 } __attribute__((packed));
 
-#define JAILHOUSE_MAX_DMAR_UNITS       8
+#define JAILHOUSE_MAX_IOMMU_UNITS      8
 
 struct jailhouse_system {
        struct jailhouse_memory hypervisor_memory;
@@ -100,7 +100,7 @@ struct jailhouse_system {
                        __u8 mmconfig_end_bus;
                        __u8 padding[5];
                        __u16 pm_timer_address;
-                       __u64 dmar_unit_base[JAILHOUSE_MAX_DMAR_UNITS];
+                       __u64 iommu_base[JAILHOUSE_MAX_IOMMU_UNITS];
                } __attribute__((packed)) x86;
        } __attribute__((packed)) platform_info;
        __u32 device_limit;
index c3eebbe10f524a39795a5d6bae856abff24a3a2d..4df83a06625757a8fd160fd9a12d8f28751e4749 100755 (executable)
@@ -636,7 +636,7 @@ def parse_dmar(pcidevices, ioapics):
                 raise RuntimeError('We do not support multiple PCI segments')
             if len(units) >= 8:
                 raise RuntimeError('Too many DMAR units. '
-                                   'Raise JAILHOUSE_MAX_DMAR_UNITS.')
+                                   'Raise JAILHOUSE_MAX_IOMMU_UNITS.')
             units.append(base)
             if flags & 1:
                 for d in pcidevices:
@@ -798,9 +798,9 @@ mmconfig = MMConfig.parse()
 ioapics = parse_madt()
 
 if get_cpu_vendor() == 'GenuineIntel':
-    (dmar_units, rmrr_regs) = parse_dmar(pcidevices, ioapics)
+    (iommu_units, rmrr_regs) = parse_dmar(pcidevices, ioapics)
 else:
-    (dmar_units, rmrr_regs) = [], []
+    (iommu_units, rmrr_regs) = [], []
 regions += rmrr_regs
 
 for d in pcidevices:
@@ -843,6 +843,6 @@ f.write(tmpl.render(regions=regions,
                     irqchips=ioapics,
                     pm_timer_base=pm_timer_base,
                     mmconfig=mmconfig,
-                    dmar_units=dmar_units))
+                    iommu_units=iommu_units))
 
 f.close()
index a0ca787fbc01e96e64106d0a8266925c1471ebe7..a49458b8f9545f3b5f7e3759626261ad718c5006 100644 (file)
@@ -36,9 +36,9 @@ struct {
                        .mmconfig_base = ${hex(mmconfig.base)},
                        .mmconfig_end_bus = ${hex(mmconfig.end_bus)},
                        .pm_timer_address = ${hex(pm_timer_base)},
-                       % if dmar_units:
-                       .dmar_unit_base = {
-                               % for d in dmar_units:
+                       % if iommu_units:
+                       .iommu_base = {
+                               % for d in iommu_units:
                                ${hex(d)},
                                % endfor
                        },