Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145891
b: refs/heads/master
c: fefda11
h: refs/heads/master
i:
  145889: e9a2b85
  145887: 8a20800
v: v3
  • Loading branch information
Joerg Roedel committed May 28, 2009
1 parent 8ac4d79 commit c8aee40
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 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: c1eee67b2d8464781f5868a34168df61e40e85a6
refs/heads/master: fefda117ddb324b872312f1f061230e627c9f5ee
6 changes: 6 additions & 0 deletions trunk/arch/x86/include/asm/amd_iommu_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@
#define PD_DMA_OPS_MASK (1UL << 0) /* domain used for dma_ops */
#define PD_DEFAULT_MASK (1UL << 1) /* domain is a default dma_ops
domain for an IOMMU */
extern bool amd_iommu_dump;
#define DUMP_printk(format, arg...) \
do { \
if (amd_iommu_dump) \
printk(KERN_INFO "AMD IOMMU: " format, ## arg); \
} while(0);

/*
* This structure contains generic data for IOMMU protection domains
Expand Down
6 changes: 1 addition & 5 deletions trunk/arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ static int dma_ops_unity_map(struct dma_ops_domain *dma_dom,
static struct dma_ops_domain *find_protection_domain(u16 devid);


#ifndef BUS_NOTIFY_UNBOUND_DRIVER
#define BUS_NOTIFY_UNBOUND_DRIVER 0x0005
#endif

#ifdef CONFIG_AMD_IOMMU_STATS

/*
Expand Down Expand Up @@ -1016,7 +1012,7 @@ static int device_change_notifier(struct notifier_block *nb,
printk(KERN_INFO "AMD IOMMU: Using protection domain %d for "
"device %s\n", dma_domain->domain.id, dev_name(dev));
break;
case BUS_NOTIFY_UNBOUND_DRIVER:
case BUS_NOTIFY_UNBIND_DRIVER:
if (!domain)
goto out;
detach_device(domain, devid);
Expand Down
16 changes: 12 additions & 4 deletions trunk/arch/x86/kernel/amd_iommu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ struct ivmd_header {
u64 range_length;
} __attribute__((packed));

bool amd_iommu_dump;

static int __initdata amd_iommu_detected;

u16 amd_iommu_last_bdf; /* largest PCI device id we have
Expand Down Expand Up @@ -175,7 +177,7 @@ static inline void update_last_devid(u16 devid)
static inline unsigned long tbl_size(int entry_size)
{
unsigned shift = PAGE_SHIFT +
get_order(((int)amd_iommu_last_bdf + 1) * entry_size);
get_order(amd_iommu_last_bdf * entry_size);

return 1UL << shift;
}
Expand Down Expand Up @@ -618,7 +620,7 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
case IVHD_DEV_ALIAS:
devid = e->devid;
devid_to = e->ext >> 8;
set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0);
set_dev_entry_from_acpi(iommu, devid, e->flags, 0);
amd_iommu_alias_table[devid] = devid_to;
break;
case IVHD_DEV_ALIAS_RANGE:
Expand Down Expand Up @@ -906,8 +908,6 @@ static int __init init_unity_map_range(struct ivmd_header *m)

switch (m->type) {
default:
kfree(e);
return 0;
case ACPI_IVMD_TYPE:
e->devid_start = e->devid_end = m->devid;
break;
Expand Down Expand Up @@ -1213,6 +1213,13 @@ void __init amd_iommu_detect(void)
*
****************************************************************************/

static int __init parse_amd_iommu_dump(char *str)
{
amd_iommu_dump = true;

return 1;
}

static int __init parse_amd_iommu_options(char *str)
{
for (; *str; ++str) {
Expand All @@ -1237,5 +1244,6 @@ static int __init parse_amd_iommu_size_options(char *str)
return 1;
}

__setup("amd_iommu_dump", parse_amd_iommu_dump);
__setup("amd_iommu=", parse_amd_iommu_options);
__setup("amd_iommu_size=", parse_amd_iommu_size_options);

0 comments on commit c8aee40

Please sign in to comment.