linux-user/elfload.c | 37 +++++++++++++++++++------------ linux-user/mmap.c | 52 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 14 deletions(-)
From: Helge Deller <deller@gmx.de> The following changes since commit 1fd5ff9d76d23ab23a68419cbc76d5ee33e8b455: Merge tag 'for-upstream' of https://gitlab.com/kmwolf/qemu into staging (2026-03-10 16:29:24 +0000) are available in the Git repository at: https://github.com/hdeller/qemu-hppa.git tags/linux-user-for-v11-pull-request for you to fetch changes up to 5e5b278d2b1b81fc2b5ca09dba4848f81cd3a718: linux-user: fix mremap with old_size=0 for shared mappings (2026-03-12 21:03:48 +0100) ---------------------------------------------------------------- Two linux-user patches Two linux-user patches from Razvan Ghiorghe. ---------------------------------------------------------------- Razvan Ghiorghe (2): linux-user: Fix zero_bss for RX PT_LOAD segments linux-user: fix mremap with old_size=0 for shared mappings linux-user/elfload.c | 37 +++++++++++++++++++------------ linux-user/mmap.c | 52 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 14 deletions(-) -- 2.53.0
On 13.03.2026 21:30, Helge Deller wrote: > Razvan Ghiorghe (2): > linux-user: Fix zero_bss for RX PT_LOAD segments > linux-user: fix mremap with old_size=0 for shared mappings This looks like qemu-stable material, is it not? Thanks, /mjt
On 3/16/26 14:43, Michael Tokarev wrote: > On 13.03.2026 21:30, Helge Deller wrote: > >> Razvan Ghiorghe (2): >> linux-user: Fix zero_bss for RX PT_LOAD segments >> linux-user: fix mremap with old_size=0 for shared mappings > > This looks like qemu-stable material, is it not? Yes. Thanks! Helge
On 16.03.2026 20:00, Helge Deller wrote: > On 3/16/26 14:43, Michael Tokarev wrote: >> On 13.03.2026 21:30, Helge Deller wrote: >> >>> Razvan Ghiorghe (2): >>> linux-user: Fix zero_bss for RX PT_LOAD segments >>> linux-user: fix mremap with old_size=0 for shared mappings >> >> This looks like qemu-stable material, is it not? > > Yes. ..with one caveat: mremap with old_size=0 fix doesn't apply to 10.0, the current LTS stable series, because 10.0.x doesn't have f55fc1c092 "accel/tcg: Add clear_flags argument to page_set_flags", because of this: + page_set_flags(new_addr, new_addr + new_size - 1, + prot | PAGE_VALID, PAGE_VALID); What would be the correct construct for this for 10.0.x? (Adding rth to Cc list). Thanks! /mjt
On 3/23/26 17:52, Michael Tokarev wrote:
> On 16.03.2026 20:00, Helge Deller wrote:
>> On 3/16/26 14:43, Michael Tokarev wrote:
>>> On 13.03.2026 21:30, Helge Deller wrote:
>>>
>>>> Razvan Ghiorghe (2):
>>>> linux-user: Fix zero_bss for RX PT_LOAD segments
>>>> linux-user: fix mremap with old_size=0 for shared mappings
>>>
>>> This looks like qemu-stable material, is it not?
>>
>> Yes.
>
> ..with one caveat: mremap with old_size=0 fix doesn't apply to 10.0,
> the current LTS stable series, because 10.0.x doesn't have f55fc1c092
> "accel/tcg: Add clear_flags argument to page_set_flags", because of this:
>
> + page_set_flags(new_addr, new_addr + new_size - 1,
> + prot | PAGE_VALID, PAGE_VALID);
>
> What would be the correct construct for this for 10.0.x?
> (Adding rth to Cc list).
Probably
page_set_flags(new_addr, new_addr + new_size - 1,
prot | PAGE_VALID | PAGE_RESET);
r~
On 24.03.2026 01:53, Richard Henderson wrote: > On 3/23/26 17:52, Michael Tokarev wrote: >> On 16.03.2026 20:00, Helge Deller wrote: >>> On 3/16/26 14:43, Michael Tokarev wrote: >>>> On 13.03.2026 21:30, Helge Deller wrote: >>>> >>>>> Razvan Ghiorghe (2): >>>>> linux-user: Fix zero_bss for RX PT_LOAD segments >>>>> linux-user: fix mremap with old_size=0 for shared mappings >>>> >>>> This looks like qemu-stable material, is it not? >>> >>> Yes. >> >> ..with one caveat: mremap with old_size=0 fix doesn't apply to 10.0, >> the current LTS stable series, because 10.0.x doesn't have f55fc1c092 >> "accel/tcg: Add clear_flags argument to page_set_flags", because of this: >> >> + page_set_flags(new_addr, new_addr + new_size - 1, >> + prot | PAGE_VALID, PAGE_VALID); >> >> What would be the correct construct for this for 10.0.x? >> (Adding rth to Cc list). > > Probably > > page_set_flags(new_addr, new_addr + new_size - 1, > prot | PAGE_VALID | PAGE_RESET); > Well, at least the testcase works with this version. Thank you! BTW, do we have another testcase for this scenario somewhere, like in LTP or something? Looking at linux test project I don't see this case covered. /mjt
Am 24.03.26 um 07:19 schrieb Michael Tokarev: > On 24.03.2026 01:53, Richard Henderson wrote: >> On 3/23/26 17:52, Michael Tokarev wrote: >>> On 16.03.2026 20:00, Helge Deller wrote: >>>> On 3/16/26 14:43, Michael Tokarev wrote: >>>>> On 13.03.2026 21:30, Helge Deller wrote: >>>>> >>>>>> Razvan Ghiorghe (2): >>>>>> linux-user: Fix zero_bss for RX PT_LOAD segments >>>>>> linux-user: fix mremap with old_size=0 for shared mappings >>>>> >>>>> This looks like qemu-stable material, is it not? >>>> >>>> Yes. >>> >>> ..with one caveat: mremap with old_size=0 fix doesn't apply to 10.0, >>> the current LTS stable series, because 10.0.x doesn't have f55fc1c092 >>> "accel/tcg: Add clear_flags argument to page_set_flags", because of >>> this: >>> >>> + page_set_flags(new_addr, new_addr + new_size - 1, >>> + prot | PAGE_VALID, PAGE_VALID); >>> >>> What would be the correct construct for this for 10.0.x? >>> (Adding rth to Cc list). >> >> Probably >> >> page_set_flags(new_addr, new_addr + new_size - 1, >> prot | PAGE_VALID | PAGE_RESET); >> > > Well, at least the testcase works with this version. Thank you! > > BTW, do we have another testcase for this scenario somewhere, > like in LTP or something? Looking at linux test project I don't > see this case covered. At least there is a reproducer here: https://gitlab.com/qemu-project/qemu/-/work_items/3105 Helge
On 24.03.2026 13:56, Helge Deller wrote: > Am 24.03.26 um 07:19 schrieb Michael Tokarev: >> On 24.03.2026 01:53, Richard Henderson wrote: >>> Probably >>> >>> page_set_flags(new_addr, new_addr + new_size - 1, >>> prot | PAGE_VALID | PAGE_RESET); >>> >> >> Well, at least the testcase works with this version. Thank you! >> >> BTW, do we have another testcase for this scenario somewhere, >> like in LTP or something? Looking at linux test project I don't >> see this case covered. > > At least there is a reproducer here: > > https://gitlab.com/qemu-project/qemu/-/work_items/3105 Yes, this is what I used to test the change, which I mentioned above as "testcase works". But it is a testcase for this particular corner case only, - there might be more mmap-from-zero testcases somewhere. But ok, that's enough for now. Thanks, /mjt
On Fri, 13 Mar 2026 at 18:31, Helge Deller <deller@kernel.org> wrote: > > From: Helge Deller <deller@gmx.de> > > The following changes since commit 1fd5ff9d76d23ab23a68419cbc76d5ee33e8b455: > > Merge tag 'for-upstream' of https://gitlab.com/kmwolf/qemu into staging (2026-03-10 16:29:24 +0000) > > are available in the Git repository at: > > https://github.com/hdeller/qemu-hppa.git tags/linux-user-for-v11-pull-request > > for you to fetch changes up to 5e5b278d2b1b81fc2b5ca09dba4848f81cd3a718: > > linux-user: fix mremap with old_size=0 for shared mappings (2026-03-12 21:03:48 +0100) > > ---------------------------------------------------------------- > Two linux-user patches > > Two linux-user patches from Razvan Ghiorghe. > Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/11.0 for any user-visible changes. -- PMM
© 2016 - 2026 Red Hat, Inc.