Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158091
b: refs/heads/master
c: 407d733
h: refs/heads/master
i:
  158089: f9f2ad3
  158087: 4e8e016
v: v3
  • Loading branch information
Joerg Roedel committed Sep 3, 2009
1 parent ccb9062 commit 688f8bb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 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: 6a0dbcbe4e612fbc9d73cd4dde8ebef19295058a
refs/heads/master: 407d733e30a97daf5ea6f9eb5f9ebbd42a0a9ef2
27 changes: 17 additions & 10 deletions trunk/arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,18 +1058,10 @@ static struct protection_domain *domain_for_device(u16 devid)
return dom;
}

/*
* If a device is not yet associated with a domain, this function does
* assigns it visible for the hardware
*/
static void attach_device(struct amd_iommu *iommu,
struct protection_domain *domain,
u16 devid)
static void set_dte_entry(u16 devid, struct protection_domain *domain)
{
unsigned long flags;
u64 pte_root = virt_to_phys(domain->pt_root);

domain->dev_cnt += 1;
unsigned long flags;

pte_root |= (domain->mode & DEV_ENTRY_MODE_MASK)
<< DEV_ENTRY_MODE_SHIFT;
Expand All @@ -1082,6 +1074,21 @@ static void attach_device(struct amd_iommu *iommu,

amd_iommu_pd_table[devid] = domain;
write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
}

/*
* If a device is not yet associated with a domain, this function does
* assigns it visible for the hardware
*/
static void attach_device(struct amd_iommu *iommu,
struct protection_domain *domain,
u16 devid)
{
/* set the DTE entry */
set_dte_entry(devid, domain);

/* increase reference counter */
domain->dev_cnt += 1;

/*
* We might boot into a crash-kernel here. The crashed kernel
Expand Down

0 comments on commit 688f8bb

Please sign in to comment.