Merge branch 'iommu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into x86/urgent
This commit is contained in:
@ -31,6 +31,7 @@ extern irqreturn_t amd_iommu_int_handler(int irq, void *data);
|
||||
extern void amd_iommu_flush_all_domains(void);
|
||||
extern void amd_iommu_flush_all_devices(void);
|
||||
extern void amd_iommu_shutdown(void);
|
||||
extern void amd_iommu_apply_erratum_63(u16 devid);
|
||||
#else
|
||||
static inline int amd_iommu_init(void) { return -ENODEV; }
|
||||
static inline void amd_iommu_detect(void) { }
|
||||
|
@ -1220,6 +1220,8 @@ static void __detach_device(struct protection_domain *domain, u16 devid)
|
||||
amd_iommu_dev_table[devid].data[1] = 0;
|
||||
amd_iommu_dev_table[devid].data[2] = 0;
|
||||
|
||||
amd_iommu_apply_erratum_63(devid);
|
||||
|
||||
/* decrease reference counter */
|
||||
domain->dev_cnt -= 1;
|
||||
|
||||
|
@ -240,7 +240,7 @@ static void iommu_feature_enable(struct amd_iommu *iommu, u8 bit)
|
||||
writel(ctrl, iommu->mmio_base + MMIO_CONTROL_OFFSET);
|
||||
}
|
||||
|
||||
static void __init iommu_feature_disable(struct amd_iommu *iommu, u8 bit)
|
||||
static void iommu_feature_disable(struct amd_iommu *iommu, u8 bit)
|
||||
{
|
||||
u32 ctrl;
|
||||
|
||||
@ -519,6 +519,26 @@ static void set_dev_entry_bit(u16 devid, u8 bit)
|
||||
amd_iommu_dev_table[devid].data[i] |= (1 << _bit);
|
||||
}
|
||||
|
||||
static int get_dev_entry_bit(u16 devid, u8 bit)
|
||||
{
|
||||
int i = (bit >> 5) & 0x07;
|
||||
int _bit = bit & 0x1f;
|
||||
|
||||
return (amd_iommu_dev_table[devid].data[i] & (1 << _bit)) >> _bit;
|
||||
}
|
||||
|
||||
|
||||
void amd_iommu_apply_erratum_63(u16 devid)
|
||||
{
|
||||
int sysmgt;
|
||||
|
||||
sysmgt = get_dev_entry_bit(devid, DEV_ENTRY_SYSMGT1) |
|
||||
(get_dev_entry_bit(devid, DEV_ENTRY_SYSMGT2) << 1);
|
||||
|
||||
if (sysmgt == 0x01)
|
||||
set_dev_entry_bit(devid, DEV_ENTRY_IW);
|
||||
}
|
||||
|
||||
/* Writes the specific IOMMU for a device into the rlookup table */
|
||||
static void __init set_iommu_for_device(struct amd_iommu *iommu, u16 devid)
|
||||
{
|
||||
@ -547,6 +567,8 @@ static void __init set_dev_entry_from_acpi(struct amd_iommu *iommu,
|
||||
if (flags & ACPI_DEVFLAG_LINT1)
|
||||
set_dev_entry_bit(devid, DEV_ENTRY_LINT1_PASS);
|
||||
|
||||
amd_iommu_apply_erratum_63(devid);
|
||||
|
||||
set_iommu_for_device(iommu, devid);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user