linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/8xx: hide itlbie and dtlbie symbols
@ 2018-11-28 11:27 Christophe Leroy
  2018-12-12 13:05 ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe Leroy @ 2018-11-28 11:27 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: linuxppc-dev, linux-kernel

When disassembling InstructionTLBError we get the following messy code:

c000138c:       7d 84 63 78     mr      r4,r12
c0001390:       75 25 58 00     andis.  r5,r9,22528
c0001394:       75 2a 40 00     andis.  r10,r9,16384
c0001398:       41 a2 00 08     beq     c00013a0 <itlbie>
c000139c:       7c 00 22 64     tlbie   r4,r0

c00013a0 <itlbie>:
c00013a0:       39 40 04 01     li      r10,1025
c00013a4:       91 4b 00 b0     stw     r10,176(r11)
c00013a8:       39 40 10 32     li      r10,4146
c00013ac:       48 00 cc 59     bl      c000e004 <transfer_to_handler>

For a cleaner code dump, this patch replaces itlbie and dtlbie
symbols by numeric symbols.

c000138c:       7d 84 63 78     mr      r4,r12
c0001390:       75 25 58 00     andis.  r5,r9,22528
c0001394:       75 2a 40 00     andis.  r10,r9,16384
c0001398:       41 a2 00 08     beq     c00013a0 <InstructionTLBError+0xa0>
c000139c:       7c 00 22 64     tlbie   r4,r0
c00013a0:       39 40 04 01     li      r10,1025
c00013a4:       91 4b 00 b0     stw     r10,176(r11)
c00013a8:       39 40 10 32     li      r10,4146
c00013ac:       48 00 cc 59     bl      c000e004 <transfer_to_handler>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/kernel/head_8xx.S | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 3b67b9533c82..8c848acfe249 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -552,11 +552,10 @@ InstructionTLBError:
 	mr	r4,r12
 	andis.	r5,r9,DSISR_SRR1_MATCH_32S@h /* Filter relevant SRR1 bits */
 	andis.	r10,r9,SRR1_ISI_NOPT@h
-	beq+	1f
+	beq+	1301f
 	tlbie	r4
-itlbie:
 	/* 0x400 is InstructionAccess exception, needed by bad_page_fault() */
-1:	EXC_XFER_LITE(0x400, handle_page_fault)
+1301:	EXC_XFER_LITE(0x400, handle_page_fault)
 
 /* This is the data TLB error on the MPC8xx.  This could be due to
  * many reasons, including a dirty update to a pte.  We bail out to
@@ -578,10 +577,9 @@ DARFixed:/* Return from dcbx instruction bug workaround */
 	stw	r5,_DSISR(r11)
 	mfspr	r4,SPRN_DAR
 	andis.	r10,r5,DSISR_NOHPTE@h
-	beq+	1f
+	beq+	1401f
 	tlbie	r4
-dtlbie:
-1:	li	r10,RPN_PATTERN
+1401:	li	r10,RPN_PATTERN
 	mtspr	SPRN_DAR,r10	/* Tag DAR, to be used in DTLB Error */
 	/* 0x300 is DataAccess exception, needed by bad_page_fault() */
 	EXC_XFER_LITE(0x300, handle_page_fault)
@@ -604,8 +602,8 @@ DataBreakpoint:
 	mtspr	SPRN_SPRG_SCRATCH1, r11
 	mfcr	r10
 	mfspr	r11, SPRN_SRR0
-	cmplwi	cr0, r11, (dtlbie - PAGE_OFFSET)@l
-	cmplwi	cr7, r11, (itlbie - PAGE_OFFSET)@l
+	cmplwi	cr0, r11, (1401b - PAGE_OFFSET)@l
+	cmplwi	cr7, r11, (1301b - PAGE_OFFSET)@l
 	beq-	cr0, 11f
 	beq-	cr7, 11f
 	EXCEPTION_PROLOG_1
-- 
2.13.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/8xx: hide itlbie and dtlbie symbols
  2018-11-28 11:27 [PATCH] powerpc/8xx: hide itlbie and dtlbie symbols Christophe Leroy
@ 2018-12-12 13:05 ` Michael Ellerman
  2018-12-13  8:09   ` Christophe Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2018-12-12 13:05 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linuxppc-dev, linux-kernel

Christophe Leroy <christophe.leroy@c-s.fr> writes:

> When disassembling InstructionTLBError we get the following messy code:
>
> c000138c:       7d 84 63 78     mr      r4,r12
> c0001390:       75 25 58 00     andis.  r5,r9,22528
> c0001394:       75 2a 40 00     andis.  r10,r9,16384
> c0001398:       41 a2 00 08     beq     c00013a0 <itlbie>
> c000139c:       7c 00 22 64     tlbie   r4,r0
>
> c00013a0 <itlbie>:
> c00013a0:       39 40 04 01     li      r10,1025
> c00013a4:       91 4b 00 b0     stw     r10,176(r11)
> c00013a8:       39 40 10 32     li      r10,4146
> c00013ac:       48 00 cc 59     bl      c000e004 <transfer_to_handler>
>
> For a cleaner code dump, this patch replaces itlbie and dtlbie
> symbols by numeric symbols.
>
> c000138c:       7d 84 63 78     mr      r4,r12
> c0001390:       75 25 58 00     andis.  r5,r9,22528
> c0001394:       75 2a 40 00     andis.  r10,r9,16384
> c0001398:       41 a2 00 08     beq     c00013a0 <InstructionTLBError+0xa0>
> c000139c:       7c 00 22 64     tlbie   r4,r0
> c00013a0:       39 40 04 01     li      r10,1025
> c00013a4:       91 4b 00 b0     stw     r10,176(r11)
> c00013a8:       39 40 10 32     li      r10,4146
> c00013ac:       48 00 cc 59     bl      c000e004 <transfer_to_handler>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
>  arch/powerpc/kernel/head_8xx.S | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
> index 3b67b9533c82..8c848acfe249 100644
> --- a/arch/powerpc/kernel/head_8xx.S
> +++ b/arch/powerpc/kernel/head_8xx.S
> @@ -552,11 +552,10 @@ InstructionTLBError:
>  	mr	r4,r12
>  	andis.	r5,r9,DSISR_SRR1_MATCH_32S@h /* Filter relevant SRR1 bits */
>  	andis.	r10,r9,SRR1_ISI_NOPT@h
> -	beq+	1f
> +	beq+	1301f
>  	tlbie	r4
> -itlbie:
>  	/* 0x400 is InstructionAccess exception, needed by bad_page_fault() */
> -1:	EXC_XFER_LITE(0x400, handle_page_fault)
> +1301:	EXC_XFER_LITE(0x400, handle_page_fault)

You could use a local symbol, something like:

	beq+	1f
 	tlbie	r4
.Litlbie:
 	/* 0x400 is InstructionAccess exception, needed by bad_page_fault() */
1:	EXC_XFER_LITE(0x400, handle_page_fault)


cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/8xx: hide itlbie and dtlbie symbols
  2018-12-12 13:05 ` Michael Ellerman
@ 2018-12-13  8:09   ` Christophe Leroy
  0 siblings, 0 replies; 3+ messages in thread
From: Christophe Leroy @ 2018-12-13  8:09 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras
  Cc: linuxppc-dev, linux-kernel



Le 12/12/2018 à 14:05, Michael Ellerman a écrit :
> Christophe Leroy <christophe.leroy@c-s.fr> writes:
> 
>> When disassembling InstructionTLBError we get the following messy code:
>>
>> c000138c:       7d 84 63 78     mr      r4,r12
>> c0001390:       75 25 58 00     andis.  r5,r9,22528
>> c0001394:       75 2a 40 00     andis.  r10,r9,16384
>> c0001398:       41 a2 00 08     beq     c00013a0 <itlbie>
>> c000139c:       7c 00 22 64     tlbie   r4,r0
>>
>> c00013a0 <itlbie>:
>> c00013a0:       39 40 04 01     li      r10,1025
>> c00013a4:       91 4b 00 b0     stw     r10,176(r11)
>> c00013a8:       39 40 10 32     li      r10,4146
>> c00013ac:       48 00 cc 59     bl      c000e004 <transfer_to_handler>
>>
>> For a cleaner code dump, this patch replaces itlbie and dtlbie
>> symbols by numeric symbols.
>>
>> c000138c:       7d 84 63 78     mr      r4,r12
>> c0001390:       75 25 58 00     andis.  r5,r9,22528
>> c0001394:       75 2a 40 00     andis.  r10,r9,16384
>> c0001398:       41 a2 00 08     beq     c00013a0 <InstructionTLBError+0xa0>
>> c000139c:       7c 00 22 64     tlbie   r4,r0
>> c00013a0:       39 40 04 01     li      r10,1025
>> c00013a4:       91 4b 00 b0     stw     r10,176(r11)
>> c00013a8:       39 40 10 32     li      r10,4146
>> c00013ac:       48 00 cc 59     bl      c000e004 <transfer_to_handler>
>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>> ---
>>   arch/powerpc/kernel/head_8xx.S | 14 ++++++--------
>>   1 file changed, 6 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
>> index 3b67b9533c82..8c848acfe249 100644
>> --- a/arch/powerpc/kernel/head_8xx.S
>> +++ b/arch/powerpc/kernel/head_8xx.S
>> @@ -552,11 +552,10 @@ InstructionTLBError:
>>   	mr	r4,r12
>>   	andis.	r5,r9,DSISR_SRR1_MATCH_32S@h /* Filter relevant SRR1 bits */
>>   	andis.	r10,r9,SRR1_ISI_NOPT@h
>> -	beq+	1f
>> +	beq+	1301f
>>   	tlbie	r4
>> -itlbie:
>>   	/* 0x400 is InstructionAccess exception, needed by bad_page_fault() */
>> -1:	EXC_XFER_LITE(0x400, handle_page_fault)
>> +1301:	EXC_XFER_LITE(0x400, handle_page_fault)
> 
> You could use a local symbol, something like:

Thanks for the tip, I sent v2

Christophe

> 
> 	beq+	1f
>   	tlbie	r4
> .Litlbie:
>   	/* 0x400 is InstructionAccess exception, needed by bad_page_fault() */
> 1:	EXC_XFER_LITE(0x400, handle_page_fault)
> 
> 
> cheers
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-13  8:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-28 11:27 [PATCH] powerpc/8xx: hide itlbie and dtlbie symbols Christophe Leroy
2018-12-12 13:05 ` Michael Ellerman
2018-12-13  8:09   ` Christophe Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).