| From 5a1f50689dfa1b62a2fed92a47fbf43d51102a4a Mon Sep 17 00:00:00 2001 |
| From: Jacob Pan <jacob.jun.pan@linux.intel.com> |
| Date: Thu, 2 Jan 2020 08:18:09 +0800 |
| Subject: [PATCH] iommu/vt-d: Avoid sending invalid page response |
| |
| commit 5f75585e19cc7018bf2016aa771632081ee2f313 upstream. |
| |
| Page responses should only be sent when last page in group (LPIG) or |
| private data is present in the page request. This patch avoids sending |
| invalid descriptors. |
| |
| Fixes: 5d308fc1ecf53 ("iommu/vt-d: Add 256-bit invalidation descriptor support") |
| Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com> |
| Reviewed-by: Eric Auger <eric.auger@redhat.com> |
| Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> |
| Signed-off-by: Joerg Roedel <jroedel@suse.de> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c |
| index 1212cd01533f..3cc9fcdafd6e 100644 |
| --- a/drivers/iommu/intel-svm.c |
| +++ b/drivers/iommu/intel-svm.c |
| @@ -639,11 +639,10 @@ static irqreturn_t prq_event_thread(int irq, void *d) |
| if (req->priv_data_present) |
| memcpy(&resp.qw2, req->priv_data, |
| sizeof(req->priv_data)); |
| + resp.qw2 = 0; |
| + resp.qw3 = 0; |
| + qi_submit_sync(&resp, iommu); |
| } |
| - resp.qw2 = 0; |
| - resp.qw3 = 0; |
| - qi_submit_sync(&resp, iommu); |
| - |
| head = (head + sizeof(*req)) & PRQ_RING_MASK; |
| } |
| |
| -- |
| 2.7.4 |
| |