summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/amd_iommu_init.c
diff options
context:
space:
mode:
authorSu Friendy2014-05-07 07:54:52 +0200
committerJoerg Roedel2014-05-13 12:33:12 +0200
commit2c16c9fdacbbf3bd8ff6390e12c5d28b3f2c78ac (patch)
treeb766b4a6b468548c002502798518c5d73f21d783 /drivers/iommu/amd_iommu_init.c
parentiommu/amd: Take mmap_sem when calling get_user_pages (diff)
downloadkernel-qcow2-linux-2c16c9fdacbbf3bd8ff6390e12c5d28b3f2c78ac.tar.gz
kernel-qcow2-linux-2c16c9fdacbbf3bd8ff6390e12c5d28b3f2c78ac.tar.xz
kernel-qcow2-linux-2c16c9fdacbbf3bd8ff6390e12c5d28b3f2c78ac.zip
iommu/amd: fix enabling exclusion range for an exact device
set_device_exclusion_range(u16 devid, struct ivmd_header *m) enables exclusion range for ONE device. IOMMU does not translate the access to the exclusion range from the device. The device is specified by input argument 'devid'. But 'devid' is not passed to the actual set function set_dev_entry_bit(), instead 'm->devid' is passed. 'm->devid' does not specify the exact device which needs enable the exclusion range. 'm->devid' represents DeviceID field of IVMD, which has different meaning depends on IVMD type. The caller init_exclusion_range() sets 'devid' for ONE device. When m->type is equal to ACPI_IVMD_TYPE_ALL or ACPI_IVMD_TYPE_RANGE, 'm->devid' is not equal to 'devid'. This patch fixes 'm->devid' to 'devid'. Signed-off-by: Su Friendy <friendy.su@sony.com.cn> Signed-off-by: Tamori Masahiro <Masahiro.Tamori@jp.sony.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu/amd_iommu_init.c')
-rw-r--r--drivers/iommu/amd_iommu_init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index b76c58dbe30c..0e08545d7298 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -788,7 +788,7 @@ static void __init set_device_exclusion_range(u16 devid, struct ivmd_header *m)
* per device. But we can enable the exclusion range per
* device. This is done here
*/
- set_dev_entry_bit(m->devid, DEV_ENTRY_EX);
+ set_dev_entry_bit(devid, DEV_ENTRY_EX);
iommu->exclusion_start = m->range_start;
iommu->exclusion_length = m->range_length;
}