Skip to content

Commit f8bf101

Browse files
committed
Merge tag 'powerpc-6.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: - Fix softlockup/crash when using hcall tracing - Fix pte_access_permitted() for PAGE_NONE on 8xx - Fix inverted pte_young() test in __ptep_test_and_clear_young() on 64-bit BookE - Fix unhandled math emulation exception on 85xx - Fix kernel crash on syscall return on 476 Thanks to Athira Rajeev, Christophe Leroy, Eddie James, and Naveen N Rao. * tag 'powerpc-6.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/47x: Fix 47x syscall return crash powerpc/85xx: Fix math emulation exception powerpc/64e: Fix wrong test in __ptep_test_and_clear_young() powerpc/8xx: Fix pte_access_permitted() for PAGE_NONE powerpc/pseries: Remove unused r0 in the hcall tracing code powerpc/pseries: Fix STK_PARAM access in the hcall tracing code
2 parents ddf2085 + f0eee81 commit f8bf101

File tree

6 files changed

+17
-12
lines changed

6 files changed

+17
-12
lines changed

arch/powerpc/include/asm/nohash/32/pte-8xx.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ static inline pte_t pte_wrprotect(pte_t pte)
9494

9595
#define pte_wrprotect pte_wrprotect
9696

97+
static inline int pte_read(pte_t pte)
98+
{
99+
return (pte_val(pte) & _PAGE_RO) != _PAGE_NA;
100+
}
101+
102+
#define pte_read pte_read
103+
97104
static inline int pte_write(pte_t pte)
98105
{
99106
return !(pte_val(pte) & _PAGE_RO);

arch/powerpc/include/asm/nohash/64/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static inline int __ptep_test_and_clear_young(struct mm_struct *mm,
197197
{
198198
unsigned long old;
199199

200-
if (pte_young(*ptep))
200+
if (!pte_young(*ptep))
201201
return 0;
202202
old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0, 0);
203203
return (old & _PAGE_ACCESSED) != 0;

arch/powerpc/include/asm/nohash/pgtable.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ static inline int pte_write(pte_t pte)
2525
return pte_val(pte) & _PAGE_RW;
2626
}
2727
#endif
28+
#ifndef pte_read
2829
static inline int pte_read(pte_t pte) { return 1; }
30+
#endif
2931
static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
3032
static inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; }
3133
static inline int pte_none(pte_t pte) { return (pte_val(pte) & ~_PTE_NONE_MASK) == 0; }

arch/powerpc/kernel/entry_32.S

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ ret_from_syscall:
137137
lis r4,icache_44x_need_flush@ha
138138
lwz r5,icache_44x_need_flush@l(r4)
139139
cmplwi cr0,r5,0
140-
bne- 2f
140+
bne- .L44x_icache_flush
141141
#endif /* CONFIG_PPC_47x */
142+
.L44x_icache_flush_return:
142143
kuep_unlock
143144
lwz r4,_LINK(r1)
144145
lwz r5,_CCR(r1)
@@ -172,10 +173,11 @@ syscall_exit_finish:
172173
b 1b
173174

174175
#ifdef CONFIG_44x
175-
2: li r7,0
176+
.L44x_icache_flush:
177+
li r7,0
176178
iccci r0,r0
177179
stw r7,icache_44x_need_flush@l(r4)
178-
b 1b
180+
b .L44x_icache_flush_return
179181
#endif /* CONFIG_44x */
180182

181183
.globl ret_from_fork

arch/powerpc/kernel/head_85xx.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ interrupt_base:
395395
#ifdef CONFIG_PPC_FPU
396396
FP_UNAVAILABLE_EXCEPTION
397397
#else
398-
EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, unknown_exception)
398+
EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, emulation_assist_interrupt)
399399
#endif
400400

401401
/* System Call Interrupt */

arch/powerpc/platforms/pseries/hvCall.S

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ _GLOBAL_TOC(plpar_hcall)
184184
plpar_hcall_trace:
185185
HCALL_INST_PRECALL(R5)
186186

187-
std r4,STK_PARAM(R4)(r1)
188-
mr r0,r4
189-
190187
mr r4,r5
191188
mr r5,r6
192189
mr r6,r7
@@ -196,7 +193,7 @@ plpar_hcall_trace:
196193

197194
HVSC
198195

199-
ld r12,STK_PARAM(R4)(r1)
196+
ld r12,STACK_FRAME_MIN_SIZE+STK_PARAM(R4)(r1)
200197
std r4,0(r12)
201198
std r5,8(r12)
202199
std r6,16(r12)
@@ -296,9 +293,6 @@ _GLOBAL_TOC(plpar_hcall9)
296293
plpar_hcall9_trace:
297294
HCALL_INST_PRECALL(R5)
298295

299-
std r4,STK_PARAM(R4)(r1)
300-
mr r0,r4
301-
302296
mr r4,r5
303297
mr r5,r6
304298
mr r6,r7

0 commit comments

Comments
 (0)