提交 3f05301d 编写于 作者: L Lu Baolu 提交者: Zheng Zengkai

iommu/vt-d: Report the right page fault address

stable inclusion
from stable-5.10.37
commit 32737c3a2669f95ec46e8711f866e050ac2b6be3
bugzilla: 51868
CVE: NA

--------------------------------

[ Upstream commit 03d20509 ]

The Address field of the Page Request Descriptor only keeps bit [63:12]
of the offending address. Convert it to a full address before reporting
it to device drivers.

Fixes: eb8d93ea ("iommu/vt-d: Report page request faults for guest SVA")
Signed-off-by: NLu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20210320025415.641201-2-baolu.lu@linux.intel.comSigned-off-by: NJoerg Roedel <jroedel@suse.de>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 831fb6a9
...@@ -899,7 +899,7 @@ intel_svm_prq_report(struct device *dev, struct page_req_dsc *desc) ...@@ -899,7 +899,7 @@ intel_svm_prq_report(struct device *dev, struct page_req_dsc *desc)
/* Fill in event data for device specific processing */ /* Fill in event data for device specific processing */
memset(&event, 0, sizeof(struct iommu_fault_event)); memset(&event, 0, sizeof(struct iommu_fault_event));
event.fault.type = IOMMU_FAULT_PAGE_REQ; event.fault.type = IOMMU_FAULT_PAGE_REQ;
event.fault.prm.addr = desc->addr; event.fault.prm.addr = (u64)desc->addr << VTD_PAGE_SHIFT;
event.fault.prm.pasid = desc->pasid; event.fault.prm.pasid = desc->pasid;
event.fault.prm.grpid = desc->prg_index; event.fault.prm.grpid = desc->prg_index;
event.fault.prm.perm = prq_to_iommu_prot(desc); event.fault.prm.perm = prq_to_iommu_prot(desc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册