From cec74de0498a409e5bcbada71d3772d6305d5ec0 Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Tue, 2 Dec 2008 17:56:36 +0100 Subject: [PATCH] --- yaml --- r: 125607 b: refs/heads/master c: 863c74ebd0152b21bc4b11c1447b5d1429287d37 h: refs/heads/master i: 125605: 8f4318c4495f5e1b5392f6e0f2b010f0d41e604f 125603: c05a31ebd3a1fd5163a63716195aa728899d2c1b 125599: b06db5595c770ef30103b7d4a99459a97a85350d v: v3 --- [refs] | 2 +- trunk/arch/x86/include/asm/amd_iommu_types.h | 1 + trunk/arch/x86/kernel/amd_iommu.c | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 83a06e014115..dc9fb4bc587d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5b28df6f43ac9878f310ad0cb7f11ddb262a7ac6 +refs/heads/master: 863c74ebd0152b21bc4b11c1447b5d1429287d37 diff --git a/trunk/arch/x86/include/asm/amd_iommu_types.h b/trunk/arch/x86/include/asm/amd_iommu_types.h index 4862a5be899c..1c769f4e6cdf 100644 --- a/trunk/arch/x86/include/asm/amd_iommu_types.h +++ b/trunk/arch/x86/include/asm/amd_iommu_types.h @@ -203,6 +203,7 @@ struct protection_domain { int mode; /* paging mode (0-6 levels) */ u64 *pt_root; /* page table root pointer */ unsigned long flags; /* flags to find out type of domain */ + unsigned dev_cnt; /* devices assigned to this domain */ void *priv; /* private data */ }; diff --git a/trunk/arch/x86/kernel/amd_iommu.c b/trunk/arch/x86/kernel/amd_iommu.c index 5c465c91150e..8b45bc49d1c5 100644 --- a/trunk/arch/x86/kernel/amd_iommu.c +++ b/trunk/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;