Skip to content

Commit 405cb40

Browse files
chleroympe
authored andcommitted
powerpc: split asm/tlbflush.h
Split asm/tlbflush.h into: asm/nohash/tlbflush.h asm/book3s/32/tlbflush.h asm/book3s/64/tlbflush.h (already existing) Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 45ef599 commit 405cb40

File tree

4 files changed

+94
-81
lines changed

4 files changed

+94
-81
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _ASM_POWERPC_BOOK3S_32_TLBFLUSH_H
3+
#define _ASM_POWERPC_BOOK3S_32_TLBFLUSH_H
4+
5+
#define MMU_NO_CONTEXT (0)
6+
/*
7+
* TLB flushing for "classic" hash-MMU 32-bit CPUs, 6xx, 7xx, 7xxx
8+
*/
9+
extern void flush_tlb_mm(struct mm_struct *mm);
10+
extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
11+
extern void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr);
12+
extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
13+
unsigned long end);
14+
extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
15+
static inline void local_flush_tlb_page(struct vm_area_struct *vma,
16+
unsigned long vmaddr)
17+
{
18+
flush_tlb_page(vma, vmaddr);
19+
}
20+
static inline void local_flush_tlb_mm(struct mm_struct *mm)
21+
{
22+
flush_tlb_mm(mm);
23+
}
24+
25+
#endif /* _ASM_POWERPC_TLBFLUSH_H */
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _ASM_POWERPC_BOOK3S_TLBFLUSH_H
3+
#define _ASM_POWERPC_BOOK3S_TLBFLUSH_H
4+
5+
#ifdef CONFIG_PPC64
6+
#include <asm/book3s/64/tlbflush.h>
7+
#else
8+
#include <asm/book3s/32/tlbflush.h>
9+
#endif
10+
11+
#endif /* _ASM_POWERPC_BOOK3S_TLBFLUSH_H */
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _ASM_POWERPC_NOHASH_TLBFLUSH_H
3+
#define _ASM_POWERPC_NOHASH_TLBFLUSH_H
4+
5+
/*
6+
* TLB flushing:
7+
*
8+
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
9+
* - flush_tlb_page(vma, vmaddr) flushes one page
10+
* - local_flush_tlb_mm(mm, full) flushes the specified mm context on
11+
* the local processor
12+
* - local_flush_tlb_page(vma, vmaddr) flushes one page on the local processor
13+
* - flush_tlb_page_nohash(vma, vmaddr) flushes one page if SW loaded TLB
14+
* - flush_tlb_range(vma, start, end) flushes a range of pages
15+
* - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
16+
*
17+
*/
18+
19+
/*
20+
* TLB flushing for software loaded TLB chips
21+
*
22+
* TODO: (CONFIG_FSL_BOOKE) determine if flush_tlb_range &
23+
* flush_tlb_kernel_range are best implemented as tlbia vs
24+
* specific tlbie's
25+
*/
26+
27+
struct vm_area_struct;
28+
struct mm_struct;
29+
30+
#define MMU_NO_CONTEXT ((unsigned int)-1)
31+
32+
extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
33+
unsigned long end);
34+
extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
35+
36+
extern void local_flush_tlb_mm(struct mm_struct *mm);
37+
extern void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
38+
39+
extern void __local_flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
40+
int tsize, int ind);
41+
42+
#ifdef CONFIG_SMP
43+
extern void flush_tlb_mm(struct mm_struct *mm);
44+
extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
45+
extern void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
46+
int tsize, int ind);
47+
#else
48+
#define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
49+
#define flush_tlb_page(vma,addr) local_flush_tlb_page(vma,addr)
50+
#define __flush_tlb_page(mm,addr,p,i) __local_flush_tlb_page(mm,addr,p,i)
51+
#endif
52+
53+
#endif /* _ASM_POWERPC_NOHASH_TLBFLUSH_H */

arch/powerpc/include/asm/tlbflush.h

Lines changed: 5 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,11 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
12
#ifndef _ASM_POWERPC_TLBFLUSH_H
23
#define _ASM_POWERPC_TLBFLUSH_H
34

4-
/*
5-
* TLB flushing:
6-
*
7-
* - flush_tlb_mm(mm) flushes the specified mm context TLB's
8-
* - flush_tlb_page(vma, vmaddr) flushes one page
9-
* - local_flush_tlb_mm(mm, full) flushes the specified mm context on
10-
* the local processor
11-
* - local_flush_tlb_page(vma, vmaddr) flushes one page on the local processor
12-
* - flush_tlb_page_nohash(vma, vmaddr) flushes one page if SW loaded TLB
13-
* - flush_tlb_range(vma, start, end) flushes a range of pages
14-
* - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
15-
*
16-
* This program is free software; you can redistribute it and/or
17-
* modify it under the terms of the GNU General Public License
18-
* as published by the Free Software Foundation; either version
19-
* 2 of the License, or (at your option) any later version.
20-
*/
21-
#ifdef __KERNEL__
22-
23-
#ifdef CONFIG_PPC_MMU_NOHASH
24-
/*
25-
* TLB flushing for software loaded TLB chips
26-
*
27-
* TODO: (CONFIG_FSL_BOOKE) determine if flush_tlb_range &
28-
* flush_tlb_kernel_range are best implemented as tlbia vs
29-
* specific tlbie's
30-
*/
31-
32-
struct vm_area_struct;
33-
struct mm_struct;
34-
35-
#define MMU_NO_CONTEXT ((unsigned int)-1)
36-
37-
extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
38-
unsigned long end);
39-
extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
40-
41-
extern void local_flush_tlb_mm(struct mm_struct *mm);
42-
extern void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
43-
44-
extern void __local_flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
45-
int tsize, int ind);
46-
47-
#ifdef CONFIG_SMP
48-
extern void flush_tlb_mm(struct mm_struct *mm);
49-
extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
50-
extern void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
51-
int tsize, int ind);
52-
#else
53-
#define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
54-
#define flush_tlb_page(vma,addr) local_flush_tlb_page(vma,addr)
55-
#define __flush_tlb_page(mm,addr,p,i) __local_flush_tlb_page(mm,addr,p,i)
56-
#endif
57-
58-
#elif defined(CONFIG_PPC_STD_MMU_32)
59-
60-
#define MMU_NO_CONTEXT (0)
61-
/*
62-
* TLB flushing for "classic" hash-MMU 32-bit CPUs, 6xx, 7xx, 7xxx
63-
*/
64-
extern void flush_tlb_mm(struct mm_struct *mm);
65-
extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
66-
extern void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr);
67-
extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
68-
unsigned long end);
69-
extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
70-
static inline void local_flush_tlb_page(struct vm_area_struct *vma,
71-
unsigned long vmaddr)
72-
{
73-
flush_tlb_page(vma, vmaddr);
74-
}
75-
static inline void local_flush_tlb_mm(struct mm_struct *mm)
76-
{
77-
flush_tlb_mm(mm);
78-
}
79-
80-
#elif defined(CONFIG_PPC_BOOK3S_64)
81-
#include <asm/book3s/64/tlbflush.h>
5+
#ifdef CONFIG_PPC_BOOK3S
6+
#include <asm/book3s/tlbflush.h>
827
#else
83-
#error Unsupported MMU type
84-
#endif
8+
#include <asm/nohash/tlbflush.h>
9+
#endif /* !CONFIG_PPC_BOOK3S */
8510

86-
#endif /*__KERNEL__ */
8711
#endif /* _ASM_POWERPC_TLBFLUSH_H */

0 commit comments

Comments
 (0)