Skip to content

Commit cb95712

Browse files
committed
Merge tag 'powerpc-5.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: - Add perf support for emitting extended registers for power10. - A fix for CPU hotplug on pseries, where on large/loaded systems we may not wait long enough for the CPU to be offlined, leading to crashes. - Addition of a raw cputable entry for Power10, which is not required to boot, but is required to make our PMU setup work correctly in guests. - Three fixes for the recent changes on 32-bit Book3S to move modules into their own segment for strict RWX. - A fix for a recent change in our powernv PCI code that could lead to crashes. - A change to our perf interrupt accounting to avoid soft lockups when using some events, found by syzkaller. - A change in the way we handle power loss events from the hypervisor on pseries. We no longer immediately shut down if we're told we're running on a UPS. - A few other minor fixes. Thanks to Alexey Kardashevskiy, Andreas Schwab, Aneesh Kumar K.V, Anju T Sudhakar, Athira Rajeev, Christophe Leroy, Frederic Barrat, Greg Kurz, Kajol Jain, Madhavan Srinivasan, Michael Neuling, Michael Roth, Nageswara R Sastry, Oliver O'Halloran, Thiago Jung Bauermann, Vaidyanathan Srinivasan, Vasant Hegde. * tag 'powerpc-5.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/perf/hv-24x7: Move cpumask file to top folder of hv-24x7 driver powerpc/32s: Fix module loading failure when VMALLOC_END is over 0xf0000000 powerpc/pseries: Do not initiate shutdown when system is running on UPS powerpc/perf: Fix soft lockups due to missed interrupt accounting powerpc/powernv/pci: Fix possible crash when releasing DMA resources powerpc/pseries/hotplug-cpu: wait indefinitely for vCPU death powerpc/32s: Fix is_module_segment() when MODULES_VADDR is defined powerpc/kasan: Fix KASAN_SHADOW_START on BOOK3S_32 powerpc/fixmap: Fix the size of the early debug area powerpc/pkeys: Fix build error with PPC_MEM_KEYS disabled powerpc/kernel: Cleanup machine check function declarations powerpc: Add POWER10 raw mode cputable entry powerpc/perf: Add extended regs support for power10 platform powerpc/perf: Add support for outputting extended regs in perf intr_regs powerpc: Fix P10 PVR revision in /proc/cpuinfo for SMT4 cores
2 parents 550c212 + 64ef8f2 commit cb95712

File tree

21 files changed

+161
-25
lines changed

21 files changed

+161
-25
lines changed

Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_24x7

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Description: read only
4343
This sysfs interface exposes the number of cores per chip
4444
present in the system.
4545

46-
What: /sys/devices/hv_24x7/interface/cpumask
46+
What: /sys/devices/hv_24x7/cpumask
4747
Date: July 2020
4848
Contact: Linux on PowerPC Developer List <[email protected]>
4949
Description: read only

arch/powerpc/include/asm/cputable.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
#ifndef __ASSEMBLY__
1111

12+
/*
13+
* Added to include __machine_check_early_realmode_* functions
14+
*/
15+
#include <asm/mce.h>
16+
1217
/* This structure can grow, it's real size is used by head.S code
1318
* via the mkdefs mechanism.
1419
*/

arch/powerpc/include/asm/fixmap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ enum fixed_addresses {
5252
FIX_HOLE,
5353
/* reserve the top 128K for early debugging purposes */
5454
FIX_EARLY_DEBUG_TOP = FIX_HOLE,
55-
FIX_EARLY_DEBUG_BASE = FIX_EARLY_DEBUG_TOP+(ALIGN(SZ_128, PAGE_SIZE)/PAGE_SIZE)-1,
55+
FIX_EARLY_DEBUG_BASE = FIX_EARLY_DEBUG_TOP+(ALIGN(SZ_128K, PAGE_SIZE)/PAGE_SIZE)-1,
5656
#ifdef CONFIG_HIGHMEM
5757
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
5858
FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,

arch/powerpc/include/asm/kasan.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@
1515
#ifndef __ASSEMBLY__
1616

1717
#include <asm/page.h>
18+
#include <linux/sizes.h>
1819

1920
#define KASAN_SHADOW_SCALE_SHIFT 3
2021

22+
#if defined(CONFIG_PPC_BOOK3S_32) && defined(CONFIG_MODULES) && defined(CONFIG_STRICT_KERNEL_RWX)
23+
#define KASAN_KERN_START ALIGN_DOWN(PAGE_OFFSET - SZ_256M, SZ_256M)
24+
#else
25+
#define KASAN_KERN_START PAGE_OFFSET
26+
#endif
27+
2128
#define KASAN_SHADOW_START (KASAN_SHADOW_OFFSET + \
22-
(PAGE_OFFSET >> KASAN_SHADOW_SCALE_SHIFT))
29+
(KASAN_KERN_START >> KASAN_SHADOW_SCALE_SHIFT))
2330

2431
#define KASAN_SHADOW_OFFSET ASM_CONST(CONFIG_KASAN_SHADOW_OFFSET)
2532

arch/powerpc/include/asm/mce.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ struct mce_error_info {
210210
#define MCE_EVENT_RELEASE true
211211
#define MCE_EVENT_DONTRELEASE false
212212

213+
struct pt_regs;
214+
struct notifier_block;
215+
213216
extern void save_mce_event(struct pt_regs *regs, long handled,
214217
struct mce_error_info *mce_err, uint64_t nip,
215218
uint64_t addr, uint64_t phys_addr);
@@ -225,5 +228,9 @@ int mce_register_notifier(struct notifier_block *nb);
225228
int mce_unregister_notifier(struct notifier_block *nb);
226229
#ifdef CONFIG_PPC_BOOK3S_64
227230
void flush_and_reload_slb(void);
231+
long __machine_check_early_realmode_p7(struct pt_regs *regs);
232+
long __machine_check_early_realmode_p8(struct pt_regs *regs);
233+
long __machine_check_early_realmode_p9(struct pt_regs *regs);
234+
long __machine_check_early_realmode_p10(struct pt_regs *regs);
228235
#endif /* CONFIG_PPC_BOOK3S_64 */
229236
#endif /* __ASM_PPC64_MCE_H__ */

arch/powerpc/include/asm/perf_event.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,7 @@ static inline bool is_sier_available(void) { return false; }
4040

4141
/* To support perf_regs sier update */
4242
extern bool is_sier_available(void);
43+
/* To define perf extended regs mask value */
44+
extern u64 PERF_REG_EXTENDED_MASK;
45+
#define PERF_REG_EXTENDED_MASK PERF_REG_EXTENDED_MASK
4346
#endif

arch/powerpc/include/asm/perf_event_server.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ struct power_pmu {
6262
int *blacklist_ev;
6363
/* BHRB entries in the PMU */
6464
int bhrb_nr;
65+
/*
66+
* set this flag with `PERF_PMU_CAP_EXTENDED_REGS` if
67+
* the pmu supports extended perf regs capability
68+
*/
69+
int capabilities;
6570
};
6671

6772
/*

arch/powerpc/include/uapi/asm/perf_regs.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,24 @@ enum perf_event_powerpc_regs {
4848
PERF_REG_POWERPC_DSISR,
4949
PERF_REG_POWERPC_SIER,
5050
PERF_REG_POWERPC_MMCRA,
51-
PERF_REG_POWERPC_MAX,
51+
/* Extended registers */
52+
PERF_REG_POWERPC_MMCR0,
53+
PERF_REG_POWERPC_MMCR1,
54+
PERF_REG_POWERPC_MMCR2,
55+
PERF_REG_POWERPC_MMCR3,
56+
PERF_REG_POWERPC_SIER2,
57+
PERF_REG_POWERPC_SIER3,
58+
/* Max regs without the extended regs */
59+
PERF_REG_POWERPC_MAX = PERF_REG_POWERPC_MMCRA + 1,
5260
};
61+
62+
#define PERF_REG_PMU_MASK ((1ULL << PERF_REG_POWERPC_MAX) - 1)
63+
64+
/* PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_300 */
65+
#define PERF_REG_PMU_MASK_300 (((1ULL << (PERF_REG_POWERPC_MMCR2 + 1)) - 1) - PERF_REG_PMU_MASK)
66+
/* PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_31 */
67+
#define PERF_REG_PMU_MASK_31 (((1ULL << (PERF_REG_POWERPC_SIER3 + 1)) - 1) - PERF_REG_PMU_MASK)
68+
69+
#define PERF_REG_MAX_ISA_300 (PERF_REG_POWERPC_MMCR2 + 1)
70+
#define PERF_REG_MAX_ISA_31 (PERF_REG_POWERPC_SIER3 + 1)
5371
#endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */

arch/powerpc/kernel/cputable.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ extern void __setup_cpu_power9(unsigned long offset, struct cpu_spec* spec);
7272
extern void __restore_cpu_power9(void);
7373
extern void __setup_cpu_power10(unsigned long offset, struct cpu_spec* spec);
7474
extern void __restore_cpu_power10(void);
75-
extern long __machine_check_early_realmode_p7(struct pt_regs *regs);
76-
extern long __machine_check_early_realmode_p8(struct pt_regs *regs);
77-
extern long __machine_check_early_realmode_p9(struct pt_regs *regs);
7875
#endif /* CONFIG_PPC64 */
7976
#if defined(CONFIG_E500)
8077
extern void __setup_cpu_e5500(unsigned long offset, struct cpu_spec* spec);
@@ -542,6 +539,25 @@ static struct cpu_spec __initdata cpu_specs[] = {
542539
.machine_check_early = __machine_check_early_realmode_p9,
543540
.platform = "power9",
544541
},
542+
{ /* Power10 */
543+
.pvr_mask = 0xffff0000,
544+
.pvr_value = 0x00800000,
545+
.cpu_name = "POWER10 (raw)",
546+
.cpu_features = CPU_FTRS_POWER10,
547+
.cpu_user_features = COMMON_USER_POWER10,
548+
.cpu_user_features2 = COMMON_USER2_POWER10,
549+
.mmu_features = MMU_FTRS_POWER10,
550+
.icache_bsize = 128,
551+
.dcache_bsize = 128,
552+
.num_pmcs = 6,
553+
.pmc_type = PPC_PMC_IBM,
554+
.oprofile_cpu_type = "ppc64/power10",
555+
.oprofile_type = PPC_OPROFILE_INVALID,
556+
.cpu_setup = __setup_cpu_power10,
557+
.cpu_restore = __restore_cpu_power10,
558+
.machine_check_early = __machine_check_early_realmode_p10,
559+
.platform = "power10",
560+
},
545561
{ /* Cell Broadband Engine */
546562
.pvr_mask = 0xffff0000,
547563
.pvr_value = 0x00700000,

arch/powerpc/kernel/dt_cpu_ftrs.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ struct dt_cpu_feature {
6464
* Set up the base CPU
6565
*/
6666

67-
extern long __machine_check_early_realmode_p8(struct pt_regs *regs);
68-
extern long __machine_check_early_realmode_p9(struct pt_regs *regs);
69-
extern long __machine_check_early_realmode_p10(struct pt_regs *regs);
70-
7167
static int hv_mode;
7268

7369
static struct {

0 commit comments

Comments
 (0)