mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-03 18:20:25 +02:00 
			
		
		
		
	powerpc/8xx: Invalidate non present TLB as early as possible
8xx sometimes need to load a invalid/non-present TLBs in
it DTLB asm handler.
These must be invalidated separaly as linux mm doesn't.
Commit 5efab4a02c was invalidating them in
arch/powerpc/mm/fault.c.
This patch does the invalidation earlier in order to free the TLB as soon as
possible. This also has the advantage of removing some 8xx specific code from
fault.c
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <scottwood@freescale.com>
			
			
This commit is contained in:
		
							parent
							
								
									83c17ba35e
								
							
						
					
					
						commit
						c51a6821bd
					
				
					 2 changed files with 10 additions and 12 deletions
				
			
		| 
						 | 
					@ -475,8 +475,11 @@ InstructionTLBError1:
 | 
				
			||||||
	EXCEPTION_PROLOG_2
 | 
						EXCEPTION_PROLOG_2
 | 
				
			||||||
	mr	r4,r12
 | 
						mr	r4,r12
 | 
				
			||||||
	mr	r5,r9
 | 
						mr	r5,r9
 | 
				
			||||||
 | 
						andis.	r10,r5,0x4000
 | 
				
			||||||
 | 
						beq+	1f
 | 
				
			||||||
 | 
						tlbie	r4
 | 
				
			||||||
	/* 0x400 is InstructionAccess exception, needed by bad_page_fault() */
 | 
						/* 0x400 is InstructionAccess exception, needed by bad_page_fault() */
 | 
				
			||||||
	EXC_XFER_LITE(0x400, handle_page_fault)
 | 
					1:	EXC_XFER_LITE(0x400, handle_page_fault)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* This is the data TLB error on the MPC8xx.  This could be due to
 | 
					/* 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
 | 
					 * many reasons, including a dirty update to a pte.  We bail out to
 | 
				
			||||||
| 
						 | 
					@ -492,11 +495,13 @@ DataTLBError:
 | 
				
			||||||
DARFixed:/* Return from dcbx instruction bug workaround */
 | 
					DARFixed:/* Return from dcbx instruction bug workaround */
 | 
				
			||||||
	EXCEPTION_PROLOG_1
 | 
						EXCEPTION_PROLOG_1
 | 
				
			||||||
	EXCEPTION_PROLOG_2
 | 
						EXCEPTION_PROLOG_2
 | 
				
			||||||
	mfspr	r10,SPRN_DSISR
 | 
						mfspr	r5,SPRN_DSISR
 | 
				
			||||||
	stw	r10,_DSISR(r11)
 | 
						stw	r5,_DSISR(r11)
 | 
				
			||||||
	mr	r5,r10
 | 
					 | 
				
			||||||
	mfspr	r4,SPRN_DAR
 | 
						mfspr	r4,SPRN_DAR
 | 
				
			||||||
	li	r10,RPN_PATTERN
 | 
						andis.	r10,r5,0x4000
 | 
				
			||||||
 | 
						beq+	1f
 | 
				
			||||||
 | 
						tlbie	r4
 | 
				
			||||||
 | 
					1:	li	r10,RPN_PATTERN
 | 
				
			||||||
	mtspr	SPRN_DAR,r10	/* Tag DAR, to be used in DTLB Error */
 | 
						mtspr	SPRN_DAR,r10	/* Tag DAR, to be used in DTLB Error */
 | 
				
			||||||
	/* 0x300 is DataAccess exception, needed by bad_page_fault() */
 | 
						/* 0x300 is DataAccess exception, needed by bad_page_fault() */
 | 
				
			||||||
	EXC_XFER_LITE(0x300, handle_page_fault)
 | 
						EXC_XFER_LITE(0x300, handle_page_fault)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,7 +43,6 @@
 | 
				
			||||||
#include <asm/tlbflush.h>
 | 
					#include <asm/tlbflush.h>
 | 
				
			||||||
#include <asm/siginfo.h>
 | 
					#include <asm/siginfo.h>
 | 
				
			||||||
#include <asm/debug.h>
 | 
					#include <asm/debug.h>
 | 
				
			||||||
#include <mm/mmu_decl.h>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "icswx.h"
 | 
					#include "icswx.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -380,12 +379,6 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
 | 
				
			||||||
		goto bad_area;
 | 
							goto bad_area;
 | 
				
			||||||
#endif /* CONFIG_6xx */
 | 
					#endif /* CONFIG_6xx */
 | 
				
			||||||
#if defined(CONFIG_8xx)
 | 
					#if defined(CONFIG_8xx)
 | 
				
			||||||
	/* 8xx sometimes need to load a invalid/non-present TLBs.
 | 
					 | 
				
			||||||
	 * These must be invalidated separately as linux mm don't.
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	if (error_code & 0x40000000) /* no translation? */
 | 
					 | 
				
			||||||
		_tlbil_va(address, 0, 0, 0);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /* The MPC8xx seems to always set 0x80000000, which is
 | 
					        /* The MPC8xx seems to always set 0x80000000, which is
 | 
				
			||||||
         * "undefined".  Of those that can be set, this is the only
 | 
					         * "undefined".  Of those that can be set, this is the only
 | 
				
			||||||
         * one which seems bad.
 | 
					         * one which seems bad.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue