Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1275372
| From | Jiri Slaby <jslaby@suse.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3.12 05/72] iommu/amd: Don't clear DTE flags when modifying it |
| Date | 2015-11-23 14:30 +0100 |
| Message-ID | <qxZlV-2hK-37@gated-at.bofh.it> (permalink) |
| References | <qxZ2y-29g-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Joerg Roedel <jroedel@suse.de>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit cbf3ccd09d683abf1cacd36e3640872ee912d99b upstream.
During device assignment/deassignment the flags in the DTE
get lost, which might cause spurious faults, for example
when the device tries to access the system management range.
Fix this by not clearing the flags with the rest of the DTE.
Reported-by: G. Richard Bellamy <rbellamy@pteradigm.com>
Tested-by: G. Richard Bellamy <rbellamy@pteradigm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/iommu/amd_iommu.c | 4 ++--
drivers/iommu/amd_iommu_types.h | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index d22b4af761f5..382c9ee08a25 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2147,8 +2147,8 @@ static void set_dte_entry(u16 devid, struct protection_domain *domain, bool ats)
static void clear_dte_entry(u16 devid)
{
/* remove entry from the device table seen by the hardware */
- amd_iommu_dev_table[devid].data[0] = IOMMU_PTE_P | IOMMU_PTE_TV;
- amd_iommu_dev_table[devid].data[1] = 0;
+ amd_iommu_dev_table[devid].data[0] = IOMMU_PTE_P | IOMMU_PTE_TV;
+ amd_iommu_dev_table[devid].data[1] &= DTE_FLAG_MASK;
amd_iommu_apply_erratum_63(devid);
}
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
index 97e81fe5c330..271191980d6a 100644
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -289,6 +289,7 @@
#define IOMMU_PTE_IR (1ULL << 61)
#define IOMMU_PTE_IW (1ULL << 62)
+#define DTE_FLAG_MASK (0x3ffULL << 32)
#define DTE_FLAG_IOTLB (0x01UL << 32)
#define DTE_FLAG_GV (0x01ULL << 55)
#define DTE_GLX_SHIFT (56)
--
2.6.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 3.12 01/72] dm btree remove: fix a bug when rebalancing nodes after removal Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:10 +0100 [PATCH 3.12 07/72] ASoC: wm8904: Correct number of EQ registers Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:10 +0100 [PATCH 3.12 02/72] iwlwifi: dvm: fix D3 firmware PN programming Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100 [PATCH 3.12 04/72] iwlwifi: mvm: fix D3 firmware PN programming Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100 [PATCH 3.12 03/72] iwlwifi: fix firmware filename for 3160 Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100 [PATCH 3.12 05/72] iommu/amd: Don't clear DTE flags when modifying it Jiri Slaby <jslaby@suse.cz> - 2015-11-23 14:30 +0100
csiph-web