MCPcopy Create free account
hub / github.com/F-Stack/f-stack / print_cpu_features

Function print_cpu_features

freebsd/arm64/arm64/identcpu.c:1525–1642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1523}
1524
1525static void
1526print_cpu_features(u_int cpu)
1527{
1528 struct sbuf *sb;
1529
1530 sb = sbuf_new_auto();
1531 sbuf_printf(sb, "CPU%3d: %s %s r%dp%d", cpu,
1532 cpu_desc[cpu].cpu_impl_name, cpu_desc[cpu].cpu_part_name,
1533 cpu_desc[cpu].cpu_variant, cpu_desc[cpu].cpu_revision);
1534
1535 sbuf_cat(sb, " affinity:");
1536 switch(cpu_aff_levels) {
1537 default:
1538 case 4:
1539 sbuf_printf(sb, " %2d", CPU_AFF3(cpu_desc[cpu].mpidr));
1540 /* FALLTHROUGH */
1541 case 3:
1542 sbuf_printf(sb, " %2d", CPU_AFF2(cpu_desc[cpu].mpidr));
1543 /* FALLTHROUGH */
1544 case 2:
1545 sbuf_printf(sb, " %2d", CPU_AFF1(cpu_desc[cpu].mpidr));
1546 /* FALLTHROUGH */
1547 case 1:
1548 case 0: /* On UP this will be zero */
1549 sbuf_printf(sb, " %2d", CPU_AFF0(cpu_desc[cpu].mpidr));
1550 break;
1551 }
1552 sbuf_finish(sb);
1553 printf("%s\n", sbuf_data(sb));
1554 sbuf_clear(sb);
1555
1556 /*
1557 * There is a hardware errata where, if one CPU is performing a TLB
1558 * invalidation while another is performing a store-exclusive the
1559 * store-exclusive may return the wrong status. A workaround seems
1560 * to be to use an IPI to invalidate on each CPU, however given the
1561 * limited number of affected units (pass 1.1 is the evaluation
1562 * hardware revision), and the lack of information from Cavium
1563 * this has not been implemented.
1564 *
1565 * At the time of writing this the only information is from:
1566 * https://lkml.org/lkml/2016/8/4/722
1567 */
1568 /*
1569 * XXX: CPU_MATCH_ERRATA_CAVIUM_THUNDERX_1_1 on its own also
1570 * triggers on pass 2.0+.
1571 */
1572 if (cpu == 0 && CPU_VAR(PCPU_GET(midr)) == 0 &&
1573 CPU_MATCH_ERRATA_CAVIUM_THUNDERX_1_1)
1574 printf("WARNING: ThunderX Pass 1.1 detected.\nThis has known "
1575 "hardware bugs that may cause the incorrect operation of "
1576 "atomic operations.\n");
1577
1578 /* Cache Type Register */
1579 if (cpu == 0 || (cpu_print_regs & PRINT_CTR_EL0) != 0) {
1580 print_register(sb, "Cache Type",
1581 cpu_desc[cpu].ctr, print_ctr_fields, NULL);
1582 }

Callers

nothing calls this directly

Calls 9

sbuf_printfFunction · 0.85
sbuf_catFunction · 0.85
sbuf_finishFunction · 0.85
sbuf_dataFunction · 0.85
sbuf_clearFunction · 0.85
print_registerFunction · 0.85
print_id_registerFunction · 0.85
sbuf_deleteFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected