Skip to content

Commit 9d27622

Browse files
committed
Merge branch 'for-next/misc' into for-next/core
* for-next/misc: arm64/cpuinfo: only show one cpu's info in c_show() arm64: Extend pr_crit message on invalid FDT arm64: Kconfig: remove unnecessary selection of CRC32 arm64: Add missing includes for mem_encrypt
2 parents dc64de4 + 7bb7977 commit 9d27622

File tree

5 files changed

+62
-60
lines changed

5 files changed

+62
-60
lines changed

arch/arm64/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ config ARM64
135135
select COMMON_CLK
136136
select CPU_PM if (SUSPEND || CPU_IDLE)
137137
select CPUMASK_OFFSTACK if NR_CPUS > 256
138-
select CRC32
139138
select DCACHE_WORD_ACCESS
140139
select DYNAMIC_FTRACE if FUNCTION_TRACER
141140
select DMA_BOUNCE_UNALIGNED_KMALLOC

arch/arm64/include/asm/mem_encrypt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include <asm/rsi.h>
66

7+
struct device;
8+
79
struct arm64_mem_crypt_ops {
810
int (*encrypt)(unsigned long addr, int numpages);
911
int (*decrypt)(unsigned long addr, int numpages);

arch/arm64/include/asm/rsi_cmds.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#define __ASM_RSI_CMDS_H
88

99
#include <linux/arm-smccc.h>
10+
#include <linux/string.h>
11+
#include <asm/memory.h>
1012

1113
#include <asm/rsi_smc.h>
1214

arch/arm64/kernel/cpuinfo.c

Lines changed: 53 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -209,80 +209,79 @@ static const char *const compat_hwcap2_str[] = {
209209

210210
static int c_show(struct seq_file *m, void *v)
211211
{
212-
int i, j;
212+
int j;
213+
int cpu = m->index;
213214
bool compat = personality(current->personality) == PER_LINUX32;
215+
struct cpuinfo_arm64 *cpuinfo = v;
216+
u32 midr = cpuinfo->reg_midr;
214217

215-
for_each_online_cpu(i) {
216-
struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);
217-
u32 midr = cpuinfo->reg_midr;
218-
219-
/*
220-
* glibc reads /proc/cpuinfo to determine the number of
221-
* online processors, looking for lines beginning with
222-
* "processor". Give glibc what it expects.
223-
*/
224-
seq_printf(m, "processor\t: %d\n", i);
225-
if (compat)
226-
seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
227-
MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
218+
/*
219+
* glibc reads /proc/cpuinfo to determine the number of
220+
* online processors, looking for lines beginning with
221+
* "processor". Give glibc what it expects.
222+
*/
223+
seq_printf(m, "processor\t: %d\n", cpu);
224+
if (compat)
225+
seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n",
226+
MIDR_REVISION(midr), COMPAT_ELF_PLATFORM);
228227

229-
seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
230-
loops_per_jiffy / (500000UL/HZ),
231-
loops_per_jiffy / (5000UL/HZ) % 100);
228+
seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
229+
loops_per_jiffy / (500000UL/HZ),
230+
loops_per_jiffy / (5000UL/HZ) % 100);
232231

233-
/*
234-
* Dump out the common processor features in a single line.
235-
* Userspace should read the hwcaps with getauxval(AT_HWCAP)
236-
* rather than attempting to parse this, but there's a body of
237-
* software which does already (at least for 32-bit).
238-
*/
239-
seq_puts(m, "Features\t:");
240-
if (compat) {
232+
/*
233+
* Dump out the common processor features in a single line.
234+
* Userspace should read the hwcaps with getauxval(AT_HWCAP)
235+
* rather than attempting to parse this, but there's a body of
236+
* software which does already (at least for 32-bit).
237+
*/
238+
seq_puts(m, "Features\t:");
239+
if (compat) {
241240
#ifdef CONFIG_COMPAT
242-
for (j = 0; j < ARRAY_SIZE(compat_hwcap_str); j++) {
243-
if (compat_elf_hwcap & (1 << j)) {
244-
/*
245-
* Warn once if any feature should not
246-
* have been present on arm64 platform.
247-
*/
248-
if (WARN_ON_ONCE(!compat_hwcap_str[j]))
249-
continue;
250-
251-
seq_printf(m, " %s", compat_hwcap_str[j]);
252-
}
241+
for (j = 0; j < ARRAY_SIZE(compat_hwcap_str); j++) {
242+
if (compat_elf_hwcap & (1 << j)) {
243+
/*
244+
* Warn once if any feature should not
245+
* have been present on arm64 platform.
246+
*/
247+
if (WARN_ON_ONCE(!compat_hwcap_str[j]))
248+
continue;
249+
250+
seq_printf(m, " %s", compat_hwcap_str[j]);
253251
}
252+
}
254253

255-
for (j = 0; j < ARRAY_SIZE(compat_hwcap2_str); j++)
256-
if (compat_elf_hwcap2 & (1 << j))
257-
seq_printf(m, " %s", compat_hwcap2_str[j]);
254+
for (j = 0; j < ARRAY_SIZE(compat_hwcap2_str); j++)
255+
if (compat_elf_hwcap2 & (1 << j))
256+
seq_printf(m, " %s", compat_hwcap2_str[j]);
258257
#endif /* CONFIG_COMPAT */
259-
} else {
260-
for (j = 0; j < ARRAY_SIZE(hwcap_str); j++)
261-
if (cpu_have_feature(j))
262-
seq_printf(m, " %s", hwcap_str[j]);
263-
}
264-
seq_puts(m, "\n");
265-
266-
seq_printf(m, "CPU implementer\t: 0x%02x\n",
267-
MIDR_IMPLEMENTOR(midr));
268-
seq_printf(m, "CPU architecture: 8\n");
269-
seq_printf(m, "CPU variant\t: 0x%x\n", MIDR_VARIANT(midr));
270-
seq_printf(m, "CPU part\t: 0x%03x\n", MIDR_PARTNUM(midr));
271-
seq_printf(m, "CPU revision\t: %d\n\n", MIDR_REVISION(midr));
258+
} else {
259+
for (j = 0; j < ARRAY_SIZE(hwcap_str); j++)
260+
if (cpu_have_feature(j))
261+
seq_printf(m, " %s", hwcap_str[j]);
272262
}
263+
seq_puts(m, "\n");
264+
265+
seq_printf(m, "CPU implementer\t: 0x%02x\n",
266+
MIDR_IMPLEMENTOR(midr));
267+
seq_puts(m, "CPU architecture: 8\n");
268+
seq_printf(m, "CPU variant\t: 0x%x\n", MIDR_VARIANT(midr));
269+
seq_printf(m, "CPU part\t: 0x%03x\n", MIDR_PARTNUM(midr));
270+
seq_printf(m, "CPU revision\t: %d\n\n", MIDR_REVISION(midr));
273271

274272
return 0;
275273
}
276274

277275
static void *c_start(struct seq_file *m, loff_t *pos)
278276
{
279-
return *pos < 1 ? (void *)1 : NULL;
277+
*pos = cpumask_next(*pos - 1, cpu_online_mask);
278+
return *pos < nr_cpu_ids ? &per_cpu(cpu_data, *pos) : NULL;
280279
}
281280

282281
static void *c_next(struct seq_file *m, void *v, loff_t *pos)
283282
{
284283
++*pos;
285-
return NULL;
284+
return c_start(m, pos);
286285
}
287286

288287
static void c_stop(struct seq_file *m, void *v)

arch/arm64/kernel/setup.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static void __init smp_build_mpidr_hash(void)
169169

170170
static void __init setup_machine_fdt(phys_addr_t dt_phys)
171171
{
172-
int size;
172+
int size = 0;
173173
void *dt_virt = fixmap_remap_fdt(dt_phys, &size, PAGE_KERNEL);
174174
const char *name;
175175

@@ -182,10 +182,10 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)
182182
*/
183183
if (!early_init_dt_scan(dt_virt, dt_phys)) {
184184
pr_crit("\n"
185-
"Error: invalid device tree blob at physical address %pa (virtual address 0x%px)\n"
186-
"The dtb must be 8-byte aligned and must not exceed 2 MB in size\n"
187-
"\nPlease check your bootloader.",
188-
&dt_phys, dt_virt);
185+
"Error: invalid device tree blob: PA=%pa, VA=%px, size=%d bytes\n"
186+
"The dtb must be 8-byte aligned and must not exceed 2 MB in size.\n"
187+
"\nPlease check your bootloader.\n",
188+
&dt_phys, dt_virt, size);
189189

190190
/*
191191
* Note that in this _really_ early stage we cannot even BUG()

0 commit comments

Comments
 (0)