Re: [PATCH 7/7] mm: Add folio_mk_pte()

2025-02-18 Thread David Hildenbrand
On 17.02.25 20:08, Matthew Wilcox (Oracle) wrote: Removes a cast from folio to page in four callers of mk_pte(). Signed-off-by: Matthew Wilcox (Oracle) --- Yes, that looks good Acked-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH 6/7] mm: Make mk_pte() definition unconditional

2025-02-18 Thread David Hildenbrand
page *page, pgprot_t pgprot) { return pfn_pte(page_to_pfn(page), pgprot); } #endif -#endif /** * folio_maybe_dma_pinned - Report if a folio may be pinned for DMA. Acked-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH 2/7] mm: Introduce a common definition of mk_pte()

2025-02-18 Thread David Hildenbrand
) --- Acked-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH 1/7] mm: Set the pte dirty if the folio is already dirty

2025-02-18 Thread David Hildenbrand
= maybe_mkwrite(pte_mkdirty(entry), vma); + else if (pte_write(entry) && folio_test_dirty(folio)) + entry = pte_mkdirty(entry); if (unlikely(vmf_orig_pte_uffd_wp(vmf))) entry = pte_mkuffd_wp(entry); /* copy-on-write page */ Yes, that loo

Re: [PATCH 0/7] Add folio_mk_pte() and simplify mk_pte()

2025-02-18 Thread David Hildenbrand
On 17.02.25 20:08, Matthew Wilcox (Oracle) wrote: The intent is to add folio_mk_pte() to remove the conversion from folio to page necessary to call mk_pte(). Eventually we might end up removing mk_pte(), but that's not what's being proposed today. I didn't want to add folio_mk_pte() to each arc

Re: [PATCH 0/2] mm: make copy_to_kernel_nofault() not fault on user addresses

2024-09-02 Thread David Hildenbrand
On 02.09.24 17:26, Omar Sandoval wrote: On Mon, Sep 02, 2024 at 10:56:27AM +0200, David Hildenbrand wrote: On 02.09.24 08:31, Omar Sandoval wrote: On Mon, Sep 02, 2024 at 08:19:33AM +0200, Christophe Leroy wrote: Le 02/09/2024 à 07:31, Omar Sandoval a écrit : [Vous ne recevez pas souvent

Re: [PATCH 0/2] mm: make copy_to_kernel_nofault() not fault on user addresses

2024-09-02 Thread David Hildenbrand
On 02.09.24 08:31, Omar Sandoval wrote: On Mon, Sep 02, 2024 at 08:19:33AM +0200, Christophe Leroy wrote: Le 02/09/2024 à 07:31, Omar Sandoval a écrit : [Vous ne recevez pas souvent de courriers de osan...@osandov.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderId

Re: [PATCH 2/2] virtio: fix vq # when vq skipped

2024-07-09 Thread David Hildenbrand
what the API was supposed to do in the 1st place. Compatibility with buggy hypervisors is handled inside virtio-balloon, which is the only driver making use of this facility, so far. Signed-off-by: Michael S. Tsirkin --- Reviewed-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH] um/mm: get max_low_pfn from memblock

2024-06-14 Thread David Hildenbrand
to rely on totalram_pages(). Signed-off-by: Wei Yang CC: Jason Lunz CC: Jeff Dike Cc: Paolo 'Blaisorblade' Giarrusso Cc: Alasdair G Kergon Cc: Jens Axboe CC: Andrew Morton CC: Mike Rapoport (IBM) CC: David Hildenbrand --- A simple UML bootup test looks good. --- arch/um/kernel/m

Re: [PATCH vhost v5 1/6] virtio_balloon: remove the dependence where names[] is null

2024-03-25 Thread David Hildenbrand
purposes. Assuming I didn't miss a functional change Acked-by: David Hildenbrand -- Cheers, David / dhildenb

Re: [PATCH vhost v4 1/6] virtio_balloon: remove the dependence where names[] is null

2024-03-25 Thread David Hildenbrand
On 25.03.24 07:08, Xuan Zhuo wrote: On Fri, 22 Mar 2024 22:02:27 +0100, David Hildenbrand wrote: On 22.03.24 20:16, Daniel Verkamp wrote: On Thu, Mar 21, 2024 at 3:16 AM Xuan Zhuo wrote: Currently, the init_vqs function within the virtio_balloon driver relies on the condition that certain

Re: [PATCH vhost v4 1/6] virtio_balloon: remove the dependence where names[] is null

2024-03-22 Thread David Hildenbrand
On 22.03.24 20:16, Daniel Verkamp wrote: On Thu, Mar 21, 2024 at 3:16 AM Xuan Zhuo wrote: Currently, the init_vqs function within the virtio_balloon driver relies on the condition that certain names array entries are null in order to skip the initialization of some virtual queues (vqs). This b

Re: [PATCH vhost v4 1/6] virtio_balloon: remove the dependence where names[] is null

2024-03-22 Thread David Hildenbrand
On 21.03.24 11:15, Xuan Zhuo wrote: Currently, the init_vqs function within the virtio_balloon driver relies on the condition that certain names array entries are null in order to skip the initialization of some virtual queues (vqs). This behavior is unique to this part of the codebase. In an upc

Re: [PATCH v6 00/33] Split ptdesc from struct page

2023-06-28 Thread David Hildenbrand
On 27.06.23 22:13, Hugh Dickins wrote: On Tue, 27 Jun 2023, David Hildenbrand wrote: On 27.06.23 06:44, Hugh Dickins wrote: On Mon, 26 Jun 2023, Vishal Moola (Oracle) wrote: The MM subsystem is trying to shrink struct page. This patchset introduces a memory descriptor for page table tracking

Re: [PATCH v6 00/33] Split ptdesc from struct page

2023-06-27 Thread David Hildenbrand
On 27.06.23 06:44, Hugh Dickins wrote: On Mon, 26 Jun 2023, Vishal Moola (Oracle) wrote: The MM subsystem is trying to shrink struct page. This patchset introduces a memory descriptor for page table tracking - struct ptdesc. ... 39 files changed, 686 insertions(+), 455 deletions(-) I don'

Re: [PATCH v9 01/42] mm: Rename arch pte_mkwrite()'s to pte_mkwrite_novma()

2023-06-13 Thread David Hildenbrand
the creation of a special type of writable memory (shadow stack) that is only writable in limited specific ways. Previously, changes were proposed to core MM code to teach it to decide when to create normally writable memory or the special shadow stack writable memory, but David Hildenbrand suggested

Re: [PATCH 01/33] s390: Use _pt_s390_gaddr for gmap address tracking

2023-04-19 Thread David Hildenbrand
On 18.04.23 23:33, Vishal Moola wrote: On Tue, Apr 18, 2023 at 8:45 AM David Hildenbrand wrote: On 17.04.23 22:50, Vishal Moola (Oracle) wrote: s390 uses page->index to keep track of page tables for the guest address space. In an attempt to consolidate the usage of page fields in s

Re: [PATCH 01/33] s390: Use _pt_s390_gaddr for gmap address tracking

2023-04-18 Thread David Hildenbrand
On 17.04.23 22:50, Vishal Moola (Oracle) wrote: s390 uses page->index to keep track of page tables for the guest address space. In an attempt to consolidate the usage of page fields in s390, replace _pt_pad_2 with _pt_s390_gaddr to replace page->index in gmap. This will help with the splitting o

Re: [PATCH v7 13/41] mm: Make pte_mkwrite() take a VMA

2023-03-01 Thread David Hildenbrand
On 01.03.23 08:03, Christophe Leroy wrote: Le 27/02/2023 à 23:29, Rick Edgecombe a écrit : The x86 Control-flow Enforcement Technology (CET) feature includes a new type of memory called shadow stack. This shadow stack memory has some unusual properties, which requires some core mm changes to f

Re: [PATCH mm-unstable v1 19/26] riscv/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-02-28 Thread David Hildenbrand
On 28.02.23 16:50, Palmer Dabbelt wrote: On Fri, 13 Jan 2023 09:10:19 PST (-0800), da...@redhat.com wrote: Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by stealing one bit from the offset. This reduces the maximum swap space per file: on 32bit to 16 GiB (was 32 GiB). Seems fine to me, I doubt a

Re: [PATCH mm-unstable v1 11/26] microblaze/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-02-28 Thread David Hildenbrand
On 27.02.23 20:46, Geert Uytterhoeven wrote: Hi David, On Mon, Feb 27, 2023 at 6:01 PM David Hildenbrand wrote: /* * Externally used page protection values. diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h index 42f5988e998b..7e3de54bf426

Re: [PATCH mm-unstable v1 11/26] microblaze/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-02-27 Thread David Hildenbrand
/* * Externally used page protection values. diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h index 42f5988e998b..7e3de54bf426 100644 --- a/arch/microblaze/include/asm/pgtable.h +++ b/arch/microblaze/include/asm/pgtable.h @@ -131,10 +131,10 @@ exte

Re: [PATCH mm-unstable v1 11/26] microblaze/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-02-27 Thread David Hildenbrand
On 26.02.23 21:13, Geert Uytterhoeven wrote: Hi David, Hi Geert, On Fri, Jan 13, 2023 at 6:16 PM David Hildenbrand wrote: Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by stealing one bit from the type. Generic MM currently only uses 5 bits for the type (MAX_SWAPFILES_SHIFT), so the s

Re: [PATCH v6 13/41] mm: Make pte_mkwrite() take a VMA

2023-02-20 Thread David Hildenbrand
nux-s...@vger.kernel.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: linux-um@lists.infradead.org Cc: xen-de...@lists.xenproject.org Cc: linux-a...@vger.kernel.org Cc: linux...@kvack.org Tested-by: Pengfei Xu Suggested-by: David Hildenbrand Signed-off-by: Rick Edgecombe --- Hi Non-x86 A

Re: [PATCH mm-unstable v1 04/26] arm/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-02-08 Thread David Hildenbrand
On 07.02.23 01:32, Mark Brown wrote: On Fri, Jan 13, 2023 at 06:10:04PM +0100, David Hildenbrand wrote: Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by stealing one bit from the offset. This reduces the maximum swap space per file to 64 GiB (was 128 GiB). While at it drop the PTE_TYPE_

Re: [PATCH v2 3/4] mips: drop definition of pfn_valid() for DISCONTIGMEM

2023-02-03 Thread David Hildenbrand
off-by: Mike Rapoport (IBM) Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb ___ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um

Re: [PATCH v2 4/4] mm, arch: add generic implementation of pfn_valid() for FLATMEM

2023-02-03 Thread David Hildenbrand
ntation of pfn_valid() and drop its per-architecture definitions. Signed-off-by: Mike Rapoport (IBM) Acked-by: Arnd Bergmann Acked-by: Guo Ren # csky Acked-by: Huacai Chen # LoongArch Acked-by: Stafford Horne# OpenRISC --- LGTM with the fixup Reviewed-by: David H

Re: [PATCH v2 2/4] m68k: use asm-generic/memory_model.h for both MMU and !MMU

2023-02-03 Thread David Hildenbrand
h and drop redundant definitions. Signed-off-by: Mike Rapoport (IBM) Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven --- Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb ___ linux-um mailing list linux-um@lists.infradea

Re: [PATCH v2 1/4] arm: include asm-generic/memory_model.h from page.h rather than memory.h

2023-02-03 Thread David Hildenbrand
Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb ___ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um

Re: [PATCH mm-unstable v1 01/26] mm/debug_vm_pgtable: more pte_swp_exclusive() sanity checks

2023-01-14 Thread David Hildenbrand
On 13.01.23 18:10, David Hildenbrand wrote: We want to implement __HAVE_ARCH_PTE_SWP_EXCLUSIVE on all architectures. Let's extend our sanity checks, especially testing that our PTE bit does not affect: * is_swap_pte() -> pte_present() and pte_none() * the swap entry + type * pte_swp_so

[PATCH mm-unstable v1 17/26] powerpc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on 32bit book3s

2023-01-13 Thread David Hildenbrand
cannot be used, and reusing it avoids having to steal one bit from the swap offset. While at it, mask the type in __swp_entry(). Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Signed-off-by: David Hildenbrand --- arch/powerpc/include/asm/book3s/32/pgtable.h | 38 +

[PATCH mm-unstable v1 25/26] xtensa/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
k 1100 and 1110 now identify swap PTEs. While at it, remove SWP_TYPE_BITS (not really helpful as it's not used in the actual swap macros) and mask the type in __swp_entry(). Cc: Chris Zankel Cc: Max Filippov Signed-off-by: David Hildenbrand --- arch/xtensa/include/asm

[PATCH mm-unstable v1 24/26] x86/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE also on 32bit

2023-01-13 Thread David Hildenbrand
le at it, mask the type in __swp_entry(); use some helper definitions to make the macros easier to grasp. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Signed-off-by: David Hildenbrand --- arch/x86/include/asm/pgtabl

[PATCH mm-unstable v1 26/26] mm: remove __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
__HAVE_ARCH_PTE_SWP_EXCLUSIVE is now supported by all architectures that support swp PTEs, so let's drop it. Signed-off-by: David Hildenbrand --- arch/alpha/include/asm/pgtable.h | 1 - arch/arc/include/asm/pgtable-bits-arcv2.h| 1 - arch/arm/include/asm/pgta

[PATCH mm-unstable v1 23/26] um/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
k the type in __swp_entry(). Cc: Richard Weinberger Cc: Anton Ivanov Cc: Johannes Berg Signed-off-by: David Hildenbrand --- arch/um/include/asm/pgtable.h | 37 +-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/arch/um/include/asm/pgtable.h b/ar

[PATCH mm-unstable v1 22/26] sparc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on 64bit

2023-01-13 Thread David Hildenbrand
Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by stealing one bit from the type. Generic MM currently only uses 5 bits for the type (MAX_SWAPFILES_SHIFT), so the stolen bit was effectively unused. While at it, mask the type in __swp_entry(). Cc: "David S. Miller" Signed-off-by: Da

[PATCH mm-unstable v1 21/26] sparc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on 32bit

2023-01-13 Thread David Hildenbrand
archs. Note that the old documentation was wrong: we use 20 bit for the offset and the reserved bits were 8 instead of 7 bits in the ascii art. Cc: "David S. Miller" Signed-off-by: David Hildenbrand --- arch/sparc/include/asm/pgtable_32.h | 27 ++- arch/sp

[PATCH mm-unstable v1 20/26] sh/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
While at it, mask the type in __swp_entry(). Cc: Yoshinori Sato Cc: Rich Felker Signed-off-by: David Hildenbrand --- arch/sh/include/asm/pgtable_32.h | 54 +--- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/arch/sh/include/asm/pgtable_32.h b/arch/

[PATCH mm-unstable v1 19/26] riscv/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
pe in __swp_entry(). Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Signed-off-by: David Hildenbrand --- arch/riscv/include/asm/pgtable-bits.h | 3 +++ arch/riscv/include/asm/pgtable.h | 29 ++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/arch/

[PATCH mm-unstable v1 18/26] powerpc/nohash/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
Signed-off-by: David Hildenbrand --- arch/powerpc/include/asm/nohash/32/pgtable.h | 22 + arch/powerpc/include/asm/nohash/32/pte-40x.h | 6 ++--- arch/powerpc/include/asm/nohash/32/pte-44x.h | 18 -- arch/powerpc/include/asm/nohash/32/pte-85xx.h | 4 ++-- arch/powe

[PATCH mm-unstable v1 16/26] parisc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
bit avoids having to steal one bit from the swap offset. Cc: "James E.J. Bottomley" Cc: Helge Deller Signed-off-by: David Hildenbrand --- arch/parisc/include/asm/pgtable.h | 41 --- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/arch/parisc/i

[PATCH mm-unstable v1 15/26] openrisc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
d-off-by: David Hildenbrand --- arch/openrisc/include/asm/pgtable.h | 41 + 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/arch/openrisc/include/asm/pgtable.h b/arch/openrisc/include/asm/pgtable.h index 6477c17b3062..903b32d662ab 100644 --- a/arch/ope

[PATCH mm-unstable v1 14/26] nios2/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by using the yet-unused bit 31. Cc: Thomas Bogendoerfer Signed-off-by: David Hildenbrand --- arch/nios2/include/asm/pgtable-bits.h | 3 +++ arch/nios2/include/asm/pgtable.h | 22 +- 2 files changed, 24 insertions(

[PATCH mm-unstable v1 13/26] nios2/mm: refactor swap PTE layout

2023-01-13 Thread David Hildenbrand
ts for the swap type and document the layout. Bits 26--31 should get ignored by hardware completely, so they can be used. Cc: Dinh Nguyen Signed-off-by: David Hildenbrand --- arch/nios2/include/asm/pgtable.h | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/

[PATCH mm-unstable v1 12/26] mips/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
confusing, document it a bit better. While at it, mask the type in __swp_entry()/mk_swap_pte(). Cc: Thomas Bogendoerfer Signed-off-by: David Hildenbrand --- arch/mips/include/asm/pgtable-32.h | 88 ++ arch/mips/include/asm/pgtable-64.h | 23 ++-- arch/mips/include/asm

[PATCH mm-unstable v1 11/26] microblaze/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
out a little bit harder to decipher. While at it, drop the comment from paulus---copy-and-paste leftover from powerpc where we actually have _PAGE_HASHPTE---and mask the type in __swp_entry_to_pte() as well. Cc: Michal Simek Signed-off-by: David Hildenbrand --- arch/m68k/include/asm/mcf_pgtable.h

[PATCH mm-unstable v1 09/26] m68k/mm: remove dummy __swp definitions for nommu

2023-01-13 Thread David Hildenbrand
The definitions are not required, let's remove them. Cc: Geert Uytterhoeven Cc: Greg Ungerer Signed-off-by: David Hildenbrand --- arch/m68k/include/asm/pgtable_no.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/includ

[PATCH mm-unstable v1 10/26] m68k/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
mask the type in __swp_entry(). Cc: Geert Uytterhoeven Cc: Greg Ungerer Signed-off-by: David Hildenbrand --- arch/m68k/include/asm/mcf_pgtable.h | 36 -- arch/m68k/include/asm/motorola_pgtable.h | 38 +-- arch/m68k/include/asm/sun3_pgtable.h

[PATCH mm-unstable v1 08/26] loongarch/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
PMDs and could also be used in swap PMD context later. Cc: Huacai Chen Cc: WANG Xuerui Signed-off-by: David Hildenbrand --- arch/loongarch/include/asm/pgtable-bits.h | 4 +++ arch/loongarch/include/asm/pgtable.h | 39 --- 2 files changed, 39 insertions(+), 4 dele

[PATCH mm-unstable v1 07/26] ia64/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by stealing one bit from the type. Generic MM currently only uses 5 bits for the type (MAX_SWAPFILES_SHIFT), so the stolen bit is effectively unused. While at it, also mask the type in __swp_entry(). Signed-off-by: David Hildenbrand --- arch

[PATCH mm-unstable v1 06/26] hexagon/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by stealing one bit from the offset. This reduces the maximum swap space per file to 16 GiB (was 32 GiB). While at it, mask the type in __swp_entry(). Cc: Brian Cain Signed-off-by: David Hildenbrand --- arch/hexagon/include/asm/pgtable.h

[PATCH mm-unstable v1 05/26] csky/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
esent(), pte_none() and HW happy. For now, let's keep it simple because there might be something non-obvious. Cc: Guo Ren Signed-off-by: David Hildenbrand --- arch/csky/abiv1/inc/abi/pgtable-bits.h | 13 + arch/csky/abiv2/inc/abi/pgtable-bits.h | 19 --- arch/csky/i

[PATCH mm-unstable v1 04/26] arm/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
with "Linux PTEs" not "hardware PTEs". Also, properly mask the type in __swp_entry(). Cc: Russell King Signed-off-by: David Hildenbrand --- arch/arm/include/asm/pgtable-2level.h | 3 +++ arch/arm/include/asm/pgtable-3level.h | 3 +++ arch/arm/include/

[PATCH mm-unstable v1 03/26] arc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by using bit 5, which is yet unused. The only important parts seems to be to not use _PAGE_PRESENT (bit 9). Cc: Vineet Gupta Signed-off-by: David Hildenbrand --- arch/arc/include/asm/pgtable-bits-arcv2.h | 27 --- 1 file ch

[PATCH mm-unstable v1 02/26] alpha/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2023-01-13 Thread David Hildenbrand
y Cc: Matt Turner Signed-off-by: David Hildenbrand --- arch/alpha/include/asm/pgtable.h | 41 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h index 9e45f6735d5d..970abf511b13 100644

[PATCH mm-unstable v1 01/26] mm/debug_vm_pgtable: more pte_swp_exclusive() sanity checks

2023-01-13 Thread David Hildenbrand
when the swap PTE layout differs heavily from ordinary PTEs. Let's properly construct a swap PTE from swap type+offset. Signed-off-by: David Hildenbrand --- mm/debug_vm_pgtable.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/mm/debug_vm_p

[PATCH mm-unstable v1 00/26] mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on all architectures with swap PTEs

2023-01-13 Thread David Hildenbrand
owerpc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on 32bit book3s" -> Fixup swap PTE description David Hildenbrand (26): mm/debug_vm_pgtable: more pte_swp_exclusive() sanity checks alpha/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE arc/mm: support __HAVE_ARCH_PTE_SWP_E

Re: [PATCH mm-unstable RFC 00/26] mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on all architectures with swap PTEs

2022-12-18 Thread David Hildenbrand
) didn't call it pte_mksoft_clean(). Grepping for "pte_swp.*soft_dirty" gives you the full picture. Thanks! David Huacai On Tue, Dec 6, 2022 at 10:48 PM David Hildenbrand wrote: This is the follow-up on [1]: [PATCH v2 0/8] mm: COW fixes part 3: reliable GUP R/

Re: [PATCH mm-unstable RFC 00/26] mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on all architectures with swap PTEs

2022-12-14 Thread David Hildenbrand
On 06.12.22 15:47, David Hildenbrand wrote: This is the follow-up on [1]: [PATCH v2 0/8] mm: COW fixes part 3: reliable GUP R/W FOLL_GET of anonymous pages After we implemented __HAVE_ARCH_PTE_SWP_EXCLUSIVE on most prominent enterprise architectures, implement

Re: [PATCH mm-unstable RFC 17/26] powerpc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on 32bit book3s

2022-12-08 Thread David Hildenbrand
On 08.12.22 09:52, David Hildenbrand wrote: On 07.12.22 14:55, Christophe Leroy wrote: Le 06/12/2022 à 15:47, David Hildenbrand a écrit : We already implemented support for 64bit book3s in commit bff9beaa2e80 ("powerpc/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE for book3s&quo

Re: [PATCH mm-unstable RFC 17/26] powerpc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on 32bit book3s

2022-12-08 Thread David Hildenbrand
On 07.12.22 14:55, Christophe Leroy wrote: Le 06/12/2022 à 15:47, David Hildenbrand a écrit : We already implemented support for 64bit book3s in commit bff9beaa2e80 ("powerpc/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE for book3s") Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIV

[PATCH mm-unstable RFC 26/26] mm: remove __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
Supported by all architectures that support swp PTEs, so let's drop it. Signed-off-by: David Hildenbrand --- arch/alpha/include/asm/pgtable.h | 1 - arch/arc/include/asm/pgtable-bits-arcv2.h| 1 - arch/arm/include/asm/pgtable.h | 1 - arch/arm64/includ

[PATCH mm-unstable RFC 25/26] xtensa/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
k 1100 and 1110 now identify swap PTEs. While at it, remove SWP_TYPE_BITS (not really helpful as it's not used in the actual swap macros) and mask the type in __swp_entry(). Cc: Chris Zankel Cc: Max Filippov Signed-off-by: David Hildenbrand --- arch/xtensa/include/asm

[PATCH mm-unstable RFC 24/26] x86/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE also on 32bit

2022-12-06 Thread David Hildenbrand
le at it, mask the type in __swp_entry(); use some helper definitions to make the macros easier to grasp. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Signed-off-by: David Hildenbrand --- arch/x86/include/asm/pgtabl

[PATCH mm-unstable RFC 23/26] um/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
k the type in __swp_entry(). Cc: Richard Weinberger Cc: Anton Ivanov Cc: Johannes Berg Signed-off-by: David Hildenbrand --- arch/um/include/asm/pgtable.h | 37 +-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/arch/um/include/asm/pgtable.h b/ar

[PATCH mm-unstable RFC 22/26] sparc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on 64bit

2022-12-06 Thread David Hildenbrand
Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by stealing one bit from the type. Generic MM currently only uses 5 bits for the type (MAX_SWAPFILES_SHIFT), so the stolen bit was effectively unused. While at it, mask the type in __swp_entry(). Cc: "David S. Miller" Signed-off-by: Da

[PATCH mm-unstable RFC 21/26] sparc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on 32bit

2022-12-06 Thread David Hildenbrand
archs. Note that the old documentation was wrong: we use 20 bit for the offset and the reserved bits were 8 instead of 7 bits in the ascii art. Cc: "David S. Miller" Signed-off-by: David Hildenbrand --- arch/sparc/include/asm/pgtable_32.h | 27 ++- arch/sp

[PATCH mm-unstable RFC 20/26] sh/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
While at it, mask the type in __swp_entry(). Cc: Yoshinori Sato Cc: Rich Felker Signed-off-by: David Hildenbrand --- arch/sh/include/asm/pgtable_32.h | 54 +--- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/arch/sh/include/asm/pgtable_32.h b/arch/

[PATCH mm-unstable RFC 19/26] riscv/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
pe in __swp_entry(). Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Signed-off-by: David Hildenbrand --- arch/riscv/include/asm/pgtable-bits.h | 3 +++ arch/riscv/include/asm/pgtable.h | 29 ++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/arch/

[PATCH mm-unstable RFC 17/26] powerpc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on 32bit book3s

2022-12-06 Thread David Hildenbrand
cannot be used, and reusing it avoids having to steal one bit from the swap offset. While at it, mask the type in __swp_entry(). Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Signed-off-by: David Hildenbrand --- arch/powerpc/include/asm/book3s/32/pgtable.h | 38 +

[PATCH mm-unstable RFC 18/26] powerpc/nohash/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
Signed-off-by: David Hildenbrand --- arch/powerpc/include/asm/nohash/32/pgtable.h | 22 + arch/powerpc/include/asm/nohash/32/pte-40x.h | 6 ++--- arch/powerpc/include/asm/nohash/32/pte-44x.h | 18 -- arch/powerpc/include/asm/nohash/32/pte-85xx.h | 4 ++-- arch/powe

[PATCH mm-unstable RFC 16/26] parisc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
bit avoids having to steal one bit from the swap offset. Cc: "James E.J. Bottomley" Cc: Helge Deller Signed-off-by: David Hildenbrand --- arch/parisc/include/asm/pgtable.h | 41 --- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/arch/parisc/i

[PATCH mm-unstable RFC 15/26] openrisc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
d-off-by: David Hildenbrand --- arch/openrisc/include/asm/pgtable.h | 41 + 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/arch/openrisc/include/asm/pgtable.h b/arch/openrisc/include/asm/pgtable.h index 6477c17b3062..903b32d662ab 100644 --- a/arch/ope

[PATCH mm-unstable RFC 14/26] nios2/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by using the yet-unused bit 31. Cc: Thomas Bogendoerfer Signed-off-by: David Hildenbrand --- arch/nios2/include/asm/pgtable-bits.h | 3 +++ arch/nios2/include/asm/pgtable.h | 22 +- 2 files changed, 24 insertions(

[PATCH mm-unstable RFC 13/26] nios2/mm: refactor swap PTE layout

2022-12-06 Thread David Hildenbrand
ts for the swap type and document the layout. Bits 26--31 should get ignored by hardware completely, so they can be used. Cc: Dinh Nguyen Signed-off-by: David Hildenbrand --- arch/nios2/include/asm/pgtable.h | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/

[PATCH mm-unstable RFC 12/26] mips/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
confusing, document it a bit better. While at it, mask the type in __swp_entry()/mk_swap_pte(). Cc: Thomas Bogendoerfer Signed-off-by: David Hildenbrand --- arch/mips/include/asm/pgtable-32.h | 86 ++ arch/mips/include/asm/pgtable-64.h | 23 ++-- arch/mips/include/asm

[PATCH mm-unstable RFC 11/26] microblaze/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
out a little bit harder to decipher. While at it, drop the comment from paulus---copy-and-paste leftover from powerpc where we actually have _PAGE_HASHPTE---and mask the type in __swp_entry_to_pte() as well. Cc: Michal Simek Signed-off-by: David Hildenbrand --- arch/m68k/include/asm/mcf_pgtable.h

[PATCH mm-unstable RFC 10/26] m68k/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
mask the type in __swp_entry(). Cc: Geert Uytterhoeven Cc: Greg Ungerer Signed-off-by: David Hildenbrand --- arch/m68k/include/asm/mcf_pgtable.h | 36 -- arch/m68k/include/asm/motorola_pgtable.h | 38 +-- arch/m68k/include/asm/sun3_pgtable.h

[PATCH mm-unstable RFC 08/26] loongarch/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
PMDs and could also be used in swap PMD context later. Cc: Huacai Chen Cc: WANG Xuerui Signed-off-by: David Hildenbrand --- arch/loongarch/include/asm/pgtable-bits.h | 4 +++ arch/loongarch/include/asm/pgtable.h | 39 --- 2 files changed, 39 insertions(+), 4 dele

[PATCH mm-unstable RFC 09/26] m68k/mm: remove dummy __swp definitions for nommu

2022-12-06 Thread David Hildenbrand
The definitions are not required, let's remove them. Cc: Geert Uytterhoeven Cc: Greg Ungerer Signed-off-by: David Hildenbrand --- arch/m68k/include/asm/pgtable_no.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/includ

[PATCH mm-unstable RFC 07/26] ia64/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by stealing one bit from the type. Generic MM currently only uses 5 bits for the type (MAX_SWAPFILES_SHIFT), so the stolen bit is effectively unused. While at it, also mask the type in __swp_entry(). Signed-off-by: David Hildenbrand --- arch

[PATCH mm-unstable RFC 06/26] hexagon/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by stealing one bit from the offset. This reduces the maximum swap space per file to 16 GiB (was 32 GiB). While at it, mask the type in __swp_entry(). Cc: Brian Cain Signed-off-by: David Hildenbrand --- arch/hexagon/include/asm/pgtable.h

[PATCH mm-unstable RFC 05/26] csky/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
esent(), pte_none() and HW happy. For now, let's keep it simple because there might be something non-obvious. Cc: Guo Ren Signed-off-by: David Hildenbrand --- arch/csky/abiv1/inc/abi/pgtable-bits.h | 13 + arch/csky/abiv2/inc/abi/pgtable-bits.h | 19 --- arch/csky/i

[PATCH mm-unstable RFC 04/26] arm/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
with "Linux PTEs" not "hardware PTEs". Also, properly mask the type in __swp_entry(). Cc: Russell King Signed-off-by: David Hildenbrand --- arch/arm/include/asm/pgtable-2level.h | 3 +++ arch/arm/include/asm/pgtable-3level.h | 3 +++ arch/arm/include/

[PATCH mm-unstable RFC 03/26] arc/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by using bit 5, which is yet unused. The only important parts seems to be to not use _PAGE_PRESENT (bit 9). Cc: Vineet Gupta Signed-off-by: David Hildenbrand --- arch/arc/include/asm/pgtable-bits-arcv2.h | 27 --- 1 file ch

[PATCH mm-unstable RFC 02/26] alpha/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

2022-12-06 Thread David Hildenbrand
only 32bit swap entries. So the lower 32bit are zero in a swap PTE and we could have taken a bit in there as well. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Signed-off-by: David Hildenbrand --- arch/alpha/include/asm/pgtable.h | 41 1 file change

[PATCH mm-unstable RFC 01/26] mm/debug_vm_pgtable: more pte_swp_exclusive() sanity checks

2022-12-06 Thread David Hildenbrand
when the swap PTE layout differs heavily from ordinary PTEs. Let's properly construct a swap PTE from swap type+offset. Signed-off-by: David Hildenbrand --- mm/debug_vm_pgtable.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/mm/debug_vm_p

[PATCH mm-unstable RFC 00/26] mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE on all architectures with swap PTEs

2022-12-06 Thread David Hildenbrand
.com/aarcange/kernel-testcases-for-v5.11/-/blob/main/page_count_do_wp_page-swap.c [3] https://gitlab.com/davidhildenbrand/scratchspace/-/blob/main/test_swp_exclusive.c David Hildenbrand (26): mm/debug_vm_pgtable: more pte_swp_exclusive() sanity checks alpha/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSI

Re: [PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage

2022-11-29 Thread David Hildenbrand
On 29.11.22 10:08, Hans Verkuil wrote: On 29/11/2022 09:48, David Hildenbrand wrote: On 28.11.22 23:59, Andrew Morton wrote: On Mon, 28 Nov 2022 09:18:47 +0100 David Hildenbrand wrote: Less chances of things going wrong that way. Just mention in the v2 cover letter that the first patch was

Re: [PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage

2022-11-29 Thread David Hildenbrand
On 28.11.22 23:59, Andrew Morton wrote: On Mon, 28 Nov 2022 09:18:47 +0100 David Hildenbrand wrote: Less chances of things going wrong that way. Just mention in the v2 cover letter that the first patch was added to make it easy to backport that fix without being hampered by merge conflicts

Re: [PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage

2022-11-28 Thread David Hildenbrand
On 28.11.22 09:17, Hans Verkuil wrote: Hi David, On 27/11/2022 11:35, David Hildenbrand wrote: On 16.11.22 11:26, David Hildenbrand wrote: FOLL_FORCE is really only for ptrace access. According to commit 707947247e95 ("media: videobuf2-vmalloc: get_userptr: buffers are always wri

Re: [PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage

2022-11-27 Thread David Hildenbrand
On 16.11.22 11:26, David Hildenbrand wrote: FOLL_FORCE is really only for ptrace access. According to commit 707947247e95 ("media: videobuf2-vmalloc: get_userptr: buffers are always writable"), get_vaddr_frames() currently pins all pages writable as a workaround for issues with read-on

Re: [PATCH mm-unstable v1 20/20] mm: rename FOLL_FORCE to FOLL_PTRACE

2022-11-16 Thread David Hildenbrand
On 16.11.22 19:16, Linus Torvalds wrote: On Wed, Nov 16, 2022 at 2:30 AM David Hildenbrand wrote: Let's make it clearer that functionality provided by FOLL_FORCE is really only for ptrace access. I'm not super-happy about this one. I do understand the "let's rename th

[PATCH mm-unstable v1 20/20] mm: rename FOLL_FORCE to FOLL_PTRACE

2022-11-16 Thread David Hildenbrand
Cc: Eric Biederman Cc: Kees Cook Cc: Alexander Viro Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Mike Kravetz Cc: Muchun Song Cc: Kentaro Takeda Cc: Tetsuo Handa Cc: Paul Moore Cc: James Morris Cc: &

[PATCH mm-unstable v1 19/20] habanalabs: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
y Cc: Oded Gabbay Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: David Hildenbrand --- drivers/misc/habanalabs/common/memory.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/habanalabs/common/memory.c b/drivers/misc/habanalabs/common/memory.c

[PATCH mm-unstable v1 18/20] RDMA/hw/qib/qib_user_pages: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
e Cc: Leon Romanovsky Signed-off-by: David Hildenbrand --- drivers/infiniband/hw/qib/qib_user_pages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/qib/qib_user_pages.c b/drivers/infiniband/hw/qib/qib_user_pages.c index f4b5f05058e4..f693bc753b6b 100644

[PATCH mm-unstable v1 17/20] drm/exynos: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
Park Cc: David Airlie Cc: Daniel Vetter Cc: Krzysztof Kozlowski Signed-off-by: David Hildenbrand --- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c

[PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
Cc: Marek Szyprowski Cc: Tomasz Figa Cc: Marek Szyprowski Cc: Mauro Carvalho Chehab Signed-off-by: David Hildenbrand --- drivers/media/common/videobuf2/frame_vector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/common/videobuf2/frame_vector.c b/drive

[PATCH mm-unstable v1 15/20] media: pci/ivtv: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
Most probably, FOLL_FORCE usage is just some legacy leftover. Cc: Andy Walls Cc: Mauro Carvalho Chehab Signed-off-by: David Hildenbrand --- drivers/media/pci/ivtv/ivtv-udma.c | 2 +- drivers/media/pci/ivtv/ivtv-yuv.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dr

[PATCH mm-unstable v1 14/20] drm/etnaviv: remove FOLL_FORCE usage

2022-11-16 Thread David Hildenbrand
t. So stop using FOLL_FORCE, which is really only for ptrace access. Cc: Daniel Vetter Cc: Lucas Stach Cc: Russell King Cc: Christian Gmeiner Cc: David Airlie Signed-off-by: David Hildenbrand --- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-)

  1   2   >