Fixes and Cleanups (AMD-Vi)
cover Fixes and Cleanups (AMD-Vi)
Hi,
this series contains various fixes and cleanups for the AMD-IOMMU (AMD-Vi) driver which queued up since the last merge window.
Joerg
Diffstat:
arch/x86/include/asm/amd_iommu_types.h | 2 +- arch/x86/kernel/amd_iommu.c | 10 +--------- arch/x86/kernel/amd_iommu_init.c | 14 +++++++------- 3 files changed, 9 insertions(+), 17 deletions(-)
Shortlog:
Joerg Roedel (4):
x86/amd-iommu: Remove some merge helper code x86/amd-iommu: replace "AMD IOMMU" by "AMD-Vi" x86/amd-iommu: Remove redundant 'IOMMU' string x86/amd-iommu: fix broken check in amd_iommu_flush_all_devices
PATCH 1/4 x86/amd-iommu: Remove some merge helper code
This patch removes some left-overs which where put into the code to simplify merging code which also depends on changes in other trees.
--- arch/x86/kernel/amd_iommu.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
arch/x86/kernel/amd_iommu.c +0 -6
@@ -41,9 +41,7 @@ static DEFINE_RWLOCK(amd_iommu_devtable_lock);static LIST_HEAD (iommu_pd_list);static DEFINE_SPINLOCK (iommu_pd_list_lock); -#ifdef CONFIG_IOMMU_API static struct iommu_ops amd_iommu_ops; -#endif /* * general struct to manage commands send to an IOMMU
@@ -62,10 +60,6 @@ static void dma_ops_reserve_addresses(struct dma_ops_domain *dom,unsigned long start_page, unsigned int pages); -#ifndef BUS_NOTIFY_UNBOUND_DRIVER -#define BUS_NOTIFY_UNBOUND_DRIVER 0x0005 -#endif -#ifdef CONFIG_AMD_IOMMU_STATS /*
Signature · 1 line
1.6.3.3
PATCH 2/4 x86/amd-iommu: replace "AMD IOMMU" by "AMD-Vi"
In reply to Joerg RoedelThis patch replaces the "AMD IOMMU" printk strings with the official name for the hardware: "AMD-Vi".
--- arch/x86/include/asm/amd_iommu_types.h | 2 +- arch/x86/kernel/amd_iommu.c | 2 +- arch/x86/kernel/amd_iommu_init.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-)
arch/x86/include/asm/amd_iommu_types.h +1 -1
@@ -198,7 +198,7 @@ extern bool amd_iommu_dump; #define DUMP_printk(format, arg...) \ do { \ if (amd_iommu_dump) \ - printk(KERN_INFO "AMD IOMMU: " format, ## arg); \ + printk(KERN_INFO "AMD-Vi: " format, ## arg); \ } while(0);/*
arch/x86/kernel/amd_iommu.c +1 -1
@@ -141,7 +141,7 @@ static void iommu_print_event(void *__evt)int flags = (event[1 ] >>EVENT_FLAGS_SHIFT ) &EVENT_FLAGS_MASK ;u64 address = (u64)(((u64 )event[3 ]) <<32 ) | event[2 ]; -printk (KERN_ERR "AMD IOMMU: Event logged [" ); +printk (KERN_ERR "AMD-Vi: Event logged [" );switch (type) {case EVENT_TYPE_ILL_DEV :
arch/x86/kernel/amd_iommu_init.c +6 -6
@@ -252,7 +252,7 @@ static void __init iommu_feature_disable(struct amd_iommu *iommu, u8 bit)/* Function to enable the hardware */ static void iommu_enable (struct amd_iommu *iommu) { -printk (KERN_INFO "AMD IOMMU: Enabling IOMMU at %s cap 0x%hx\n" , +printk (KERN_INFO "AMD-Vi: Enabling IOMMU at %s cap 0x%hx\n" ,dev_name (&iommu->dev->dev), iommu->cap_ptr);iommu_feature_enable (iommu,CONTROL_IOMMU_EN );
@@ -902,7 +902,7 @@ static int __init iommu_setup_msi(struct amd_iommu *iommu) r =request_irq (iommu->dev->irq, amd_iommu_int_handler,IRQF_SAMPLE_RANDOM , -"AMD IOMMU" , +"AMD-Vi" ,NULL );if (r) {
@@ -1150,7 +1150,7 @@ int __init amd_iommu_init(void)if (no_iommu) { -printk (KERN_INFO "AMD IOMMU disabled by kernel command line\n" ); +printk (KERN_INFO "AMD-Vi disabled by kernel command line\n" );return 0 ; }
@@ -1248,16 +1248,16 @@ int __init amd_iommu_init(void)enable_iommus (); -printk (KERN_INFO "AMD IOMMU: device isolation " ); +printk (KERN_INFO "AMD-Vi: device isolation " );if (amd_iommu_isolate)printk ("enabled\n" );else printk ("disabled\n" );if (amd_iommu_unmap_flush) -printk (KERN_INFO "AMD IOMMU: IO/TLB flush on unmap enabled\n" ); +printk (KERN_INFO "AMD-Vi: IO/TLB flush on unmap enabled\n" );else -printk (KERN_INFO "AMD IOMMU: Lazy IO/TLB flushing enabled\n" ); +printk (KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n" ); out:return ret;
Signature · 1 line
1.6.3.3
PATCH 3/4 x86/amd-iommu: Remove redundant 'IOMMU' string
In reply to Joerg RoedelThe 'IOMMU: ' prefix is not necessary because theDUMP_printk macro already prints its own prefix.
--- arch/x86/kernel/amd_iommu_init.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/amd_iommu_init.c +1 -1
@@ -858,7 +858,7 @@ static int __init init_iommu_all(struct acpi_table_header *table)switch (*p) {case ACPI_IVHD_TYPE : - DUMP_printk("IOMMU: device: %02x:%02x.%01x cap: %04x " + DUMP_printk("device: %02x:%02x.%01x cap: %04x " "seg: %d flags: %01x info %04x\n", PCI_BUS(h->devid), PCI_SLOT(h->devid), PCI_FUNC(h->devid), h->cap_ptr,
Signature · 1 line
1.6.3.3
PATCH 4/4 x86/amd-iommu: fix broken check in amd_iommu_flush_all_devices
In reply to Joerg RoedelThe amd_iommu_pd_table is indexed by protection domain number and not by device id. So this check is broken and must be removed.
--- arch/x86/kernel/amd_iommu.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
arch/x86/kernel/amd_iommu.c +0 -2
@@ -479,8 +479,6 @@ void amd_iommu_flush_all_devices(void)int i;for (i =0 ; i <= amd_iommu_last_bdf; ++i) { -if (amd_iommu_pd_table[i] ==NULL ) -continue ; iommu = amd_iommu_rlookup_table[i];if (!iommu)
Signature · 1 line
1.6.3.3