Commit d9cfed92 authored by Joerg Roedel's avatar Joerg Roedel

amd-iommu: remove amd_iommu_size kernel parameter

This parameter is not longer necessary when aperture increases
dynamically.
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent 11b83888
...@@ -329,11 +329,6 @@ and is between 256 and 4096 characters. It is defined in the file ...@@ -329,11 +329,6 @@ and is between 256 and 4096 characters. It is defined in the file
flushed before they will be reused, which flushed before they will be reused, which
is a lot of faster is a lot of faster
amd_iommu_size= [HW,X86-64]
Define the size of the aperture for the AMD IOMMU
driver. Possible values are:
'32M', '64M' (default), '128M', '256M', '512M', '1G'
amijoy.map= [HW,JOY] Amiga joystick support amijoy.map= [HW,JOY] Amiga joystick support
Map of devices attached to JOY0DAT and JOY1DAT Map of devices attached to JOY0DAT and JOY1DAT
Format: <a>,<b> Format: <a>,<b>
......
...@@ -939,17 +939,10 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom) ...@@ -939,17 +939,10 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom)
* It also intializes the page table and the address allocator data * It also intializes the page table and the address allocator data
* structures required for the dma_ops interface * structures required for the dma_ops interface
*/ */
static struct dma_ops_domain *dma_ops_domain_alloc(struct amd_iommu *iommu, static struct dma_ops_domain *dma_ops_domain_alloc(struct amd_iommu *iommu)
unsigned order)
{ {
struct dma_ops_domain *dma_dom; struct dma_ops_domain *dma_dom;
/*
* Currently the DMA aperture must be between 32 MB and 1GB in size
*/
if ((order < 25) || (order > 30))
return NULL;
dma_dom = kzalloc(sizeof(struct dma_ops_domain), GFP_KERNEL); dma_dom = kzalloc(sizeof(struct dma_ops_domain), GFP_KERNEL);
if (!dma_dom) if (!dma_dom)
return NULL; return NULL;
...@@ -1087,7 +1080,6 @@ static int device_change_notifier(struct notifier_block *nb, ...@@ -1087,7 +1080,6 @@ static int device_change_notifier(struct notifier_block *nb,
struct protection_domain *domain; struct protection_domain *domain;
struct dma_ops_domain *dma_domain; struct dma_ops_domain *dma_domain;
struct amd_iommu *iommu; struct amd_iommu *iommu;
int order = amd_iommu_aperture_order;
unsigned long flags; unsigned long flags;
if (devid > amd_iommu_last_bdf) if (devid > amd_iommu_last_bdf)
...@@ -1126,7 +1118,7 @@ static int device_change_notifier(struct notifier_block *nb, ...@@ -1126,7 +1118,7 @@ static int device_change_notifier(struct notifier_block *nb,
dma_domain = find_protection_domain(devid); dma_domain = find_protection_domain(devid);
if (dma_domain) if (dma_domain)
goto out; goto out;
dma_domain = dma_ops_domain_alloc(iommu, order); dma_domain = dma_ops_domain_alloc(iommu);
if (!dma_domain) if (!dma_domain)
goto out; goto out;
dma_domain->target_dev = devid; dma_domain->target_dev = devid;
...@@ -1826,7 +1818,6 @@ static void prealloc_protection_domains(void) ...@@ -1826,7 +1818,6 @@ static void prealloc_protection_domains(void)
struct pci_dev *dev = NULL; struct pci_dev *dev = NULL;
struct dma_ops_domain *dma_dom; struct dma_ops_domain *dma_dom;
struct amd_iommu *iommu; struct amd_iommu *iommu;
int order = amd_iommu_aperture_order;
u16 devid; u16 devid;
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
...@@ -1839,7 +1830,7 @@ static void prealloc_protection_domains(void) ...@@ -1839,7 +1830,7 @@ static void prealloc_protection_domains(void)
iommu = amd_iommu_rlookup_table[devid]; iommu = amd_iommu_rlookup_table[devid];
if (!iommu) if (!iommu)
continue; continue;
dma_dom = dma_ops_domain_alloc(iommu, order); dma_dom = dma_ops_domain_alloc(iommu);
if (!dma_dom) if (!dma_dom)
continue; continue;
init_unity_mappings_for_device(dma_dom, devid); init_unity_mappings_for_device(dma_dom, devid);
...@@ -1865,7 +1856,6 @@ static struct dma_map_ops amd_iommu_dma_ops = { ...@@ -1865,7 +1856,6 @@ static struct dma_map_ops amd_iommu_dma_ops = {
int __init amd_iommu_init_dma_ops(void) int __init amd_iommu_init_dma_ops(void)
{ {
struct amd_iommu *iommu; struct amd_iommu *iommu;
int order = amd_iommu_aperture_order;
int ret; int ret;
/* /*
...@@ -1874,7 +1864,7 @@ int __init amd_iommu_init_dma_ops(void) ...@@ -1874,7 +1864,7 @@ int __init amd_iommu_init_dma_ops(void)
* protection domain will be assigned to the default one. * protection domain will be assigned to the default one.
*/ */
list_for_each_entry(iommu, &amd_iommu_list, list) { list_for_each_entry(iommu, &amd_iommu_list, list) {
iommu->default_dom = dma_ops_domain_alloc(iommu, order); iommu->default_dom = dma_ops_domain_alloc(iommu);
if (iommu->default_dom == NULL) if (iommu->default_dom == NULL)
return -ENOMEM; return -ENOMEM;
iommu->default_dom->domain.flags |= PD_DEFAULT_MASK; iommu->default_dom->domain.flags |= PD_DEFAULT_MASK;
......
...@@ -121,7 +121,6 @@ u16 amd_iommu_last_bdf; /* largest PCI device id we have ...@@ -121,7 +121,6 @@ u16 amd_iommu_last_bdf; /* largest PCI device id we have
to handle */ to handle */
LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings
we find in ACPI */ we find in ACPI */
unsigned amd_iommu_aperture_order = 26; /* size of aperture in power of 2 */
bool amd_iommu_isolate = true; /* if true, device isolation is bool amd_iommu_isolate = true; /* if true, device isolation is
enabled */ enabled */
bool amd_iommu_unmap_flush; /* if true, flush on every unmap */ bool amd_iommu_unmap_flush; /* if true, flush on every unmap */
...@@ -1137,9 +1136,6 @@ int __init amd_iommu_init(void) ...@@ -1137,9 +1136,6 @@ int __init amd_iommu_init(void)
enable_iommus(); enable_iommus();
printk(KERN_INFO "AMD IOMMU: aperture size is %d MB\n",
(1 << (amd_iommu_aperture_order-20)));
printk(KERN_INFO "AMD IOMMU: device isolation "); printk(KERN_INFO "AMD IOMMU: device isolation ");
if (amd_iommu_isolate) if (amd_iommu_isolate)
printk("enabled\n"); printk("enabled\n");
...@@ -1225,15 +1221,4 @@ static int __init parse_amd_iommu_options(char *str) ...@@ -1225,15 +1221,4 @@ static int __init parse_amd_iommu_options(char *str)
return 1; return 1;
} }
static int __init parse_amd_iommu_size_options(char *str)
{
unsigned order = PAGE_SHIFT + get_order(memparse(str, &str));
if ((order > 24) && (order < 31))
amd_iommu_aperture_order = order;
return 1;
}
__setup("amd_iommu=", parse_amd_iommu_options); __setup("amd_iommu=", parse_amd_iommu_options);
__setup("amd_iommu_size=", parse_amd_iommu_size_options);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment