Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71975
b: refs/heads/master
c: 49a0429
h: refs/heads/master
i:
  71973: 94b803f
  71971: 3627456
  71967: 8266552
v: v3
  • Loading branch information
Keshavamurthy, Anil S authored and Linus Torvalds committed Oct 22, 2007
1 parent f3eeb07 commit 21be275
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e820482cd2621dba60e403af1c54502daa54b220
refs/heads/master: 49a0429e53f29109cbf1eadd89497286ba81f1ae
10 changes: 10 additions & 0 deletions trunk/arch/x86_64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,16 @@ config DMAR_GFX_WA
all the OS-visible memory. Hence the driver can continue
to use physical addresses for DMA.

config DMAR_FLOPPY_WA
bool
depends on DMAR
default y
help
Floppy disk drivers are know to bypass DMA API calls
thereby failing to work when IOMMU is enabled. This
workaround will setup a 1:1 mapping for the first
16M to make floppy (an ISA device) work.

source "drivers/pci/pcie/Kconfig"

source "drivers/pci/Kconfig"
Expand Down
27 changes: 27 additions & 0 deletions trunk/drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,31 @@ static void __init iommu_prepare_gfx_mapping(void)
}
#endif

#ifdef CONFIG_DMAR_FLOPPY_WA
static inline void iommu_prepare_isa(void)
{
struct pci_dev *pdev;
int ret;

pdev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL);
if (!pdev)
return;

printk(KERN_INFO "IOMMU: Prepare 0-16M unity mapping for LPC\n");
ret = iommu_prepare_identity_map(pdev, 0, 16*1024*1024);

if (ret)
printk("IOMMU: Failed to create 0-64M identity map, "
"floppy might not work\n");

}
#else
static inline void iommu_prepare_isa(void)
{
return;
}
#endif /* !CONFIG_DMAR_FLPY_WA */

int __init init_dmars(void)
{
struct dmar_drhd_unit *drhd;
Expand Down Expand Up @@ -1697,6 +1722,8 @@ int __init init_dmars(void)

iommu_prepare_gfx_mapping();

iommu_prepare_isa();

/*
* for each drhd
* enable fault log
Expand Down

0 comments on commit 21be275

Please sign in to comment.