Commit 74ce42a9 authored by Vasant Hegde's avatar Vasant Hegde Committed by Joerg Roedel
Browse files

iommu/amd: Introduce per PCI segment alias table size

parent b5c85290
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -558,6 +558,9 @@ struct amd_iommu_pci_seg {
	/* Size of the device table */
	u32 dev_table_size;

	/* Size of the alias table */
	u32 alias_table_size;

	/*
	 * device table virtual address
	 *
+3 −2
Original line number Diff line number Diff line
@@ -712,7 +712,7 @@ static int __init alloc_alias_table(struct amd_iommu_pci_seg *pci_seg)
	int i;

	pci_seg->alias_table = (void *)__get_free_pages(GFP_KERNEL,
						    get_order(alias_table_size));
					get_order(pci_seg->alias_table_size));
	if (!pci_seg->alias_table)
		return -ENOMEM;

@@ -728,7 +728,7 @@ static int __init alloc_alias_table(struct amd_iommu_pci_seg *pci_seg)
static void __init free_alias_table(struct amd_iommu_pci_seg *pci_seg)
{
	free_pages((unsigned long)pci_seg->alias_table,
		   get_order(alias_table_size));
		   get_order(pci_seg->alias_table_size));
	pci_seg->alias_table = NULL;
}

@@ -1583,6 +1583,7 @@ static struct amd_iommu_pci_seg *__init alloc_pci_segment(u16 id,
	pci_seg->last_bdf = last_bdf;
	DUMP_printk("PCI segment : 0x%0x, last bdf : 0x%04x\n", id, last_bdf);
	pci_seg->dev_table_size     = tbl_size(DEV_TABLE_ENTRY_SIZE);
	pci_seg->alias_table_size   = tbl_size(ALIAS_TABLE_ENTRY_SIZE);

	pci_seg->id = id;
	init_llist_head(&pci_seg->dev_data_list);