提交 2c16c9fd 编写于 作者: S Su Friendy 提交者: Joerg Roedel

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: NSu Friendy <friendy.su@sony.com.cn>
Signed-off-by: NTamori Masahiro <Masahiro.Tamori@jp.sony.com>
Signed-off-by: NJoerg Roedel <joro@8bytes.org>
上级 4378d992
...@@ -788,7 +788,7 @@ static void __init set_device_exclusion_range(u16 devid, struct ivmd_header *m) ...@@ -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 * per device. But we can enable the exclusion range per
* device. This is done here * 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_start = m->range_start;
iommu->exclusion_length = m->range_length; iommu->exclusion_length = m->range_length;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册