Skip to content

Commit d9cf600

Browse files
KunWuChanmpe
authored andcommitted
powerpc/mm: Code cleanup for __hash_page_thp
This part was commented from commit 6d492ec ("powerpc/THP: Add code to handle HPTE faults for hugepages") in about 11 years before. If there are no plans to enable this part code in the future, we can remove this dead code and replace with a comment explaining what the dead code was trying to say. Signed-off-by: Kunwu Chan <chentao@kylinos.cn> Suggested-by: Michael Ellerman <mpe@ellerman.id.au> Suggested-by: "Aneesh Kumar K.V" <aneesh.kumar@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240301085834.1512921-1-chentao@kylinos.cn
1 parent ad86d7e commit d9cf600

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

arch/powerpc/mm/book3s64/hash_hugepage.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,13 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid,
5959

6060
rflags = htab_convert_pte_flags(new_pmd, flags);
6161

62-
#if 0
63-
if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) {
62+
/*
63+
* THPs are only supported on platforms that can do mixed page size
64+
* segments (MPSS) and all such platforms have coherent icache. Hence we
65+
* don't need to do lazy icache flush (hash_page_do_lazy_icache()) on
66+
* noexecute fault.
67+
*/
6468

65-
/*
66-
* No CPU has hugepages but lacks no execute, so we
67-
* don't need to worry about that case
68-
*/
69-
rflags = hash_page_do_lazy_icache(rflags, __pte(old_pte), trap);
70-
}
71-
#endif
7269
/*
7370
* Find the slot index details for this ea, using base page size.
7471
*/

0 commit comments

Comments
 (0)