Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30488
b: refs/heads/master
c: 8d4f6b9
h: refs/heads/master
v: v3
  • Loading branch information
Jon Mason authored and Linus Torvalds committed Jun 26, 2006
1 parent 1b47bde commit 4505439
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 2 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: 2bbc419f9d51b44f3fdeea12c5b786bdace82b8e
refs/heads/master: 8d4f6b93a4aaa6b56b600cd1165c971f4395e4b3
1 change: 1 addition & 0 deletions trunk/arch/x86_64/kernel/aperture.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ void __init iommu_hole_init(void)
if (!early_is_k8_nb(read_pci_config(0, num, 3, 0x00)))
continue;

iommu_detected = 1;
iommu_aperture = 1;

aper_order = (read_pci_config(0, num, 3, 0x90) >> 1) & 7;
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/x86_64/kernel/pci-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ int panic_on_overflow __read_mostly = 0;
int force_iommu __read_mostly= 0;
#endif

/* Set this to 1 if there is a HW IOMMU in the system */
int iommu_detected __read_mostly = 0;

/* Dummy device used for NULL arguments (normally ISA). Better would
be probably a smaller DMA mask, but this is bug-to-bug compatible
to i386. */
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/x86_64/kernel/pci-gart.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,10 @@ static int __init pci_iommu_init(void)
if (swiotlb)
return -ENODEV;

/* Did we detect a different HW IOMMU? */
if (iommu_detected && !iommu_aperture)
return -1;

if (no_iommu ||
(!force_iommu && end_pfn <= MAX_DMA32_PFN) ||
!iommu_aperture ||
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86_64/kernel/pci-swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct dma_mapping_ops swiotlb_dma_ops = {
void pci_swiotlb_init(void)
{
/* don't initialize swiotlb if iommu=off (no_iommu=1) */
if (!iommu_aperture && !no_iommu &&
if (!iommu_detected && !no_iommu &&
(end_pfn > MAX_DMA32_PFN || force_iommu))
swiotlb = 1;
if (swiotlb) {
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86_64/proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ extern int skip_ioapic_setup;
extern int acpi_ht;
extern int acpi_disabled;

extern int iommu_detected;
#ifdef CONFIG_IOMMU
extern int fallback_aper_order;
extern int fallback_aper_force;
Expand Down

0 comments on commit 4505439

Please sign in to comment.