[PULL 0/2] Linux user for v11 patches

Helge Deller posted 2 patches 3 weeks, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260313183009.34221-1-deller@kernel.org
Maintainers: Laurent Vivier <laurent@vivier.eu>, Pierrick Bouvier <pierrick.bouvier@linaro.org>
There is a newer version of this series
linux-user/elfload.c | 37 +++++++++++++++++++------------
linux-user/mmap.c    | 52 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 75 insertions(+), 14 deletions(-)
[PULL 0/2] Linux user for v11 patches
Posted by Helge Deller 3 weeks, 3 days ago
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
Re: [PULL 0/2] Linux user for v11 patches
Posted by Michael Tokarev 3 weeks ago
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
Re: [PULL 0/2] Linux user for v11 patches
Posted by Helge Deller 3 weeks ago
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
Re: [PULL 0/2] Linux user for v11 patches
Posted by Michael Tokarev 2 weeks ago
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

Re: [PULL 0/2] Linux user for v11 patches
Posted by Richard Henderson 2 weeks ago
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~

Re: [PULL 0/2] Linux user for v11 patches
Posted by Michael Tokarev 2 weeks ago
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

Re: [PULL 0/2] Linux user for v11 patches
Posted by Helge Deller 1 week, 6 days ago
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
Re: [PULL 0/2] Linux user for v11 patches
Posted by Michael Tokarev 1 week, 6 days ago
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

Re: [PULL 0/2] Linux user for v11 patches
Posted by Peter Maydell 3 weeks ago
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