Skip to content

Commit c02197f

Browse files
committed
Merge tag 'powerpc-6.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "This is a bit of a big batch for rc4, but just due to holiday hangover and because I didn't send any fixes last week due to a late revert request. I think next week should be back to normal. - Fix ftrace bug on boot caused by exit text sections with '-fpatchable-function-entry' - Fix accuracy of stolen time on pseries since the switch to VIRT_CPU_ACCOUNTING_GEN - Fix a crash in the IOMMU code when doing DLPAR remove - Set pt_regs->link on scv entry to fix BPF stack unwinding - Add missing PPC_FEATURE_BOOKE on 64-bit e5500/e6500, which broke gdb - Fix boot on some 6xx platforms with STRICT_KERNEL_RWX enabled - Fix build failures with KASAN enabled and 32KB stack size - Some other minor fixes Thanks to Arnd Bergmann, Benjamin Gray, Christophe Leroy, David Engraf, Gaurav Batra, Jason Gunthorpe, Jiangfeng Xiao, Matthias Schiffer, Nathan Lynch, Naveen N Rao, Nicholas Piggin, Nysal Jan K.A, R Nageswara Sastry, Shivaprasad G Bhat, Shrikanth Hegde, Spoorthy, Srikar Dronamraju, and Venkat Rao Bagalkote" * tag 'powerpc-6.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/iommu: Fix the missing iommu_group_put() during platform domain attach powerpc/pseries: fix accuracy of stolen time powerpc/ftrace: Ignore ftrace locations in exit text sections powerpc/cputable: Add missing PPC_FEATURE_BOOKE on PPC64 Book-E powerpc/kasan: Limit KASAN thread size increase to 32KB Revert "powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add" powerpc: 85xx: mark local functions static powerpc: udbg_memcons: mark functions static powerpc/kasan: Fix addr error caused by page alignment powerpc/6xx: set High BAT Enable flag on G2_LE cores selftests/powerpc/papr_vpd: Check devfd before get_system_loc_code() powerpc/64: Set task pt_regs->link to the LR value on scv entry powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add powerpc/pseries/papr-sysparm: use u8 arrays for payloads
2 parents f2667e0 + 0846dd7 commit c02197f

File tree

24 files changed

+77
-33
lines changed

24 files changed

+77
-33
lines changed

arch/powerpc/include/asm/ftrace.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@
2020
#ifndef __ASSEMBLY__
2121
extern void _mcount(void);
2222

23-
static inline unsigned long ftrace_call_adjust(unsigned long addr)
24-
{
25-
if (IS_ENABLED(CONFIG_ARCH_USING_PATCHABLE_FUNCTION_ENTRY))
26-
addr += MCOUNT_INSN_SIZE;
27-
28-
return addr;
29-
}
30-
3123
unsigned long prepare_ftrace_return(unsigned long parent, unsigned long ip,
3224
unsigned long sp);
3325

@@ -142,8 +134,10 @@ static inline u8 this_cpu_get_ftrace_enabled(void) { return 1; }
142134
#ifdef CONFIG_FUNCTION_TRACER
143135
extern unsigned int ftrace_tramp_text[], ftrace_tramp_init[];
144136
void ftrace_free_init_tramp(void);
137+
unsigned long ftrace_call_adjust(unsigned long addr);
145138
#else
146139
static inline void ftrace_free_init_tramp(void) { }
140+
static inline unsigned long ftrace_call_adjust(unsigned long addr) { return addr; }
147141
#endif
148142
#endif /* !__ASSEMBLY__ */
149143

arch/powerpc/include/asm/papr-sysparm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ typedef struct {
3232
*/
3333
struct papr_sysparm_buf {
3434
__be16 len;
35-
char val[PAPR_SYSPARM_MAX_OUTPUT];
35+
u8 val[PAPR_SYSPARM_MAX_OUTPUT];
3636
};
3737

3838
struct papr_sysparm_buf *papr_sysparm_buf_alloc(void);

arch/powerpc/include/asm/reg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,8 @@
617617
#endif
618618
#define SPRN_HID2 0x3F8 /* Hardware Implementation Register 2 */
619619
#define SPRN_HID2_GEKKO 0x398 /* Gekko HID2 Register */
620+
#define SPRN_HID2_G2_LE 0x3F3 /* G2_LE HID2 Register */
621+
#define HID2_G2_LE_HBE (1<<18) /* High BAT Enable (G2_LE) */
620622
#define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */
621623
#define SPRN_IABR2 0x3FA /* 83xx */
622624
#define SPRN_IBCR 0x135 /* 83xx Insn Breakpoint Control Reg */

arch/powerpc/include/asm/sections.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ typedef struct func_desc func_desc_t;
1414

1515
extern char __head_end[];
1616
extern char __srwx_boundary[];
17+
extern char __exittext_begin[], __exittext_end[];
1718

1819
/* Patch sites */
1920
extern s32 patch__call_flush_branch_caches1;

arch/powerpc/include/asm/thread_info.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#ifdef __KERNEL__
1616

17-
#ifdef CONFIG_KASAN
17+
#if defined(CONFIG_KASAN) && CONFIG_THREAD_SHIFT < 15
1818
#define MIN_THREAD_SHIFT (CONFIG_THREAD_SHIFT + 1)
1919
#else
2020
#define MIN_THREAD_SHIFT CONFIG_THREAD_SHIFT

arch/powerpc/include/uapi/asm/papr-sysparm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ enum {
1414
struct papr_sysparm_io_block {
1515
__u32 parameter;
1616
__u16 length;
17-
char data[PAPR_SYSPARM_MAX_OUTPUT];
17+
__u8 data[PAPR_SYSPARM_MAX_OUTPUT];
1818
};
1919

2020
/**

arch/powerpc/kernel/cpu_setup_6xx.S

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ BEGIN_FTR_SECTION
2626
bl __init_fpu_registers
2727
END_FTR_SECTION_IFCLR(CPU_FTR_FPU_UNAVAILABLE)
2828
bl setup_common_caches
29+
30+
/*
31+
* This assumes that all cores using __setup_cpu_603 with
32+
* MMU_FTR_USE_HIGH_BATS are G2_LE compatible
33+
*/
34+
BEGIN_MMU_FTR_SECTION
35+
bl setup_g2_le_hid2
36+
END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
37+
2938
mtlr r5
3039
blr
3140
_GLOBAL(__setup_cpu_604)
@@ -115,6 +124,16 @@ SYM_FUNC_START_LOCAL(setup_604_hid0)
115124
blr
116125
SYM_FUNC_END(setup_604_hid0)
117126

127+
/* Enable high BATs for G2_LE and derivatives like e300cX */
128+
SYM_FUNC_START_LOCAL(setup_g2_le_hid2)
129+
mfspr r11,SPRN_HID2_G2_LE
130+
oris r11,r11,HID2_G2_LE_HBE@h
131+
mtspr SPRN_HID2_G2_LE,r11
132+
sync
133+
isync
134+
blr
135+
SYM_FUNC_END(setup_g2_le_hid2)
136+
118137
/* 7400 <= rev 2.7 and 7410 rev = 1.0 suffer from some
119138
* erratas we work around here.
120139
* Moto MPC710CE.pdf describes them, those are errata
@@ -495,4 +514,3 @@ _GLOBAL(__restore_cpu_setup)
495514
mtcr r7
496515
blr
497516
_ASM_NOKPROBE_SYMBOL(__restore_cpu_setup)
498-

arch/powerpc/kernel/cpu_specs_e500mc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
#ifdef CONFIG_PPC64
1010
#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
11-
PPC_FEATURE_HAS_FPU | PPC_FEATURE_64)
11+
PPC_FEATURE_HAS_FPU | PPC_FEATURE_64 | \
12+
PPC_FEATURE_BOOKE)
1213
#else
1314
#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
1415
PPC_FEATURE_BOOKE)

arch/powerpc/kernel/interrupt_64.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ _ASM_NOKPROBE_SYMBOL(system_call_vectored_\name)
5252
mr r10,r1
5353
ld r1,PACAKSAVE(r13)
5454
std r10,0(r1)
55-
std r11,_NIP(r1)
55+
std r11,_LINK(r1)
56+
std r11,_NIP(r1) /* Saved LR is also the next instruction */
5657
std r12,_MSR(r1)
5758
std r0,GPR0(r1)
5859
std r10,GPR1(r1)
@@ -70,7 +71,6 @@ _ASM_NOKPROBE_SYMBOL(system_call_vectored_\name)
7071
std r9,GPR13(r1)
7172
SAVE_NVGPRS(r1)
7273
std r11,_XER(r1)
73-
std r11,_LINK(r1)
7474
std r11,_CTR(r1)
7575

7676
li r11,\trapnr

arch/powerpc/kernel/iommu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,8 +1289,10 @@ spapr_tce_platform_iommu_attach_dev(struct iommu_domain *platform_domain,
12891289
struct iommu_table_group *table_group;
12901290

12911291
/* At first attach the ownership is already set */
1292-
if (!domain)
1292+
if (!domain) {
1293+
iommu_group_put(grp);
12931294
return 0;
1295+
}
12941296

12951297
table_group = iommu_group_get_iommudata(grp);
12961298
/*

0 commit comments

Comments
 (0)