x86/amd-iommu: attach devices to pre-allocated domains early
commit430b6ab743b6448873d4d9382af6c3f860dfdbb4
authorJoerg Roedel <joerg.roedel@amd.com>
Mon, 23 Nov 2009 11:50:00 +0000 (23 12:50 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 22:03:16 +0000 (18 14:03 -0800)
treee960d7dc8d15f6a0b1881dc8547a98556aaa47ad
parent35c1ee3e78766d5666f418af638def9c67e63ecb
x86/amd-iommu: attach devices to pre-allocated domains early

commit be831297716036de5b24308447ecb69f1706a846 upstream.

For some devices the ACPI table may define unity map
requirements which must me met when the IOMMU is enabled. So
we need to attach devices to their domains as early as
possible so that these mappings are in place when needed.
This patch assigns the domains right after they are
allocated. Otherwise this can result in I/O page faults
before a driver binds to a device and BIOS is still using
it.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kernel/amd_iommu.c