aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-01-19 14:19:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-01-19 14:19:11 -0500
commit4917d5df3851d0d3febc8e4bbfd964132e746149 (patch)
tree221733da8d35e2597e1e23a161539c68ccc3f760
parent9abc937836b46757950193485ff2d92944c1af96 (diff)
parent1b689a95ce7427075f9ac9fb4aea1af530742b7f (diff)
Merge tag 'powerpc-4.15-8' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "More than we'd like after rc8, but nothing very alarming either, just tying up loose ends before the release: Since we changed powernv to use cpufreq_get() from show_cpuinfo(), we see warnings with PREEMPT enabled. But the preempt_disable() in show_cpuinfo() doesn't actually prevent CPU hotplug as it suggests, so remove it. Two updates to the recently merged RFI flush code. Wire up the generic sysfs file to report the status, and add a debugfs file to allow enabling/disabling it at runtime. Two updates to xmon, one to add the RFI flush related fields to the paca dump, and another to not use hashed pointers in the paca dump. And one minor fix to add a missing include of linux/types.h in asm/hvcall.h, not seen to break the build in upstream, but correct anyway. Thanks to: Benjamin Herrenschmidt, Michal Suchanek, Nicholas Piggin" * tag 'powerpc-4.15-8' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/pseries: include linux/types.h in asm/hvcall.h powerpc/64s: Allow control of RFI flush via debugfs powerpc/64s: Wire up cpu_show_meltdown() powerpc: Don't preempt_disable() in show_cpuinfo() powerpc/xmon: Don't print hashed pointers in paca dump powerpc/xmon: Add RFI flush related fields to paca dump
-rw-r--r--arch/powerpc/Kconfig1
-rw-r--r--arch/powerpc/include/asm/hvcall.h1
-rw-r--r--arch/powerpc/kernel/setup-common.c11
-rw-r--r--arch/powerpc/kernel/setup_64.c38
-rw-r--r--arch/powerpc/xmon/xmon.c26
5 files changed, 55 insertions, 22 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index c51e6ce42e7a..2ed525a44734 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -166,6 +166,7 @@ config PPC
166 select GENERIC_CLOCKEVENTS_BROADCAST if SMP 166 select GENERIC_CLOCKEVENTS_BROADCAST if SMP
167 select GENERIC_CMOS_UPDATE 167 select GENERIC_CMOS_UPDATE
168 select GENERIC_CPU_AUTOPROBE 168 select GENERIC_CPU_AUTOPROBE
169 select GENERIC_CPU_VULNERABILITIES if PPC_BOOK3S_64
169 select GENERIC_IRQ_SHOW 170 select GENERIC_IRQ_SHOW
170 select GENERIC_IRQ_SHOW_LEVEL 171 select GENERIC_IRQ_SHOW_LEVEL
171 select GENERIC_SMP_IDLE_THREAD 172 select GENERIC_SMP_IDLE_THREAD
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
index f0461618bf7b..eca3f9c68907 100644
--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -353,6 +353,7 @@
353#define PROC_TABLE_GTSE 0x01 353#define PROC_TABLE_GTSE 0x01
354 354
355#ifndef __ASSEMBLY__ 355#ifndef __ASSEMBLY__
356#include <linux/types.h>
356 357
357/** 358/**
358 * plpar_hcall_norets: - Make a pseries hypervisor call with no return arguments 359 * plpar_hcall_norets: - Make a pseries hypervisor call with no return arguments
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 9d213542a48b..8fd3a70047f1 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -242,14 +242,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
242 unsigned short maj; 242 unsigned short maj;
243 unsigned short min; 243 unsigned short min;
244 244
245 /* We only show online cpus: disable preempt (overzealous, I
246 * knew) to prevent cpu going down. */
247 preempt_disable();
248 if (!cpu_online(cpu_id)) {
249 preempt_enable();
250 return 0;
251 }
252
253#ifdef CONFIG_SMP 245#ifdef CONFIG_SMP
254 pvr = per_cpu(cpu_pvr, cpu_id); 246 pvr = per_cpu(cpu_pvr, cpu_id);
255#else 247#else
@@ -358,9 +350,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
358#ifdef CONFIG_SMP 350#ifdef CONFIG_SMP
359 seq_printf(m, "\n"); 351 seq_printf(m, "\n");
360#endif 352#endif
361
362 preempt_enable();
363
364 /* If this is the last cpu, print the summary */ 353 /* If this is the last cpu, print the summary */
365 if (cpumask_next(cpu_id, cpu_online_mask) >= nr_cpu_ids) 354 if (cpumask_next(cpu_id, cpu_online_mask) >= nr_cpu_ids)
366 show_cpuinfo_summary(m); 355 show_cpuinfo_summary(m);
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 491be4179ddd..e67413f4a8f0 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -38,6 +38,7 @@
38#include <linux/memory.h> 38#include <linux/memory.h>
39#include <linux/nmi.h> 39#include <linux/nmi.h>
40 40
41#include <asm/debugfs.h>
41#include <asm/io.h> 42#include <asm/io.h>
42#include <asm/kdump.h> 43#include <asm/kdump.h>
43#include <asm/prom.h> 44#include <asm/prom.h>
@@ -901,4 +902,41 @@ void __init setup_rfi_flush(enum l1d_flush_type types, bool enable)
901 if (!no_rfi_flush) 902 if (!no_rfi_flush)
902 rfi_flush_enable(enable); 903 rfi_flush_enable(enable);
903} 904}
905
906#ifdef CONFIG_DEBUG_FS
907static int rfi_flush_set(void *data, u64 val)
908{
909 if (val == 1)
910 rfi_flush_enable(true);
911 else if (val == 0)
912 rfi_flush_enable(false);
913 else
914 return -EINVAL;
915
916 return 0;
917}
918
919static int rfi_flush_get(void *data, u64 *val)
920{
921 *val = rfi_flush ? 1 : 0;
922 return 0;
923}
924
925DEFINE_SIMPLE_ATTRIBUTE(fops_rfi_flush, rfi_flush_get, rfi_flush_set, "%llu\n");
926
927static __init int rfi_flush_debugfs_init(void)
928{
929 debugfs_create_file("rfi_flush", 0600, powerpc_debugfs_root, NULL, &fops_rfi_flush);
930 return 0;
931}
932device_initcall(rfi_flush_debugfs_init);
933#endif
934
935ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf)
936{
937 if (rfi_flush)
938 return sprintf(buf, "Mitigation: RFI Flush\n");
939
940 return sprintf(buf, "Vulnerable\n");
941}
904#endif /* CONFIG_PPC_BOOK3S_64 */ 942#endif /* CONFIG_PPC_BOOK3S_64 */
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index cab24f549e7c..0ddc7ac6c5f1 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2344,10 +2344,10 @@ static void dump_one_paca(int cpu)
2344 DUMP(p, kernel_toc, "lx"); 2344 DUMP(p, kernel_toc, "lx");
2345 DUMP(p, kernelbase, "lx"); 2345 DUMP(p, kernelbase, "lx");
2346 DUMP(p, kernel_msr, "lx"); 2346 DUMP(p, kernel_msr, "lx");
2347 DUMP(p, emergency_sp, "p"); 2347 DUMP(p, emergency_sp, "px");
2348#ifdef CONFIG_PPC_BOOK3S_64 2348#ifdef CONFIG_PPC_BOOK3S_64
2349 DUMP(p, nmi_emergency_sp, "p"); 2349 DUMP(p, nmi_emergency_sp, "px");
2350 DUMP(p, mc_emergency_sp, "p"); 2350 DUMP(p, mc_emergency_sp, "px");
2351 DUMP(p, in_nmi, "x"); 2351 DUMP(p, in_nmi, "x");
2352 DUMP(p, in_mce, "x"); 2352 DUMP(p, in_mce, "x");
2353 DUMP(p, hmi_event_available, "x"); 2353 DUMP(p, hmi_event_available, "x");
@@ -2375,17 +2375,21 @@ static void dump_one_paca(int cpu)
2375 DUMP(p, slb_cache_ptr, "x"); 2375 DUMP(p, slb_cache_ptr, "x");
2376 for (i = 0; i < SLB_CACHE_ENTRIES; i++) 2376 for (i = 0; i < SLB_CACHE_ENTRIES; i++)
2377 printf(" slb_cache[%d]: = 0x%016lx\n", i, p->slb_cache[i]); 2377 printf(" slb_cache[%d]: = 0x%016lx\n", i, p->slb_cache[i]);
2378
2379 DUMP(p, rfi_flush_fallback_area, "px");
2380 DUMP(p, l1d_flush_congruence, "llx");
2381 DUMP(p, l1d_flush_sets, "llx");
2378#endif 2382#endif
2379 DUMP(p, dscr_default, "llx"); 2383 DUMP(p, dscr_default, "llx");
2380#ifdef CONFIG_PPC_BOOK3E 2384#ifdef CONFIG_PPC_BOOK3E
2381 DUMP(p, pgd, "p"); 2385 DUMP(p, pgd, "px");
2382 DUMP(p, kernel_pgd, "p"); 2386 DUMP(p, kernel_pgd, "px");
2383 DUMP(p, tcd_ptr, "p"); 2387 DUMP(p, tcd_ptr, "px");
2384 DUMP(p, mc_kstack, "p"); 2388 DUMP(p, mc_kstack, "px");
2385 DUMP(p, crit_kstack, "p"); 2389 DUMP(p, crit_kstack, "px");
2386 DUMP(p, dbg_kstack, "p"); 2390 DUMP(p, dbg_kstack, "px");
2387#endif 2391#endif
2388 DUMP(p, __current, "p"); 2392 DUMP(p, __current, "px");
2389 DUMP(p, kstack, "lx"); 2393 DUMP(p, kstack, "lx");
2390 printf(" kstack_base = 0x%016lx\n", p->kstack & ~(THREAD_SIZE - 1)); 2394 printf(" kstack_base = 0x%016lx\n", p->kstack & ~(THREAD_SIZE - 1));
2391 DUMP(p, stab_rr, "lx"); 2395 DUMP(p, stab_rr, "lx");
@@ -2403,7 +2407,7 @@ static void dump_one_paca(int cpu)
2403#endif 2407#endif
2404 2408
2405#ifdef CONFIG_PPC_POWERNV 2409#ifdef CONFIG_PPC_POWERNV
2406 DUMP(p, core_idle_state_ptr, "p"); 2410 DUMP(p, core_idle_state_ptr, "px");
2407 DUMP(p, thread_idle_state, "x"); 2411 DUMP(p, thread_idle_state, "x");
2408 DUMP(p, thread_mask, "x"); 2412 DUMP(p, thread_mask, "x");
2409 DUMP(p, subcore_sibling_mask, "x"); 2413 DUMP(p, subcore_sibling_mask, "x");