diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-09-05 17:53:05 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-09-05 17:53:05 +0200 |
| commit | 28c3cfd5fb998bd3683bebeebbba38baa2101cad (patch) | |
| tree | 3d325023e6dc56baa6c69fc59dd55bf37ef7967e /arch/x86/kernel/amd_iommu_init.c | |
| parent | 04197c83b3e05546d1003cfa3ff43f1639c0057f (diff) | |
| parent | b380b0d4f7dffcc235c0facefa537d4655619101 (diff) | |
| download | linux-28c3cfd5fb998bd3683bebeebbba38baa2101cad.tar.gz linux-28c3cfd5fb998bd3683bebeebbba38baa2101cad.tar.bz2 linux-28c3cfd5fb998bd3683bebeebbba38baa2101cad.zip | |
Merge branch 'linus' into x86/tracehook
Diffstat (limited to 'arch/x86/kernel/amd_iommu_init.c')
| -rw-r--r-- | arch/x86/kernel/amd_iommu_init.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index d9a9da597e79..a69cc0f52042 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c @@ -801,6 +801,21 @@ static int __init init_memory_definitions(struct acpi_table_header *table) } /* + * Init the device table to not allow DMA access for devices and + * suppress all page faults + */ +static void init_device_table(void) +{ + u16 devid; + + for (devid = 0; devid <= amd_iommu_last_bdf; ++devid) { + set_dev_entry_bit(devid, DEV_ENTRY_VALID); + set_dev_entry_bit(devid, DEV_ENTRY_TRANSLATION); + set_dev_entry_bit(devid, DEV_ENTRY_NO_PAGE_FAULT); + } +} + +/* * This function finally enables all IOMMUs found in the system after * they have been initialized */ @@ -931,6 +946,9 @@ int __init amd_iommu_init(void) if (amd_iommu_pd_alloc_bitmap == NULL) goto free; + /* init the device table */ + init_device_table(); + /* * let all alias entries point to itself */ @@ -954,15 +972,15 @@ int __init amd_iommu_init(void) if (acpi_table_parse("IVRS", init_memory_definitions) != 0) goto free; - ret = amd_iommu_init_dma_ops(); + ret = sysdev_class_register(&amd_iommu_sysdev_class); if (ret) goto free; - ret = sysdev_class_register(&amd_iommu_sysdev_class); + ret = sysdev_register(&device_amd_iommu); if (ret) goto free; - ret = sysdev_register(&device_amd_iommu); + ret = amd_iommu_init_dma_ops(); if (ret) goto free; |
