Commit f8bf101b authored by Linus Torvalds's avatar Linus Torvalds

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
parents ddf20855 f0eee815
...@@ -94,6 +94,13 @@ static inline pte_t pte_wrprotect(pte_t pte) ...@@ -94,6 +94,13 @@ static inline pte_t pte_wrprotect(pte_t pte)
#define pte_wrprotect pte_wrprotect #define pte_wrprotect pte_wrprotect
static inline int pte_read(pte_t pte)
{
return (pte_val(pte) & _PAGE_RO) != _PAGE_NA;
}
#define pte_read pte_read
static inline int pte_write(pte_t pte) static inline int pte_write(pte_t pte)
{ {
return !(pte_val(pte) & _PAGE_RO); return !(pte_val(pte) & _PAGE_RO);
......
...@@ -197,7 +197,7 @@ static inline int __ptep_test_and_clear_young(struct mm_struct *mm, ...@@ -197,7 +197,7 @@ static inline int __ptep_test_and_clear_young(struct mm_struct *mm,
{ {
unsigned long old; unsigned long old;
if (pte_young(*ptep)) if (!pte_young(*ptep))
return 0; return 0;
old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0, 0); old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0, 0);
return (old & _PAGE_ACCESSED) != 0; return (old & _PAGE_ACCESSED) != 0;
......
...@@ -25,7 +25,9 @@ static inline int pte_write(pte_t pte) ...@@ -25,7 +25,9 @@ static inline int pte_write(pte_t pte)
return pte_val(pte) & _PAGE_RW; return pte_val(pte) & _PAGE_RW;
} }
#endif #endif
#ifndef pte_read
static inline int pte_read(pte_t pte) { return 1; } static inline int pte_read(pte_t pte) { return 1; }
#endif
static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
static inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; } static inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; }
static inline int pte_none(pte_t pte) { return (pte_val(pte) & ~_PTE_NONE_MASK) == 0; } static inline int pte_none(pte_t pte) { return (pte_val(pte) & ~_PTE_NONE_MASK) == 0; }
......
...@@ -137,8 +137,9 @@ ret_from_syscall: ...@@ -137,8 +137,9 @@ ret_from_syscall:
lis r4,icache_44x_need_flush@ha lis r4,icache_44x_need_flush@ha
lwz r5,icache_44x_need_flush@l(r4) lwz r5,icache_44x_need_flush@l(r4)
cmplwi cr0,r5,0 cmplwi cr0,r5,0
bne- 2f bne- .L44x_icache_flush
#endif /* CONFIG_PPC_47x */ #endif /* CONFIG_PPC_47x */
.L44x_icache_flush_return:
kuep_unlock kuep_unlock
lwz r4,_LINK(r1) lwz r4,_LINK(r1)
lwz r5,_CCR(r1) lwz r5,_CCR(r1)
...@@ -172,10 +173,11 @@ syscall_exit_finish: ...@@ -172,10 +173,11 @@ syscall_exit_finish:
b 1b b 1b
#ifdef CONFIG_44x #ifdef CONFIG_44x
2: li r7,0 .L44x_icache_flush:
li r7,0
iccci r0,r0 iccci r0,r0
stw r7,icache_44x_need_flush@l(r4) stw r7,icache_44x_need_flush@l(r4)
b 1b b .L44x_icache_flush_return
#endif /* CONFIG_44x */ #endif /* CONFIG_44x */
.globl ret_from_fork .globl ret_from_fork
......
...@@ -395,7 +395,7 @@ interrupt_base: ...@@ -395,7 +395,7 @@ interrupt_base:
#ifdef CONFIG_PPC_FPU #ifdef CONFIG_PPC_FPU
FP_UNAVAILABLE_EXCEPTION FP_UNAVAILABLE_EXCEPTION
#else #else
EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, unknown_exception) EXCEPTION(0x0800, FP_UNAVAIL, FloatingPointUnavailable, emulation_assist_interrupt)
#endif #endif
/* System Call Interrupt */ /* System Call Interrupt */
......
...@@ -184,9 +184,6 @@ _GLOBAL_TOC(plpar_hcall) ...@@ -184,9 +184,6 @@ _GLOBAL_TOC(plpar_hcall)
plpar_hcall_trace: plpar_hcall_trace:
HCALL_INST_PRECALL(R5) HCALL_INST_PRECALL(R5)
std r4,STK_PARAM(R4)(r1)
mr r0,r4
mr r4,r5 mr r4,r5
mr r5,r6 mr r5,r6
mr r6,r7 mr r6,r7
...@@ -196,7 +193,7 @@ plpar_hcall_trace: ...@@ -196,7 +193,7 @@ plpar_hcall_trace:
HVSC HVSC
ld r12,STK_PARAM(R4)(r1) ld r12,STACK_FRAME_MIN_SIZE+STK_PARAM(R4)(r1)
std r4,0(r12) std r4,0(r12)
std r5,8(r12) std r5,8(r12)
std r6,16(r12) std r6,16(r12)
...@@ -296,9 +293,6 @@ _GLOBAL_TOC(plpar_hcall9) ...@@ -296,9 +293,6 @@ _GLOBAL_TOC(plpar_hcall9)
plpar_hcall9_trace: plpar_hcall9_trace:
HCALL_INST_PRECALL(R5) HCALL_INST_PRECALL(R5)
std r4,STK_PARAM(R4)(r1)
mr r0,r4
mr r4,r5 mr r4,r5
mr r5,r6 mr r5,r6
mr r6,r7 mr r6,r7
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment