Re: [PATCH] Cygwin: mmap: allow remapping part of an existing anonymous, mapping

2025-01-15 Thread Corinna Vinschen
On Jan 13 17:36, Ken Brown wrote: > On 1/13/2025 6:00 AM, Corinna Vinschen wrote: > > On Jan 11 18:43, Ken Brown wrote: > > > Another question: Adding this array to mmap_record, we have two flexible > > > arrays in the class: one for page_map and one for the protection array. My > > > understanding

Re: [PATCH] Cygwin: mmap: allow remapping part of an existing anonymous, mapping

2025-01-13 Thread Ken Brown
On 1/13/2025 6:00 AM, Corinna Vinschen wrote: On Jan 11 18:43, Ken Brown wrote: Another question: Adding this array to mmap_record, we have two flexible arrays in the class: one for page_map and one for the protection array. My understanding is that a class or struct can have only one flexible a

Re: [PATCH] Cygwin: mmap: allow remapping part of an existing anonymous, mapping

2025-01-13 Thread Corinna Vinschen
On Jan 11 18:43, Ken Brown wrote: > On 1/8/2025 10:24 AM, Corinna Vinschen wrote: > > On Jan 7 21:27, Ken Brown wrote: > > > On 1/7/2025 3:18 PM, Corinna Vinschen wrote: > > > > - mmap_record::prot flag, should be an array of protection bits per page > > > > (POSIX page i e., 64K, not Windows

Re: [PATCH] Cygwin: mmap: allow remapping part of an existing anonymous, mapping

2025-01-11 Thread Ken Brown
On 1/8/2025 10:24 AM, Corinna Vinschen wrote: On Jan 7 21:27, Ken Brown wrote: On 1/7/2025 3:18 PM, Corinna Vinschen wrote: - mmap_record::prot flag, should be an array of protection bits per page (POSIX page i e., 64K, not Windows page). Question: Since it only takes 3 bits to store all

Re: [PATCH] Cygwin: mmap: allow remapping part of an existing anonymous, mapping

2025-01-08 Thread Corinna Vinschen
On Jan 7 21:27, Ken Brown wrote: > On 1/7/2025 3:18 PM, Corinna Vinschen wrote: > > - mmap_record::prot flag, should be an array of protection bits per page > >(POSIX page i e., 64K, not Windows page). > > Question: Since it only takes 3 bits to store all possible protections, do > you think

Re: [PATCH] Cygwin: mmap: allow remapping part of an existing anonymous, mapping

2025-01-07 Thread Ken Brown
On 1/7/2025 3:18 PM, Corinna Vinschen wrote: - mmap_record::prot flag, should be an array of protection bits per page (POSIX page i e., 64K, not Windows page). Question: Since it only takes 3 bits to store all possible protections, do you think it's worth the trouble to pack the protections

Re: [PATCH] Cygwin: mmap: allow remapping part of an existing anonymous, mapping

2025-01-07 Thread Ken Brown
Hi Corinna, On 1/7/2025 3:18 PM, Corinna Vinschen wrote: On Jan 2 16:42, Ken Brown wrote: diff --git a/winsup/cygwin/mm/mmap.cc b/winsup/cygwin/mm/mmap.cc index fc126a87072a..0224779458ef 100644 --- a/winsup/cygwin/mm/mmap.cc +++ b/winsup/cygwin/mm/mmap.cc @@ -494,18 +494,24 @@ mmap_record::ma

Re: [PATCH] Cygwin: mmap: allow remapping part of an existing anonymous, mapping

2025-01-07 Thread Corinna Vinschen
Hi Ken, On Jan 2 16:42, Ken Brown wrote: > From 625c77a82925185805ad57d5ef3f0d0d90dc9b57 Mon Sep 17 00:00:00 2001 > From: Ken Brown > Date: Fri, 27 Dec 2024 16:09:40 -0500 > Subject: [PATCH v2] Cygwin: mmap: allow remapping part of an existing > anonymous mapping > > Previously mmap with MAP_F

Re: [PATCH] Cygwin: mmap: allow remapping part of an existing anonymous, mapping

2025-01-02 Thread Ken Brown
On 12/28/2024 4:40 PM, Ken Brown wrote: Patch attached. I'm not sure I handled the noreserve case in the best possible way, but at least I didn't make it worse.  The behavior in that case after my patch is the same as before. Ken P.S. If no one has any comments in the next week or so, I mig

[PATCH] Cygwin: mmap: allow remapping part of an existing anonymous, mapping

2024-12-28 Thread Ken Brown
[PATCH] Cygwin: mmap: allow remapping part of an existing anonymous mapping Previously mmap would fail with EINVAL on an attempt to map an address range contained in the chunk of an existing mapping. With this commit, mmap will succeed, provided the mappings are anonymous, the MAP_SHARED/MAP_PRIV