summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/amd_iommu.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-12-02 17:56:36 +0100
committerJoerg Roedel <joerg.roedel@amd.com>2009-01-03 14:11:54 +0100
commit863c74ebd0152b21bc4b11c1447b5d1429287d37 (patch)
treea679b7a5754e365635b000fe4b529e181d773e02 /arch/x86/kernel/amd_iommu.c
parent5b28df6f43ac9878f310ad0cb7f11ddb262a7ac6 (diff)
downloadblackbird-op-linux-863c74ebd0152b21bc4b11c1447b5d1429287d37.tar.gz
blackbird-op-linux-863c74ebd0152b21bc4b11c1447b5d1429287d37.zip
AMD IOMMU: add device reference counting for protection domains
Impact: know how many devices are assigned to a domain Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86/kernel/amd_iommu.c')
-rw-r--r--arch/x86/kernel/amd_iommu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 5c465c91150e..8b45bc49d1c5 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -825,9 +825,10 @@ static void set_device_domain(struct amd_iommu *iommu,
u16 devid)
{
unsigned long flags;
-
u64 pte_root = virt_to_phys(domain->pt_root);
+ domain->dev_cnt += 1;
+
pte_root |= (domain->mode & DEV_ENTRY_MODE_MASK)
<< DEV_ENTRY_MODE_SHIFT;
pte_root |= IOMMU_PTE_IR | IOMMU_PTE_IW | IOMMU_PTE_P | IOMMU_PTE_TV;
OpenPOWER on IntegriCloud