Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331523
b: refs/heads/master
c: eb1eb7a
h: refs/heads/master
i:
  331521: 03e2d5d
  331519: 37a4877
v: v3
  • Loading branch information
Joerg Roedel committed Sep 28, 2012
1 parent cde0c34 commit 72ed3df
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ea2c422bc8da99d14baa46d4789861a4f8d4ec0
refs/heads/master: eb1eb7ae65a9d32f6c16a90419caf01221f94734
2 changes: 1 addition & 1 deletion trunk/drivers/iommu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ config AMD_IOMMU
select PCI_PRI
select PCI_PASID
select IOMMU_API
depends on X86_64 && PCI && ACPI
depends on X86_64 && PCI && ACPI && X86_IO_APIC
---help---
With this option you can enable support for AMD IOMMU hardware in
your system. An IOMMU is a hardware component which provides
Expand Down
27 changes: 24 additions & 3 deletions trunk/drivers/iommu/amd_iommu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <asm/gart.h>
#include <asm/x86_init.h>
#include <asm/iommu_table.h>
#include <asm/io_apic.h>

#include "amd_iommu_proto.h"
#include "amd_iommu_types.h"
Expand Down Expand Up @@ -1575,6 +1576,23 @@ static void __init free_on_init_error(void)
#endif
}

static bool __init check_ioapic_information(void)
{
int idx;

for (idx = 0; idx < nr_ioapics; idx++) {
int id = mpc_ioapic_id(idx);

if (get_ioapic_devid(id) < 0) {
pr_err(FW_BUG "AMD-Vi: IO-APIC[%d] not in IVRS table\n", id);
pr_err("AMD-Vi: Disabling interrupt remapping due to BIOS Bug\n");
return false;
}
}

return true;
}

/*
* This is the hardware init function for AMD IOMMU in the system.
* This function is called either from amd_iommu_init or from the interrupt
Expand Down Expand Up @@ -1661,9 +1679,6 @@ static int __init early_amd_iommu_init(void)
if (amd_iommu_pd_alloc_bitmap == NULL)
goto out;

/* init the device table */
init_device_table();

/*
* let all alias entries point to itself
*/
Expand All @@ -1686,6 +1701,9 @@ static int __init early_amd_iommu_init(void)
if (ret)
goto out;

if (amd_iommu_irq_remap)
amd_iommu_irq_remap = check_ioapic_information();

if (amd_iommu_irq_remap) {
/*
* Interrupt remapping enabled, create kmem_cache for the
Expand All @@ -1709,6 +1727,9 @@ static int __init early_amd_iommu_init(void)
if (ret)
goto out;

/* init the device table */
init_device_table();

out:
/* Don't leak any ACPI memory */
early_acpi_os_unmap_memory((char __iomem *)ivrs_base, ivrs_size);
Expand Down

0 comments on commit 72ed3df

Please sign in to comment.