Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115918565
D34907.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D34907.diff
View Options
diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c
--- a/sys/x86/iommu/intel_drv.c
+++ b/sys/x86/iommu/intel_drv.c
@@ -405,6 +405,7 @@
struct dmar_unit *unit;
ACPI_DMAR_HARDWARE_UNIT *dmaru;
uint64_t timeout;
+ int disable_pmr;
int i, error;
unit = device_get_softc(dev);
@@ -528,6 +529,16 @@
dmar_release_resources(dev, unit);
return (error);
}
+
+ disable_pmr = 0;
+ TUNABLE_INT_FETCH("hw.dmar.pmr.disable", &disable_pmr);
+ if (disable_pmr) {
+ error = dmar_disable_protected_regions(unit);
+ if (error != 0)
+ device_printf(dev,
+ "Failed to disable protected regions\n");
+ }
+
error = iommu_init_busdma(&unit->iommu);
if (error != 0) {
dmar_release_resources(dev, unit);
diff --git a/sys/x86/iommu/intel_utils.c b/sys/x86/iommu/intel_utils.c
--- a/sys/x86/iommu/intel_utils.c
+++ b/sys/x86/iommu/intel_utils.c
@@ -508,6 +508,9 @@
return (0);
reg = dmar_read4(unit, DMAR_PMEN_REG);
+ if ((reg & DMAR_PMEN_EPM) == 0)
+ return (0);
+
reg &= ~DMAR_PMEN_EPM;
dmar_write4(unit, DMAR_PMEN_REG, reg);
DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_PMEN_REG) & DMAR_PMEN_PRS)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 1, 9:59 AM (3 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17879066
Default Alt Text
D34907.diff (1 KB)
Attached To
Mode
D34907: dmar: Disable PMR in driver attach routine
Attached
Detach File
Event Timeline
Log In to Comment