Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143925603
D54832.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
D54832.diff
View Options
diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c
--- a/sys/arm/arm/gic.c
+++ b/sys/arm/arm/gic.c
@@ -151,6 +151,8 @@
/* CPU Interface */
#define gic_c_read_4(_sc, _reg) \
bus_read_4((_sc)->gic_res[GIC_RES_CPU], (_reg))
+#define gic_c_peek_4(_sc, _reg, _val) \
+ bus_peek_4((_sc)->gic_res[GIC_RES_CPU], (_reg), (_val))
#define gic_c_write_4(_sc, _reg, _val) \
bus_write_4((_sc)->gic_res[GIC_RES_CPU], (_reg), (_val))
/* Distributor Interface */
@@ -347,7 +349,18 @@
goto cleanup;
}
- icciidr = gic_c_read_4(sc, GICC_IIDR);
+ /*
+ * Try accessing a CPU interface register. On some broken
+ * virtualization environments this will raise an external
+ * data abort. When this happens we can detect it using
+ * by peeking at the register & checking for the fault.
+ * As there is no way to continue with a normal boot we
+ * panic.
+ */
+ if (gic_c_peek_4(sc, GICC_IIDR, &icciidr) != 0)
+ panic("Unable to access %s CPU registers, "
+ "broken hardware or hypervisor configuration",
+ device_get_nameunit(dev));
device_printf(dev,
"pn 0x%x, arch 0x%x, rev 0x%x, implementer 0x%x irqs %u\n",
GICD_IIDR_PROD(icciidr), GICD_IIDR_VAR(icciidr),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 3, 2:01 AM (5 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27899615
Default Alt Text
D54832.diff (1 KB)
Attached To
Mode
D54832: arm/gic: Detect broken configurations
Attached
Detach File
Event Timeline
Log In to Comment