return domid;
}
-static struct intel_iommu *__init alloc_intel_iommu(void)
-{
- struct intel_iommu *intel;
-
- intel = xzalloc(struct intel_iommu);
- if ( intel == NULL )
- return NULL;
-
- return intel;
-}
-
-static void __init free_intel_iommu(struct intel_iommu *intel)
-{
- xfree(intel);
-}
-
static int iommus_incoherent;
static void __iommu_flush_cache(void *addr, unsigned int size)
{
{
const char *reason, *kind;
enum faulttype fault_type;
- u16 seg = iommu->intel->drhd->segment;
+ u16 seg = iommu->drhd->segment;
reason = iommu_get_fault_reason(fault_reason, &fault_type);
switch ( fault_type )
iommu_page_fault_do_one(iommu, type, fault_reason,
source_id, guest_addr);
- pci_check_disable_device(iommu->intel->drhd->segment,
+ pci_check_disable_device(iommu->drhd->segment,
PCI_BUS(source_id), PCI_DEVFN2(source_id));
fault_index++;
INIT_LIST_HEAD(&iommu->ats_devices);
spin_lock_init(&iommu->intremap.lock);
- iommu->intel = alloc_intel_iommu();
- if ( iommu->intel == NULL )
- {
- xfree(iommu);
- return -ENOMEM;
- }
- iommu->intel->drhd = drhd;
+ iommu->drhd = drhd;
drhd->iommu = iommu;
iommu->reg = ioremap(drhd->address, PAGE_SIZE);
xfree(iommu->domid_bitmap);
xfree(iommu->domid_map);
- free_intel_iommu(iommu->intel);
if ( iommu->msi.irq >= 0 )
destroy_irq(iommu->msi.irq);
xfree(iommu);
struct domain_iommu *hd = dom_iommu(domain);
struct context_entry *context, *context_entries;
u64 maddr, pgd_maddr;
- u16 seg = iommu->intel->drhd->segment;
+ u16 seg = iommu->drhd->segment;
int agaw, rc, ret;
bool_t flush_dev_iotlb;
spin_unlock(&iommu->lock);
unmap_vtd_domain_page(context_entries);
- if ( !iommu->intel->drhd->segment && !rc )
+ if ( !iommu->drhd->segment && !rc )
rc = me_wifi_quirk(domain, bus, devfn, UNMAP_ME_PHANTOM_FUNC);
return rc;
extern struct list_head acpi_rmrr_units;
extern struct list_head acpi_ioapic_units;
-struct intel_iommu {
- struct acpi_drhd_unit *drhd;
-};
-
struct vtd_iommu {
struct list_head list;
void __iomem *reg; /* Pointer to hardware regs, virtual addr */
u64 root_maddr; /* root entry machine address */
nodeid_t node;
struct msi_desc msi;
- struct intel_iommu *intel;
+ struct acpi_drhd_unit *drhd;
uint64_t qinval_maddr; /* queue invalidation page machine address */
*/
static int cantiga_vtd_ops_preamble(struct vtd_iommu *iommu)
{
- struct intel_iommu *intel = iommu->intel;
- struct acpi_drhd_unit *drhd = intel ? intel->drhd : NULL;
+ struct acpi_drhd_unit *drhd = iommu->drhd;
if ( !is_igd_drhd(drhd) || !is_cantiga_b3 )
return 0;
*/
static void snb_vtd_ops_preamble(struct vtd_iommu *iommu)
{
- struct intel_iommu *intel = iommu->intel;
- struct acpi_drhd_unit *drhd = intel ? intel->drhd : NULL;
+ struct acpi_drhd_unit *drhd = iommu->drhd;
s_time_t start_time;
if ( !is_igd_drhd(drhd) || !is_snb_gfx )
static void snb_vtd_ops_postamble(struct vtd_iommu *iommu)
{
- struct intel_iommu *intel = iommu->intel;
- struct acpi_drhd_unit *drhd = intel ? intel->drhd : NULL;
+ struct acpi_drhd_unit *drhd = iommu->drhd;
if ( !is_igd_drhd(drhd) || !is_snb_gfx )
return;
u32 l_index, level;
printk("print_vtd_entries: iommu #%u dev %04x:%02x:%02x.%u gmfn %"PRI_gfn"\n",
- iommu->index, iommu->intel->drhd->segment, bus,
+ iommu->index, iommu->drhd->segment, bus,
PCI_SLOT(devfn), PCI_FUNC(devfn), gmfn);
if ( iommu->root_maddr == 0 )