Re: [PATCH RFC v2 19/27] mm: mprotect: Introduce PAGE_FAULT_ON_ACCESS for mprotect(PROT_MTE)

2023-11-30 Thread David Hildenbrand
On 30.11.23 15:33, Alexandru Elisei wrote: On Thu, Nov 30, 2023 at 02:43:48PM +0100, David Hildenbrand wrote: On 30.11.23 14:32, Alexandru Elisei wrote: Hi, On Thu, Nov 30, 2023 at 01:49:34PM +0100, David Hildenbrand wrote: + +out_retry: + put_page(page); + if (vmf->flags &

Re: [PATCH RFC v2 19/27] mm: mprotect: Introduce PAGE_FAULT_ON_ACCESS for mprotect(PROT_MTE)

2023-11-30 Thread David Hildenbrand
On 30.11.23 14:32, Alexandru Elisei wrote: Hi, On Thu, Nov 30, 2023 at 01:49:34PM +0100, David Hildenbrand wrote: + +out_retry: + put_page(page); + if (vmf->flags & FAULT_FLAG_VMA_LOCK) + vma_end_read(vma); + if (fault_flag_allow_retry_first(vmf->flags)) { +

Re: [PATCH RFC v2 19/27] mm: mprotect: Introduce PAGE_FAULT_ON_ACCESS for mprotect(PROT_MTE)

2023-11-30 Thread Alexandru Elisei
Hi, On Thu, Nov 30, 2023 at 01:49:34PM +0100, David Hildenbrand wrote: > > > > + > > > > +out_retry: > > > > + put_page(page); > > > > + if (vmf->flags & FAULT_FLAG_VMA_LOCK) > > > > + vma_end_read(vma); > > > > + if (fault_flag_allow_retry_first(vmf->flags)) { > >

Re: [PATCH RFC v2 19/27] mm: mprotect: Introduce PAGE_FAULT_ON_ACCESS for mprotect(PROT_MTE)

2023-11-30 Thread Alexandru Elisei
Hi, On Wed, Nov 29, 2023 at 06:27:25PM +0900, Hyesoo Yu wrote: > On Sun, Nov 19, 2023 at 04:57:13PM +, Alexandru Elisei wrote: > > To enable tagging on a memory range, userspace can use mprotect() with the > > PROT_MTE access flag. Pages already mapped in the VMA don't have the > > associated

Re: [PATCH RFC v2 19/27] mm: mprotect: Introduce PAGE_FAULT_ON_ACCESS for mprotect(PROT_MTE)

2023-11-29 Thread Alexandru Elisei
Hi, On Tue, Nov 28, 2023 at 06:55:18PM +0100, David Hildenbrand wrote: > On 19.11.23 17:57, Alexandru Elisei wrote: > > To enable tagging on a memory range, userspace can use mprotect() with the > > PROT_MTE access flag. Pages already mapped in the VMA don't have the > > associated tag storage

Re: [PATCH RFC v2 19/27] mm: mprotect: Introduce PAGE_FAULT_ON_ACCESS for mprotect(PROT_MTE)

2023-11-29 Thread Hyesoo Yu
On Sun, Nov 19, 2023 at 04:57:13PM +, Alexandru Elisei wrote: > To enable tagging on a memory range, userspace can use mprotect() with the > PROT_MTE access flag. Pages already mapped in the VMA don't have the > associated tag storage block reserved, so mark the PTEs as > PAGE_FAULT_ON_ACCESS

Re: [PATCH RFC v2 19/27] mm: mprotect: Introduce PAGE_FAULT_ON_ACCESS for mprotect(PROT_MTE)

2023-11-28 Thread David Hildenbrand
On 28.11.23 18:55, David Hildenbrand wrote: On 19.11.23 17:57, Alexandru Elisei wrote: To enable tagging on a memory range, userspace can use mprotect() with the PROT_MTE access flag. Pages already mapped in the VMA don't have the associated tag storage block reserved, so mark the PTEs as

Re: [PATCH RFC v2 19/27] mm: mprotect: Introduce PAGE_FAULT_ON_ACCESS for mprotect(PROT_MTE)

2023-11-28 Thread David Hildenbrand
On 19.11.23 17:57, Alexandru Elisei wrote: To enable tagging on a memory range, userspace can use mprotect() with the PROT_MTE access flag. Pages already mapped in the VMA don't have the associated tag storage block reserved, so mark the PTEs as PAGE_FAULT_ON_ACCESS to trigger a fault next time

[PATCH RFC v2 19/27] mm: mprotect: Introduce PAGE_FAULT_ON_ACCESS for mprotect(PROT_MTE)

2023-11-19 Thread Alexandru Elisei
To enable tagging on a memory range, userspace can use mprotect() with the PROT_MTE access flag. Pages already mapped in the VMA don't have the associated tag storage block reserved, so mark the PTEs as PAGE_FAULT_ON_ACCESS to trigger a fault next time they are accessed, and reserve the tag