mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] arm64: fix two bug about page table check
@ 2022-11-17  7:56 Liu Shixin
  2022-11-17  7:56 ` [PATCH v2 1/2] arm64/mm: fix incorrect file_map_count for non-leaf pmd/pud Liu Shixin
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Liu Shixin @ 2022-11-17  7:56 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Denys Vlasenko, Kefeng Wang,
	Anshuman Khandual, David Hildenbrand, Rafael Aquini,
	Pasha Tatashin
  Cc: linux-arm-kernel, linux-kernel, Liu Shixin

Denys Vlasenko has reported two bug about page table check on arm64.
On arm64, pmd_present() contains non-leaf pmd and invalid pmd too.

When collapse hugepage, the pmd is non-leaf and should skip the check.
Use pmd_leaf() instead of pmd_present().

When split hugepage, the pmd will be marked as invalid and then populate.
So we should decrease file_map_count when invalid pmd and then increase
when populate the pmd. Add pmd_valid() check.

v1->v2: Update comment and optimize the code by moving p?d_valid() at
	first place suggested by Mark.

Liu Shixin (2):
  arm64/mm: fix incorrect file_map_count for non-leaf pmd/pud
  arm64/mm: fix incorrect file_map_count for invalid pmd/pud

 arch/arm64/include/asm/pgtable.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2022-11-22  3:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17  7:56 [PATCH v2 0/2] arm64: fix two bug about page table check Liu Shixin
2022-11-17  7:56 ` [PATCH v2 1/2] arm64/mm: fix incorrect file_map_count for non-leaf pmd/pud Liu Shixin
2022-11-17  7:56   ` Kefeng Wang
2022-11-18 14:35   ` Will Deacon
2022-11-22  3:21   ` Anshuman Khandual
2022-11-17  7:56 ` [PATCH v2 2/2] arm64/mm: fix incorrect file_map_count for invalid pmd/pud Liu Shixin
2022-11-17  7:49   ` David Hildenbrand
2022-11-17  7:56   ` Kefeng Wang
2022-11-18 14:34   ` Will Deacon
2022-11-21  3:15     ` Liu Shixin
2022-11-21 18:16       ` Will Deacon
2022-11-22  1:24         ` Liu Shixin
2022-11-18 19:35 ` (subset) [PATCH v2 0/2] arm64: fix two bug about page table check Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®