[PATCH 0/5] page-vary: Build set_preferred_target_page_bits() as common code

Philippe Mathieu-Daudé posted 5 patches 1 month, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260213182713.44924-1-philmd@linaro.org
Maintainers: Pierrick Bouvier <pierrick.bouvier@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>
include/exec/page-vary.h          | 15 ++++++++++++++-
include/qemu/target-info-impl.h   |  2 ++
include/qemu/target-info.h        |  7 +++++++
configs/targets/aarch64-softmmu.c |  1 +
configs/targets/arm-softmmu.c     |  1 +
page-vary-common.c                | 29 ++++++++++++++++++-----------
page-vary-target.c                | 25 -------------------------
target-info-stub.c                |  5 +++++
target-info.c                     |  5 +++++
9 files changed, 53 insertions(+), 37 deletions(-)
[PATCH 0/5] page-vary: Build set_preferred_target_page_bits() as common code
Posted by Philippe Mathieu-Daudé 1 month, 3 weeks ago
Allow common code check TARGET_PAGE_BITS_VARY at runtime
via the target_page_bits_vary() helper, then use that
in set_preferred_target_page_bits() in order to build this
method once as common code.

Philippe Mathieu-Daudé (5):
  qemu/target_info: Add target_page_bits_vary() helper
  page-vary: Expose TARGET_PAGE_BITS_MIN definition
  page-vary: Use target_page_bits_vary in set_preferred_target_page_bits
  page-vary: Build set_preferred_target_page_bits() as common code
  page-vary: Inline set_preferred_target_page_bits_common()

 include/exec/page-vary.h          | 15 ++++++++++++++-
 include/qemu/target-info-impl.h   |  2 ++
 include/qemu/target-info.h        |  7 +++++++
 configs/targets/aarch64-softmmu.c |  1 +
 configs/targets/arm-softmmu.c     |  1 +
 page-vary-common.c                | 29 ++++++++++++++++++-----------
 page-vary-target.c                | 25 -------------------------
 target-info-stub.c                |  5 +++++
 target-info.c                     |  5 +++++
 9 files changed, 53 insertions(+), 37 deletions(-)

-- 
2.52.0


Re: [PATCH 0/5] page-vary: Build set_preferred_target_page_bits() as common code
Posted by Richard Henderson 1 month, 3 weeks ago
On 2/14/26 04:27, Philippe Mathieu-Daudé wrote:
> Allow common code check TARGET_PAGE_BITS_VARY at runtime
> via the target_page_bits_vary() helper, then use that
> in set_preferred_target_page_bits() in order to build this
> method once as common code.
> 
> Philippe Mathieu-Daudé (5):
>    qemu/target_info: Add target_page_bits_vary() helper
>    page-vary: Expose TARGET_PAGE_BITS_MIN definition
>    page-vary: Use target_page_bits_vary in set_preferred_target_page_bits
>    page-vary: Build set_preferred_target_page_bits() as common code
>    page-vary: Inline set_preferred_target_page_bits_common()
> 
>   include/exec/page-vary.h          | 15 ++++++++++++++-
>   include/qemu/target-info-impl.h   |  2 ++
>   include/qemu/target-info.h        |  7 +++++++
>   configs/targets/aarch64-softmmu.c |  1 +
>   configs/targets/arm-softmmu.c     |  1 +
>   page-vary-common.c                | 29 ++++++++++++++++++-----------
>   page-vary-target.c                | 25 -------------------------
>   target-info-stub.c                |  5 +++++
>   target-info.c                     |  5 +++++
>   9 files changed, 53 insertions(+), 37 deletions(-)
> 

This patch set moves code from page-vary-target.c to page-vary-common.c, based on the new 
target_info hook.  But since TARGET_PAGE_BITS_VARY is still used, I don't see the point.


r~

Re: [PATCH 0/5] page-vary: Build set_preferred_target_page_bits() as common code
Posted by Philippe Mathieu-Daudé 1 month, 3 weeks ago
On 16/2/26 08:27, Richard Henderson wrote:
> On 2/14/26 04:27, Philippe Mathieu-Daudé wrote:
>> Allow common code check TARGET_PAGE_BITS_VARY at runtime
>> via the target_page_bits_vary() helper, then use that
>> in set_preferred_target_page_bits() in order to build this
>> method once as common code.
>>
>> Philippe Mathieu-Daudé (5):
>>    qemu/target_info: Add target_page_bits_vary() helper
>>    page-vary: Expose TARGET_PAGE_BITS_MIN definition
>>    page-vary: Use target_page_bits_vary in set_preferred_target_page_bits
>>    page-vary: Build set_preferred_target_page_bits() as common code
>>    page-vary: Inline set_preferred_target_page_bits_common()
>>
>>   include/exec/page-vary.h          | 15 ++++++++++++++-
>>   include/qemu/target-info-impl.h   |  2 ++
>>   include/qemu/target-info.h        |  7 +++++++
>>   configs/targets/aarch64-softmmu.c |  1 +
>>   configs/targets/arm-softmmu.c     |  1 +
>>   page-vary-common.c                | 29 ++++++++++++++++++-----------
>>   page-vary-target.c                | 25 -------------------------
>>   target-info-stub.c                |  5 +++++
>>   target-info.c                     |  5 +++++
>>   9 files changed, 53 insertions(+), 37 deletions(-)
>>
> 
> This patch set moves code from page-vary-target.c to page-vary-common.c, 
> based on the new target_info hook.  But since TARGET_PAGE_BITS_VARY is 
> still used, I don't see the point.

The set_preferred_target_page_bits() symbol is removed from the
per-target clash symbol list. One step at a time?

I followed removing TARGET_PAGE_BITS_LEGACY, removing the use of
TARGET_PAGE_BITS_VARY in common code, but I still haven't fully
understood Peter's comments on my previous question, and am still
processing it before posting the rest:
https://lore.kernel.org/qemu-devel/CAFEAcA9D3Wx2w7i2X93uX1H3GtrqdVKtGidG309XLb=AdGVOOA@mail.gmail.com/


Re: [PATCH 0/5] page-vary: Build set_preferred_target_page_bits() as common code
Posted by Richard Henderson 1 month, 3 weeks ago
On 2/17/26 03:17, Philippe Mathieu-Daudé wrote:
> On 16/2/26 08:27, Richard Henderson wrote:
>> On 2/14/26 04:27, Philippe Mathieu-Daudé wrote:
>>> Allow common code check TARGET_PAGE_BITS_VARY at runtime
>>> via the target_page_bits_vary() helper, then use that
>>> in set_preferred_target_page_bits() in order to build this
>>> method once as common code.
>>>
>>> Philippe Mathieu-Daudé (5):
>>>    qemu/target_info: Add target_page_bits_vary() helper
>>>    page-vary: Expose TARGET_PAGE_BITS_MIN definition
>>>    page-vary: Use target_page_bits_vary in set_preferred_target_page_bits
>>>    page-vary: Build set_preferred_target_page_bits() as common code
>>>    page-vary: Inline set_preferred_target_page_bits_common()
>>>
>>>   include/exec/page-vary.h          | 15 ++++++++++++++-
>>>   include/qemu/target-info-impl.h   |  2 ++
>>>   include/qemu/target-info.h        |  7 +++++++
>>>   configs/targets/aarch64-softmmu.c |  1 +
>>>   configs/targets/arm-softmmu.c     |  1 +
>>>   page-vary-common.c                | 29 ++++++++++++++++++-----------
>>>   page-vary-target.c                | 25 -------------------------
>>>   target-info-stub.c                |  5 +++++
>>>   target-info.c                     |  5 +++++
>>>   9 files changed, 53 insertions(+), 37 deletions(-)
>>>
>>
>> This patch set moves code from page-vary-target.c to page-vary-common.c, based on the 
>> new target_info hook.  But since TARGET_PAGE_BITS_VARY is still used, I don't see the 
>> point.
> 
> The set_preferred_target_page_bits() symbol is removed from the
> per-target clash symbol list. One step at a time?

Ok, so, making set_preferred_target_page_bits is the goal.
I now see that you even stated that above, but I missed it.

I'll give this another think.


r~