[PATCH 0/9] system/memory: Mark ld/st_phys() API as legacy

Philippe Mathieu-Daudé posted 9 patches 1 month, 2 weeks ago
Failed in applying to current master (apply log)
Maintainers: "Philippe Mathieu-Daudé" <philmd@linaro.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, "Cédric Le Goater" <clg@kaod.org>, Peter Maydell <peter.maydell@linaro.org>, Steven Lee <steven_lee@aspeedtech.com>, Troy Lee <leetroy@gmail.com>, Jamin Lin <jamin_lin@aspeedtech.com>, Andrew Jeffery <andrew@codeconstruct.com.au>, Joel Stanley <joel@jms.id.au>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Peter Xu <peterx@redhat.com>, David Hildenbrand <david@kernel.org>, Zhao Liu <zhao1.liu@intel.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>
configs/targets/avr-softmmu.mak          |   1 +
configs/targets/microblaze-softmmu.mak   |   1 +
configs/targets/microblazeel-softmmu.mak |   1 +
configs/targets/mips-softmmu.mak         |   1 +
configs/targets/mips64-softmmu.mak       |   1 +
configs/targets/mips64el-softmmu.mak     |   1 +
configs/targets/mipsel-softmmu.mak       |   1 +
configs/targets/or1k-softmmu.mak         |   1 +
configs/targets/riscv32-softmmu.mak      |   1 +
configs/targets/riscv64-softmmu.mak      |   1 +
configs/targets/rx-softmmu.mak           |   1 +
configs/targets/sh4-softmmu.mak          |   1 +
configs/targets/sh4eb-softmmu.mak        |   1 +
configs/targets/sparc64-softmmu.mak      |   1 +
configs/targets/tricore-softmmu.mak      |   1 +
configs/targets/xtensa-softmmu.mak       |   1 +
configs/targets/xtensaeb-softmmu.mak     |   1 +
include/hw/virtio/virtio-access.h        | 106 -----------------------
include/system/memory.h                  |   8 +-
target/i386/cpu.h                        |   1 -
include/exec/memory_ldst.h.inc           |   2 -
hw/arm/aspeed.c                          |   4 +-
hw/arm/boot.c                            |   8 +-
hw/virtio/virtio.c                       |  21 +++++
target/i386/helper.c                     |  10 ---
target/sparc/mmu_helper.c                |   2 +-
system/memory_ldst.c.inc                 |  39 ---------
scripts/make-config-poison.sh            |   1 +
28 files changed, 48 insertions(+), 171 deletions(-)
[PATCH 0/9] system/memory: Mark ld/st_phys() API as legacy
Posted by Philippe Mathieu-Daudé 1 month, 2 weeks ago
When using the ld/st_phys() API, when an access fail,
no error is reported. Because if that we introduced
the address_space_ld/st() API 10 years ago. There are
few uses of the ld/st_phys() API left in the code base,
time to mark it as legacy.
Allow targets to opt-out for the legacy API, by setting
the TARGET_NOT_USING_LEGACY_LDST_PHYS_API definition.

First drop the _notdirty() variant, mark some targets
clean of the legacy API, then rework virtio core layer
a bit in order to clean more targets.

Targets left missing conversion:

 $ fgrep -L TARGET_NOT_USING_LEGACY_LDST_PHYS_API configs/targets/*softmmu*mak
 configs/targets/aarch64-softmmu.mak
 configs/targets/alpha-softmmu.mak
 configs/targets/arm-softmmu.mak
 configs/targets/hppa-softmmu.mak
 configs/targets/i386-softmmu.mak
 configs/targets/loongarch64-softmmu.mak
 configs/targets/m68k-softmmu.mak
 configs/targets/ppc-softmmu.mak
 configs/targets/ppc64-softmmu.mak
 configs/targets/s390x-softmmu.mak
 configs/targets/sparc-softmmu.mak
 configs/targets/x86_64-softmmu.mak

tag: https://gitlab.com/philmd/qemu/-/tags/legacy_ldst_phys-v1
CI: https://gitlab.com/philmd/qemu/-/pipelines/2231223066

Philippe Mathieu-Daudé (9):
  target/i386: Remove x86_stl_phys_notdirty() leftover
  target/sparc: Update MMU page table using stl_phys()
  hw/arm: Avoid address_space_stl_notdirty() when generating bootloader
  system/memory: Remove address_space_stl_notdirty and stl_phys_notdirty
  system/memory: Allow restricting legacy ldst_phys() API usage
  configs/targets: Mark targets not using legacy ldst_phys() API
  hw/virtio: Remove unused ldst_phys() helpers
  hw/virtio: Reduce virtio_lduw/stw_phys_cached() scope
  configs/targets: Mark targets not using legacy ldst_phys() API

 configs/targets/avr-softmmu.mak          |   1 +
 configs/targets/microblaze-softmmu.mak   |   1 +
 configs/targets/microblazeel-softmmu.mak |   1 +
 configs/targets/mips-softmmu.mak         |   1 +
 configs/targets/mips64-softmmu.mak       |   1 +
 configs/targets/mips64el-softmmu.mak     |   1 +
 configs/targets/mipsel-softmmu.mak       |   1 +
 configs/targets/or1k-softmmu.mak         |   1 +
 configs/targets/riscv32-softmmu.mak      |   1 +
 configs/targets/riscv64-softmmu.mak      |   1 +
 configs/targets/rx-softmmu.mak           |   1 +
 configs/targets/sh4-softmmu.mak          |   1 +
 configs/targets/sh4eb-softmmu.mak        |   1 +
 configs/targets/sparc64-softmmu.mak      |   1 +
 configs/targets/tricore-softmmu.mak      |   1 +
 configs/targets/xtensa-softmmu.mak       |   1 +
 configs/targets/xtensaeb-softmmu.mak     |   1 +
 include/hw/virtio/virtio-access.h        | 106 -----------------------
 include/system/memory.h                  |   8 +-
 target/i386/cpu.h                        |   1 -
 include/exec/memory_ldst.h.inc           |   2 -
 hw/arm/aspeed.c                          |   4 +-
 hw/arm/boot.c                            |   8 +-
 hw/virtio/virtio.c                       |  21 +++++
 target/i386/helper.c                     |  10 ---
 target/sparc/mmu_helper.c                |   2 +-
 system/memory_ldst.c.inc                 |  39 ---------
 scripts/make-config-poison.sh            |   1 +
 28 files changed, 48 insertions(+), 171 deletions(-)

-- 
2.52.0


Re: [PATCH 0/9] system/memory: Mark ld/st_phys() API as legacy
Posted by Philippe Mathieu-Daudé 1 month, 1 week ago
On 24/12/25 16:13, Philippe Mathieu-Daudé wrote:

> Philippe Mathieu-Daudé (9):
>    target/i386: Remove x86_stl_phys_notdirty() leftover
>    target/sparc: Update MMU page table using stl_phys()
>    hw/arm: Avoid address_space_stl_notdirty() when generating bootloader
>    system/memory: Remove address_space_stl_notdirty and stl_phys_notdirty
>    system/memory: Allow restricting legacy ldst_phys() API usage
>    configs/targets: Mark targets not using legacy ldst_phys() API
>    hw/virtio: Remove unused ldst_phys() helpers
>    hw/virtio: Reduce virtio_lduw/stw_phys_cached() scope
>    configs/targets: Mark targets not using legacy ldst_phys() API

Series queued, thanks.