.mmconfig_base = 0xe0000000,
.mmconfig_end_bus = 0xff,
.pm_timer_address = 0x808,
- .iommu_base = {
- 0xfeb80000,
+ .iommu_units = {
+ {
+ .base = 0xfeb80000,
+ },
},
},
.device_limit = 128,
.mmconfig_base = 0xf8000000,
.mmconfig_end_bus = 0x3f,
.pm_timer_address = 0x1808,
- .iommu_base = {
- 0xfed90000,
- 0xfed91000,
+ .iommu_units = {
+ {
+ .base = 0xfed90000,
+ },
+ {
+ .base = 0xfed91000,
+ },
},
},
.interrupt_limit = 256,
.mmconfig_base = 0xb0000000,
.mmconfig_end_bus = 0xff,
.pm_timer_address = 0x608,
- .iommu_base = {
- 0xfed90000,
+ .iommu_units = {
+ {
+ .base = 0xfed90000,
+ },
},
},
.interrupt_limit = 256,
unsigned int units = 0;
while (units < JAILHOUSE_MAX_IOMMU_UNITS &&
- system_config->platform_info.x86.iommu_base[units])
+ system_config->platform_info.x86.iommu_units[units].base)
units++;
return units;
}
root_cell.arch.vtd.ir_emulation = true;
- base = system_config->platform_info.x86.iommu_base[unit_no];
+ base = system_config->platform_info.x86.iommu_units[unit_no].base;
mmio_region_register(&root_cell, base, PAGE_SIZE,
vtd_unit_access_handler, unit);
{
unsigned long version, caps, ecaps, ctrls, sllps_caps = ~0UL;
unsigned int units, pt_levels, num_did, n;
+ struct jailhouse_iommu *unit;
void *reg_base;
- u64 base_addr;
int err;
/* n = roundup(log2(system_config->interrupt_limit)) */
return -ENOMEM;
for (n = 0; n < units; n++) {
- base_addr = system_config->platform_info.x86.iommu_base[n];
+ unit = &system_config->platform_info.x86.iommu_units[n];
reg_base = dmar_reg_base + n * PAGE_SIZE;
- err = paging_create(&hv_paging_structs, base_addr, PAGE_SIZE,
+ err = paging_create(&hv_paging_structs, unit->base, PAGE_SIZE,
(unsigned long)reg_base,
PAGE_DEFAULT_FLAGS | PAGE_FLAG_DEVICE,
PAGING_NON_COHERENT);
return 0;
}
- printk("Found DMAR @%p\n", base_addr);
+ printk("Found DMAR @%p\n", unit->base);
caps = mmio_read64(reg_base + VTD_CAP_REG);
if (caps & VTD_CAP_SAGAW39)
#define JAILHOUSE_MAX_IOMMU_UNITS 8
+struct jailhouse_iommu {
+ __u64 base;
+} __attribute__((packed));
+
#define JAILHOUSE_SYSTEM_SIGNATURE "JAILSYST"
struct jailhouse_system {
__u8 mmconfig_end_bus;
__u8 padding[5];
__u16 pm_timer_address;
- __u64 iommu_base[JAILHOUSE_MAX_IOMMU_UNITS];
+ struct jailhouse_iommu
+ iommu_units[JAILHOUSE_MAX_IOMMU_UNITS];
} __attribute__((packed)) x86;
} __attribute__((packed)) platform_info;
__u32 device_limit;
/*
* Jailhouse, a Linux-based partitioning hypervisor
*
- * Copyright (c) Siemens AG, 2014, 2015
+ * Copyright (c) Siemens AG, 2014-2016
*
* This work is licensed under the terms of the GNU GPL, version 2. See
* the COPYING file in the top-level directory.
.mmconfig_end_bus = ${hex(mmconfig.end_bus)},
.pm_timer_address = ${hex(pm_timer_base)},
% if iommu_units:
- .iommu_base = {
+ .iommu_units = {
% for d in iommu_units:
- ${hex(d)},
+ {
+ .base = ${hex(d)},
+ },
% endfor
},
% endif