Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107302676
D15921.id44127.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
D15921.id44127.diff
View Options
Index: sys/dev/ofw/ofw_cpu.c
===================================================================
--- sys/dev/ofw/ofw_cpu.c
+++ sys/dev/ofw/ofw_cpu.c
@@ -191,9 +191,11 @@
if (type == NULL || strcmp(type, "cpu") != 0)
return (ENXIO);
+#if 0
/* Skip SMT CPUs, which we can't reasonably represent with this code */
if (OF_hasprop(ofw_bus_get_node(dev), "ibm,ppc-interrupt-server#s"))
return (ENXIO);
+#endif
device_set_desc(dev, "Open Firmware CPU");
return (0);
@@ -233,6 +235,43 @@
} else
sc->sc_reg_valid = true;
+#ifdef __powerpc__
+ /*
+ * On powerpc, "interrupt-servers" denotes a SMT CPU. Look for any
+ * thread on this CPU, and assign that.
+ */
+ if (OF_hasprop(node, "ibm,ppc-interrupt-server#s")) {
+ struct cpuref cpuref;
+ cell_t *servers;
+ int i, nservers, rv;
+
+ if ((nservers = OF_getencprop_alloc(node,
+ "ibm,ppc-interrupt-server#s", (void **)&servers)) < 0)
+ return (ENXIO);
+ nservers /= sizeof(cell_t);
+ for (i = 0; i < nservers; i++) {
+ for (rv = platform_smp_first_cpu(&cpuref); rv == 0;
+ rv = platform_smp_next_cpu(&cpuref)) {
+ if (cpuref.cr_hwref == servers[i]) {
+ sc->sc_cpu_pcpu =
+ pcpu_find(cpuref.cr_cpuid);
+ if (sc->sc_cpu_pcpu == NULL) {
+ OF_prop_free(servers);
+ return (ENXIO);
+ }
+ break;
+ }
+ }
+ if (rv != ENOENT)
+ break;
+ }
+ OF_prop_free(servers);
+ if (sc->sc_cpu_pcpu == NULL) {
+ device_printf(dev, "No CPU found for this device.\n");
+ return (ENXIO);
+ }
+ } else
+#endif
sc->sc_cpu_pcpu = pcpu_find(device_get_unit(dev));
if (OF_getencprop(node, "clock-frequency", &cell, sizeof(cell)) < 0) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 13, 6:00 AM (10 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15777267
Default Alt Text
D15921.id44127.diff (1 KB)
Attached To
Mode
D15921: Attach dev.cpu nodes on SMT cores, using only the first found thread
Attached
Detach File
Event Timeline
Log In to Comment