linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH v1 35/46] powerpc/8xx: Remove now unused TLB miss functions
Date: Mon, 16 Mar 2020 12:36:21 +0000 (UTC)	[thread overview]
Message-ID: <9a5eb145e20b1027948e6dd1d54326cb1d27d797.1584360344.git.christophe.leroy@c-s.fr> (raw)
In-Reply-To: <cover.1584360343.git.christophe.leroy@c-s.fr>

The code to setup linear and IMMR mapping via huge TLB entries is
not called anymore. Remove it.

Also remove the handling of removed code exits in the perf driver.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/include/asm/nohash/32/mmu-8xx.h |  8 +-
 arch/powerpc/kernel/head_8xx.S               | 83 --------------------
 arch/powerpc/perf/8xx-pmu.c                  | 10 ---
 3 files changed, 1 insertion(+), 100 deletions(-)

diff --git a/arch/powerpc/include/asm/nohash/32/mmu-8xx.h b/arch/powerpc/include/asm/nohash/32/mmu-8xx.h
index 794bce83c5b0..6ab85e20559f 100644
--- a/arch/powerpc/include/asm/nohash/32/mmu-8xx.h
+++ b/arch/powerpc/include/asm/nohash/32/mmu-8xx.h
@@ -241,13 +241,7 @@ static inline unsigned int mmu_psize_to_shift(unsigned int mmu_psize)
 }
 
 /* patch sites */
-extern s32 patch__itlbmiss_linmem_top, patch__itlbmiss_linmem_top8;
-extern s32 patch__dtlbmiss_linmem_top, patch__dtlbmiss_immr_jmp;
-extern s32 patch__fixupdar_linmem_top;
-extern s32 patch__dtlbmiss_romem_top, patch__dtlbmiss_romem_top8;
-
-extern s32 patch__itlbmiss_exit_1, patch__itlbmiss_exit_2;
-extern s32 patch__dtlbmiss_exit_1, patch__dtlbmiss_exit_2, patch__dtlbmiss_exit_3;
+extern s32 patch__itlbmiss_exit_1, patch__dtlbmiss_exit_1;
 extern s32 patch__itlbmiss_perf, patch__dtlbmiss_perf;
 
 #endif /* !__ASSEMBLY__ */
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index df2874a0fd13..7fd7f7af1ac6 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -277,33 +277,6 @@ InstructionTLBMiss:
 	rfi
 #endif
 
-#ifndef CONFIG_PIN_TLB_TEXT
-ITLBMissLinear:
-	mtcr	r11
-#if defined(CONFIG_STRICT_KERNEL_RWX) && CONFIG_ETEXT_SHIFT < 23
-	patch_site	0f, patch__itlbmiss_linmem_top8
-
-	mfspr	r10, SPRN_SRR0
-0:	subis	r11, r10, (PAGE_OFFSET - 0x80000000)@ha
-	rlwinm	r11, r11, 4, MI_PS8MEG ^ MI_PS512K
-	ori	r11, r11, MI_PS512K | MI_SVALID
-	rlwinm	r10, r10, 0, 0x0ff80000	/* 8xx supports max 256Mb RAM */
-#else
-	/* Set 8M byte page and mark it valid */
-	li	r11, MI_PS8MEG | MI_SVALID
-	rlwinm	r10, r10, 20, 0x0f800000	/* 8xx supports max 256Mb RAM */
-#endif
-	mtspr	SPRN_MI_TWC, r11
-	ori	r10, r10, 0xf0 | MI_SPS16K | _PAGE_SH | _PAGE_DIRTY | \
-			  _PAGE_PRESENT
-	mtspr	SPRN_MI_RPN, r10	/* Update TLB entry */
-
-0:	mfspr	r10, SPRN_SPRG_SCRATCH0
-	mfspr	r11, SPRN_SPRG_SCRATCH1
-	rfi
-	patch_site	0b, patch__itlbmiss_exit_2
-#endif
-
 	. = 0x1200
 DataStoreTLBMiss:
 	mtspr	SPRN_DAR, r10
@@ -370,62 +343,6 @@ DataStoreTLBMiss:
 	rfi
 	patch_site	0b, patch__dtlbmiss_exit_1
 
-DTLBMissIMMR:
-	mtcr	r11
-	/* Set 512k byte guarded page and mark it valid */
-	li	r10, MD_PS512K | MD_GUARDED | MD_SVALID
-	mtspr	SPRN_MD_TWC, r10
-	mfspr	r10, SPRN_IMMR			/* Get current IMMR */
-	rlwinm	r10, r10, 0, 0xfff80000		/* Get 512 kbytes boundary */
-	ori	r10, r10, 0xf0 | MD_SPS16K | _PAGE_SH | _PAGE_DIRTY | \
-			  _PAGE_PRESENT | _PAGE_NO_CACHE
-	mtspr	SPRN_MD_RPN, r10	/* Update TLB entry */
-
-	li	r11, RPN_PATTERN
-
-0:	mfspr	r10, SPRN_DAR
-	mtspr	SPRN_DAR, r11	/* Tag DAR */
-	mfspr	r11, SPRN_M_TW
-	rfi
-	patch_site	0b, patch__dtlbmiss_exit_2
-
-DTLBMissLinear:
-	mtcr	r11
-	rlwinm	r10, r10, 20, 0x0f800000	/* 8xx supports max 256Mb RAM */
-#if defined(CONFIG_STRICT_KERNEL_RWX) && CONFIG_DATA_SHIFT < 23
-	patch_site	0f, patch__dtlbmiss_romem_top8
-
-0:	subis	r11, r10, (PAGE_OFFSET - 0x80000000)@ha
-	rlwinm	r11, r11, 0, 0xff800000
-	neg	r10, r11
-	or	r11, r11, r10
-	rlwinm	r11, r11, 4, MI_PS8MEG ^ MI_PS512K
-	ori	r11, r11, MI_PS512K | MI_SVALID
-	mfspr	r10, SPRN_MD_EPN
-	rlwinm	r10, r10, 0, 0x0ff80000	/* 8xx supports max 256Mb RAM */
-#else
-	/* Set 8M byte page and mark it valid */
-	li	r11, MD_PS8MEG | MD_SVALID
-#endif
-	mtspr	SPRN_MD_TWC, r11
-#ifdef CONFIG_STRICT_KERNEL_RWX
-	patch_site	0f, patch__dtlbmiss_romem_top
-
-0:	subis	r11, r10, 0
-	rlwimi	r10, r11, 11, _PAGE_RO
-#endif
-	ori	r10, r10, 0xf0 | MD_SPS16K | _PAGE_SH | _PAGE_DIRTY | \
-			  _PAGE_PRESENT
-	mtspr	SPRN_MD_RPN, r10	/* Update TLB entry */
-
-	li	r11, RPN_PATTERN
-
-0:	mfspr	r10, SPRN_DAR
-	mtspr	SPRN_DAR, r11	/* Tag DAR */
-	mfspr	r11, SPRN_M_TW
-	rfi
-	patch_site	0b, patch__dtlbmiss_exit_3
-
 /* This is an instruction TLB error on the MPC8xx.  This could be due
  * to many reasons, such as executing guarded memory or illegal instruction
  * addresses.  There is nothing to do but handle a big time error fault.
diff --git a/arch/powerpc/perf/8xx-pmu.c b/arch/powerpc/perf/8xx-pmu.c
index 1ad03c55c88c..0c56b42a4f91 100644
--- a/arch/powerpc/perf/8xx-pmu.c
+++ b/arch/powerpc/perf/8xx-pmu.c
@@ -99,9 +99,6 @@ static int mpc8xx_pmu_add(struct perf_event *event, int flags)
 			unsigned long target = patch_site_addr(&patch__itlbmiss_perf);
 
 			patch_branch_site(&patch__itlbmiss_exit_1, target, 0);
-#ifndef CONFIG_PIN_TLB_TEXT
-			patch_branch_site(&patch__itlbmiss_exit_2, target, 0);
-#endif
 		}
 		val = itlb_miss_counter;
 		break;
@@ -110,8 +107,6 @@ static int mpc8xx_pmu_add(struct perf_event *event, int flags)
 			unsigned long target = patch_site_addr(&patch__dtlbmiss_perf);
 
 			patch_branch_site(&patch__dtlbmiss_exit_1, target, 0);
-			patch_branch_site(&patch__dtlbmiss_exit_2, target, 0);
-			patch_branch_site(&patch__dtlbmiss_exit_3, target, 0);
 		}
 		val = dtlb_miss_counter;
 		break;
@@ -174,9 +169,6 @@ static void mpc8xx_pmu_del(struct perf_event *event, int flags)
 					    __PPC_SPR(SPRN_SPRG_SCRATCH0);
 
 			patch_instruction_site(&patch__itlbmiss_exit_1, insn);
-#ifndef CONFIG_PIN_TLB_TEXT
-			patch_instruction_site(&patch__itlbmiss_exit_2, insn);
-#endif
 		}
 		break;
 	case PERF_8xx_ID_DTLB_LOAD_MISS:
@@ -186,8 +178,6 @@ static void mpc8xx_pmu_del(struct perf_event *event, int flags)
 					    __PPC_SPR(SPRN_DAR);
 
 			patch_instruction_site(&patch__dtlbmiss_exit_1, insn);
-			patch_instruction_site(&patch__dtlbmiss_exit_2, insn);
-			patch_instruction_site(&patch__dtlbmiss_exit_3, insn);
 		}
 		break;
 	}
-- 
2.25.0


  parent reply	other threads:[~2020-03-16 12:37 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 12:35 [PATCH v1 00/46] Use hugepages to map kernel mem on 8xx Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 01/46] powerpc/kasan: Fix shadow memory protection with CONFIG_KASAN_VMALLOC Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 02/46] powerpc/kasan: Fix error detection on memory allocation Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 03/46] powerpc/kasan: Fix issues by lowering KASAN_SHADOW_END Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 04/46] powerpc/kasan: Fix shadow pages allocation failure Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 05/46] powerpc/kasan: Remove unnecessary page table locking Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 06/46] powerpc/kasan: Refactor update of early shadow mappings Christophe Leroy
2020-04-02 10:19   ` Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 07/46] powerpc/kasan: Declare kasan_init_region() weak Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 08/46] powerpc/ptdump: Limit size of flags text to 1/2 chars on PPC32 Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 09/46] powerpc/ptdump: Reorder flags Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 10/46] powerpc/ptdump: Add _PAGE_COHERENT flag Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 11/46] powerpc/ptdump: Display size of BATs Christophe Leroy
2020-03-17  3:25   ` kbuild test robot
2020-03-16 12:35 ` [PATCH v1 12/46] powerpc/ptdump: Standardise display of BAT flags Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 13/46] powerpc/ptdump: Properly handle non standard page size Christophe Leroy
2020-03-16 12:35 ` [PATCH v1 14/46] powerpc/ptdump: Handle hugepd at PGD level Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 15/46] powerpc/32s: Don't warn when mapping RO data ROX Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 16/46] powerpc/mm: Allocate static page tables for fixmap Christophe Leroy
2020-03-17 14:38   ` Christophe Leroy
2020-03-17 16:00     ` Luc Van Oostenryck
2020-03-16 12:36 ` [PATCH v1 17/46] powerpc/mm: Fix conditions to perform MMU specific management by blocks on PPC32 Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 18/46] powerpc/mm: PTE_ATOMIC_UPDATES is only for 40x Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 19/46] powerpc/mm: Refactor pte_update() on nohash/32 Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 20/46] powerpc/mm: Refactor pte_update() on book3s/32 Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 21/46] powerpc/mm: Standardise __ptep_test_and_clear_young() params between PPC32 and PPC64 Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 22/46] powerpc/mm: Standardise pte_update() prototype " Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 23/46] powerpc/mm: Create a dedicated pte_update() for 8xx Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 24/46] powerpc/mm: Reduce hugepd size for 8M hugepages on 8xx Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 25/46] powerpc/8xx: Drop CONFIG_8xx_COPYBACK option Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 26/46] powerpc/8xx: Prepare handlers for _PAGE_HUGE for 512k pages Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 27/46] powerpc/8xx: Manage 512k huge pages as standard pages Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 28/46] powerpc/8xx: Only 8M pages are hugepte pages now Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 29/46] powerpc/8xx: MM_SLICE is not needed anymore Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 30/46] powerpc/8xx: Move PPC_PIN_TLB options into 8xx Kconfig Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 31/46] powerpc/8xx: Add function to update pinned TLBs Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 32/46] powerpc/8xx: Don't set IMMR map anymore at boot Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 33/46] powerpc/8xx: Always pin TLBs at startup Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 34/46] powerpc/8xx: Drop special handling of Linear and IMMR mappings in I/D TLB handlers Christophe Leroy
2020-03-16 12:36 ` Christophe Leroy [this message]
2020-03-16 12:36 ` [PATCH v1 36/46] powerpc/8xx: Move DTLB perf handling closer Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 37/46] powerpc/mm: Don't be too strict with _etext alignment on PPC32 Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 38/46] powerpc/8xx: Refactor kernel address boundary comparison Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 39/46] powerpc/8xx: Add a function to early map kernel via huge pages Christophe Leroy
2020-03-17  1:39   ` kbuild test robot
2020-03-17 14:43     ` Christophe Leroy
2020-04-02 10:13       ` Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 40/46] powerpc/8xx: Map IMMR with a huge page Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 41/46] powerpc/8xx: Map linear memory with huge pages Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 42/46] powerpc/8xx: Allow STRICT_KERNEL_RwX with pinned TLB Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 43/46] powerpc/8xx: Allow large TLBs with DEBUG_PAGEALLOC Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 44/46] powerpc/8xx: Implement dedicated kasan_init_region() Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 45/46] powerpc/32s: Allow mapping with BATs with DEBUG_PAGEALLOC Christophe Leroy
2020-03-16 12:36 ` [PATCH v1 46/46] powerpc/32s: Implement dedicated kasan_init_region() Christophe Leroy
2020-03-17 14:32   ` Christophe Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a5eb145e20b1027948e6dd1d54326cb1d27d797.1584360344.git.christophe.leroy@c-s.fr \
    --to=christophe.leroy@c-s.fr \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).