mirror of https://github.com/torvalds/linux.git
Patch series "Fix CONT-PTE/PMD size hugetlb issue when unmapping or migrating", v4. presently, migrating a hugetlb page or unmapping a poisoned hugetlb page, we'll use ptep_clear_flush() and set_pte_at() to nuke the page table entry and remap it, and this is incorrect for CONT-PTE or CONT-PMD size hugetlb page, which will cause potential data consistent issue. This patch set will change to use hugetlb related APIs to fix this issue. Note: Mike pointed out the huge_ptep_get() will only return the one specific value, and it would not take into account the dirty or young bits of CONT-PTE/PMDs like the huge_ptep_get_and_clear() [1]. This inconsistent issue is not introduced by this patch set, and this issue will be addressed in another thread [2]. Meanwhile the uffd for hugetlb case [3] pointed out by Gerald also needs another patch to address. [1] https://lore.kernel.org/linux-mm/85bd80b4-b4fd-0d3f-a2e5-149559f2f387@oracle.com/ [2] https://lore.kernel.org/all/cover.1651998586.git.baolin.wang@linux.alibaba.com/ [3] https://lore.kernel.org/linux-mm/20220503120343.6264e126@thinkpad/ This patch (of 3): It is incorrect to use ptep_clear_flush() to nuke a hugetlb page table when unmapping or migrating a hugetlb page, and will change to use huge_ptep_clear_flush() instead in the following patches. So this is a preparation patch, which changes the huge_ptep_clear_flush() to return the original pte to help to nuke a hugetlb page table. [baolin.wang@linux.alibaba.com: fix build in several more architectures] Link: https://lkml.kernel.org/r/0009a4cd-2826-e8be-e671-f050d4f18d5d@linux.alibaba.com [sfr@canb.auug.org.au: fixup] Link: https://lkml.kernel.org/r/20220511181531.7f27a5c1@canb.auug.org.au Link: https://lkml.kernel.org/r/cover.1652270205.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/20f77ddab90baa249bd24504c413189b82acde69.1652270205.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/cover.1652147571.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/dcf065868cce35bceaf138613ad27f17bb7c0c19.1652147571.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Mike Kravetz <mike.kravetz@oracle.com> Reviewed-by: Muchun Song <songmuchun@bytedance.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Helge Deller <deller@gmx.de> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Alexander Gordeev <agordeev@linux.ibm.com> Cc: Christian Borntraeger <borntraeger@linux.ibm.com> Cc: Sven Schnelle <svens@linux.ibm.com> Cc: Yoshinori Sato <ysato@users.osdn.me> Cc: Rich Felker <dalias@libc.org> Cc: David S. Miller <davem@davemloft.net> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
||
|---|---|---|
| .. | ||
| Kbuild | ||
| adc.h | ||
| addrspace.h | ||
| alignment.h | ||
| asm-offsets.h | ||
| atomic-grb.h | ||
| atomic-irq.h | ||
| atomic-llsc.h | ||
| atomic.h | ||
| barrier.h | ||
| bitops-cas.h | ||
| bitops-grb.h | ||
| bitops-llsc.h | ||
| bitops-op32.h | ||
| bitops.h | ||
| bl_bit.h | ||
| bl_bit_32.h | ||
| bug.h | ||
| bugs.h | ||
| cache.h | ||
| cache_insns.h | ||
| cache_insns_32.h | ||
| cacheflush.h | ||
| checksum.h | ||
| checksum_32.h | ||
| clock.h | ||
| cmpxchg-cas.h | ||
| cmpxchg-grb.h | ||
| cmpxchg-irq.h | ||
| cmpxchg-llsc.h | ||
| cmpxchg-xchg.h | ||
| cmpxchg.h | ||
| device.h | ||
| dma-register.h | ||
| dma.h | ||
| dmabrg.h | ||
| dwarf.h | ||
| elf.h | ||
| entry-macros.S | ||
| extable.h | ||
| fb.h | ||
| fixmap.h | ||
| flat.h | ||
| fpu.h | ||
| freq.h | ||
| ftrace.h | ||
| futex-cas.h | ||
| futex-irq.h | ||
| futex-llsc.h | ||
| futex.h | ||
| gpio.h | ||
| hardirq.h | ||
| hd64461.h | ||
| heartbeat.h | ||
| hugetlb.h | ||
| hw_breakpoint.h | ||
| hw_irq.h | ||
| i2c-sh7760.h | ||
| io.h | ||
| io_generic.h | ||
| io_noioport.h | ||
| io_trapped.h | ||
| irq.h | ||
| irqflags.h | ||
| kdebug.h | ||
| kexec.h | ||
| kgdb.h | ||
| kprobes.h | ||
| linkage.h | ||
| machvec.h | ||
| mmiowb.h | ||
| mmu.h | ||
| mmu_context.h | ||
| mmu_context_32.h | ||
| mmzone.h | ||
| module.h | ||
| page.h | ||
| pci.h | ||
| perf_event.h | ||
| pgalloc.h | ||
| pgtable-2level.h | ||
| pgtable-3level.h | ||
| pgtable.h | ||
| pgtable_32.h | ||
| platform_early.h | ||
| posix_types.h | ||
| processor.h | ||
| processor_32.h | ||
| ptrace.h | ||
| ptrace_32.h | ||
| push-switch.h | ||
| reboot.h | ||
| romimage-macros.h | ||
| rtc.h | ||
| seccomp.h | ||
| sections.h | ||
| setup.h | ||
| sfp-machine.h | ||
| sh7760fb.h | ||
| sh_bios.h | ||
| shmparam.h | ||
| siu.h | ||
| smc37c93x.h | ||
| smp-ops.h | ||
| smp.h | ||
| sparsemem.h | ||
| spi.h | ||
| spinlock-cas.h | ||
| spinlock-llsc.h | ||
| spinlock.h | ||
| spinlock_types.h | ||
| sram.h | ||
| stackprotector.h | ||
| stacktrace.h | ||
| string.h | ||
| string_32.h | ||
| suspend.h | ||
| switch_to.h | ||
| switch_to_32.h | ||
| syscall.h | ||
| syscall_32.h | ||
| syscalls.h | ||
| syscalls_32.h | ||
| thread_info.h | ||
| timex.h | ||
| tlb.h | ||
| tlbflush.h | ||
| topology.h | ||
| traps.h | ||
| traps_32.h | ||
| types.h | ||
| uaccess.h | ||
| uaccess_32.h | ||
| uncached.h | ||
| unistd.h | ||
| unwinder.h | ||
| user.h | ||
| vermagic.h | ||
| vga.h | ||
| vmalloc.h | ||
| vmlinux.lds.h | ||
| watchdog.h | ||
| word-at-a-time.h | ||