Commit 5e39977edf6500fd12f169e6c458d33b0ef62feb

Authored by Will Deacon
1 parent 7c68a9cc04

Revert "arm64: cpuinfo: print info for all CPUs"

It turns out that vendors are relying on the format of /proc/cpuinfo,
and we've even spotted out-of-tree hacks attempting to make it look
identical to the format used by arch/arm/. That means we can't afford to
churn this interface in mainline, so revert the recent reformatting of
the file for arm64 pending discussions on the list to find out what
people actually want.

This reverts commit d7a49086f263164a2c4c178eb76412d48cd671d7.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>

Showing 1 changed file with 22 additions and 18 deletions Side-by-side Diff

arch/arm64/kernel/setup.c
... ... @@ -78,6 +78,7 @@
78 78 #endif
79 79  
80 80 static const char *cpu_name;
  81 +static const char *machine_name;
81 82 phys_addr_t __fdt_pointer __initdata;
82 83  
83 84 /*
... ... @@ -309,6 +310,8 @@
309 310 while (true)
310 311 cpu_relax();
311 312 }
  313 +
  314 + machine_name = of_flat_dt_get_machine_name();
312 315 }
313 316  
314 317 /*
315 318  
... ... @@ -447,21 +450,10 @@
447 450 {
448 451 int i;
449 452  
450   - /*
451   - * Dump out the common processor features in a single line. Userspace
452   - * should read the hwcaps with getauxval(AT_HWCAP) rather than
453   - * attempting to parse this.
454   - */
455   - seq_puts(m, "features\t:");
456   - for (i = 0; hwcap_str[i]; i++)
457   - if (elf_hwcap & (1 << i))
458   - seq_printf(m, " %s", hwcap_str[i]);
459   - seq_puts(m, "\n\n");
  453 + seq_printf(m, "Processor\t: %s rev %d (%s)\n",
  454 + cpu_name, read_cpuid_id() & 15, ELF_PLATFORM);
460 455  
461 456 for_each_online_cpu(i) {
462   - struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);
463   - u32 midr = cpuinfo->reg_midr;
464   -
465 457 /*
466 458 * glibc reads /proc/cpuinfo to determine the number of
467 459 * online processors, looking for lines beginning with
468 460  
... ... @@ -470,12 +462,24 @@
470 462 #ifdef CONFIG_SMP
471 463 seq_printf(m, "processor\t: %d\n", i);
472 464 #endif
473   - seq_printf(m, "implementer\t: 0x%02x\n",
474   - MIDR_IMPLEMENTOR(midr));
475   - seq_printf(m, "variant\t\t: 0x%x\n", MIDR_VARIANT(midr));
476   - seq_printf(m, "partnum\t\t: 0x%03x\n", MIDR_PARTNUM(midr));
477   - seq_printf(m, "revision\t: 0x%x\n\n", MIDR_REVISION(midr));
478 465 }
  466 +
  467 + /* dump out the processor features */
  468 + seq_puts(m, "Features\t: ");
  469 +
  470 + for (i = 0; hwcap_str[i]; i++)
  471 + if (elf_hwcap & (1 << i))
  472 + seq_printf(m, "%s ", hwcap_str[i]);
  473 +
  474 + seq_printf(m, "\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24);
  475 + seq_printf(m, "CPU architecture: AArch64\n");
  476 + seq_printf(m, "CPU variant\t: 0x%x\n", (read_cpuid_id() >> 20) & 15);
  477 + seq_printf(m, "CPU part\t: 0x%03x\n", (read_cpuid_id() >> 4) & 0xfff);
  478 + seq_printf(m, "CPU revision\t: %d\n", read_cpuid_id() & 15);
  479 +
  480 + seq_puts(m, "\n");
  481 +
  482 + seq_printf(m, "Hardware\t: %s\n", machine_name);
479 483  
480 484 return 0;
481 485 }