[PATCH v6 00/18] system/memory: Clean ups around address_space_ldst() endian variants

Philippe Mathieu-Daudé posted 18 patches 2 weeks, 5 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260118193509.42923-1-philmd@linaro.org
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Ari Sundholm <ari@tuxera.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Xie Yongji <xieyongji@bytedance.com>, Coiby Xu <Coiby.Xu@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, "Denis V. Lunev" <den@openvz.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, John Snow <jsnow@redhat.com>, Pavel Pisa <pisa@cmp.felk.cvut.cz>, Francisco Iglesias <francisco.iglesias@amd.com>, Vikram Garhwal <vikram.garhwal@bytedance.com>, Jason Wang <jasowang@redhat.com>, Alistair Francis <alistair@alistair23.me>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Bin Meng <bmeng.cn@gmail.com>, Richard Henderson <richard.henderson@linaro.org>, Peter Xu <peterx@redhat.com>, Michael Roth <michael.roth@amd.com>, Kostiantyn Kostiuk <kkostiuk@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, "Cédric Le Goater" <clg@kaod.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>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>, Nicholas Piggin <npiggin@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Tyrone Ting <kfting@nuvoton.com>, Hao Wu <wuhaotsh@google.com>, Stefan Berger <stefanb@linux.vnet.ibm.com>, Jeuk Kim <jeuk20.kim@samsung.com>, Eric Blake <eblake@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
MAINTAINERS                                  |   1 +
block/qcow2.h                                |   1 +
include/accel/tcg/cpu-ldst.h                 |   2 +
include/exec/memop.h                         |   4 +
include/exec/translator.h                    |   5 +-
include/exec/tswap.h                         |   3 +
include/qemu/bswap.h                         |  72 +++
include/qemu/host-utils.h                    |   1 -
include/qemu/int128.h                        |   2 -
include/system/memory.h                      |   8 +-
include/system/memory_cached.h               |   2 +
system/memory-internal.h                     |   2 +
include/system/memory_ldst.h.inc             |  52 +--
include/system/memory_ldst_endian.h.inc      |  33 ++
include/system/memory_ldst_phys.h.inc        | 113 +----
include/system/memory_ldst_phys_endian.h.inc |  57 +++
audio/audio.c                                |   1 +
block/blklogwrites.c                         |   1 +
block/export/vduse-blk.c                     |   1 +
block/export/vhost-user-blk-server.c         |   1 +
block/export/virtio-blk-handler.c            |   1 +
block/parallels-ext.c                        |   1 +
hw/9pfs/9p-local.c                           |   1 +
hw/block/cdrom.c                             |   1 +
hw/block/hd-geometry.c                       |   1 +
hw/net/can/ctucan_core.c                     |   1 +
hw/nvram/xlnx-efuse.c                        |   1 +
hw/scsi/scsi-generic.c                       |   1 +
hw/sd/sd.c                                   |   1 +
hw/sd/ssi-sd.c                               |   1 +
net/l2tpv3.c                                 |   1 +
qga/commands-linux.c                         |   1 +
scsi/pr-manager-helper.c                     |   1 +
target/arm/tcg/arith_helper.c                |   1 +
tests/qtest/acpi-utils.c                     |   1 +
tests/qtest/ahci-test.c                      |   2 +-
tests/qtest/aspeed-hace-utils.c              |   1 +
tests/qtest/bios-tables-test.c               |   1 +
tests/qtest/libqos/ahci.c                    |   2 +-
tests/qtest/libqos/generic-pcihost.c         |   2 +-
tests/qtest/libqos/igb.c                     |   1 +
tests/qtest/libqos/pci-spapr.c               |   2 +-
tests/qtest/libqos/virtio-9p-client.c        |   1 +
tests/qtest/migration/framework.c            |   1 +
tests/qtest/npcm7xx_emc-test.c               |   1 +
tests/qtest/tpm-emu.c                        |   1 +
tests/qtest/ufs-test.c                       |   1 +
tests/qtest/vmgenid-test.c                   |   1 +
tests/unit/test-hbitmap.c                    |   1 +
util/bitmap.c                                |   1 +
util/hbitmap.c                               |   2 +-
system/memory_ldst.c.inc                     | 449 ++-----------------
system/memory_ldst_endian.c.inc              |  70 +++
scripts/make-config-poison.sh                |   1 +
54 files changed, 354 insertions(+), 564 deletions(-)
create mode 100644 include/system/memory_ldst_endian.h.inc
create mode 100644 include/system/memory_ldst_phys_endian.h.inc
create mode 100644 system/memory_ldst_endian.c.inc
[PATCH v6 00/18] system/memory: Clean ups around address_space_ldst() endian variants
Posted by Philippe Mathieu-Daudé 2 weeks, 5 days ago
Missing review: 1-4

Since v5:
- No pointer arithmetic in ld/st[M] (Richard)
- Inline (Paolo)

Since v4:
- No change (RESEND)

Since v3:
- Assign device_endian enums (Richard)
- Add/use ldm_p() and stm_p() helpers (Paolo)

Since v2:
- Changed opt-out to opt-in approach (Pierrick)
- Split big patches in smaller ones
- Mark ioport little-endian

Philippe Mathieu-Daudé (18):
  bswap: Include missing 'qemu/bswap.h' header
  bswap: Use 'qemu/bswap.h' instead of 'qemu/host-utils.h'
  bswap: Remove unnecessary 'qemu/bswap.h'
  system/memory: Introduce ldm_p() and stm_p() load/store helpers
  system/memory: Define address_space_ldst[W] endian variants via
    template
  system/memory: Define address_space_ldst[L] endian variants via
    template
  system/memory: Define address_space_ldst[Q] endian variants via
    template
  system/memory: Factor address_space_ldst[M]_internal() helper out
  system/memory: Pass device_endian argument as MemOp bit
  system/memory: Use ldm_p() and stm_p() helpers
  system/memory: Directly call address_space_ldst[M]_internal() helper
  system: Allow restricting the legacy ld/st_phys() 'native-endian' API
  system: Allow restricting legacy address_space_ldst() native-endian
    API
  system: Allow restricting the legacy cpu_ld/st() 'native-endian' API
  system: Allow restricting the legacy translator_ld() 'native-endian'
    API
  system: Allow restricting the legacy tswap() 'native-endian' API
  system: Allow restricting the legacy MO_TE* 'native-endian'
    definitions
  system: Allow restricting the legacy DEVICE_NATIVE_ENDIAN definition

 MAINTAINERS                                  |   1 +
 block/qcow2.h                                |   1 +
 include/accel/tcg/cpu-ldst.h                 |   2 +
 include/exec/memop.h                         |   4 +
 include/exec/translator.h                    |   5 +-
 include/exec/tswap.h                         |   3 +
 include/qemu/bswap.h                         |  72 +++
 include/qemu/host-utils.h                    |   1 -
 include/qemu/int128.h                        |   2 -
 include/system/memory.h                      |   8 +-
 include/system/memory_cached.h               |   2 +
 system/memory-internal.h                     |   2 +
 include/system/memory_ldst.h.inc             |  52 +--
 include/system/memory_ldst_endian.h.inc      |  33 ++
 include/system/memory_ldst_phys.h.inc        | 113 +----
 include/system/memory_ldst_phys_endian.h.inc |  57 +++
 audio/audio.c                                |   1 +
 block/blklogwrites.c                         |   1 +
 block/export/vduse-blk.c                     |   1 +
 block/export/vhost-user-blk-server.c         |   1 +
 block/export/virtio-blk-handler.c            |   1 +
 block/parallels-ext.c                        |   1 +
 hw/9pfs/9p-local.c                           |   1 +
 hw/block/cdrom.c                             |   1 +
 hw/block/hd-geometry.c                       |   1 +
 hw/net/can/ctucan_core.c                     |   1 +
 hw/nvram/xlnx-efuse.c                        |   1 +
 hw/scsi/scsi-generic.c                       |   1 +
 hw/sd/sd.c                                   |   1 +
 hw/sd/ssi-sd.c                               |   1 +
 net/l2tpv3.c                                 |   1 +
 qga/commands-linux.c                         |   1 +
 scsi/pr-manager-helper.c                     |   1 +
 target/arm/tcg/arith_helper.c                |   1 +
 tests/qtest/acpi-utils.c                     |   1 +
 tests/qtest/ahci-test.c                      |   2 +-
 tests/qtest/aspeed-hace-utils.c              |   1 +
 tests/qtest/bios-tables-test.c               |   1 +
 tests/qtest/libqos/ahci.c                    |   2 +-
 tests/qtest/libqos/generic-pcihost.c         |   2 +-
 tests/qtest/libqos/igb.c                     |   1 +
 tests/qtest/libqos/pci-spapr.c               |   2 +-
 tests/qtest/libqos/virtio-9p-client.c        |   1 +
 tests/qtest/migration/framework.c            |   1 +
 tests/qtest/npcm7xx_emc-test.c               |   1 +
 tests/qtest/tpm-emu.c                        |   1 +
 tests/qtest/ufs-test.c                       |   1 +
 tests/qtest/vmgenid-test.c                   |   1 +
 tests/unit/test-hbitmap.c                    |   1 +
 util/bitmap.c                                |   1 +
 util/hbitmap.c                               |   2 +-
 system/memory_ldst.c.inc                     | 449 ++-----------------
 system/memory_ldst_endian.c.inc              |  70 +++
 scripts/make-config-poison.sh                |   1 +
 54 files changed, 354 insertions(+), 564 deletions(-)
 create mode 100644 include/system/memory_ldst_endian.h.inc
 create mode 100644 include/system/memory_ldst_phys_endian.h.inc
 create mode 100644 system/memory_ldst_endian.c.inc

-- 
2.52.0


Re: [PATCH v6 00/18] system/memory: Clean ups around address_space_ldst() endian variants
Posted by Philippe Mathieu-Daudé 2 weeks, 2 days ago
On 18/1/26 20:34, Philippe Mathieu-Daudé wrote:

> Philippe Mathieu-Daudé (18):
>    bswap: Include missing 'qemu/bswap.h' header
>    bswap: Use 'qemu/bswap.h' instead of 'qemu/host-utils.h'
>    bswap: Remove unnecessary 'qemu/bswap.h'
>    system/memory: Introduce ldm_p() and stm_p() load/store helpers
>    system/memory: Define address_space_ldst[W] endian variants via
>      template
>    system/memory: Define address_space_ldst[L] endian variants via
>      template
>    system/memory: Define address_space_ldst[Q] endian variants via
>      template
>    system/memory: Factor address_space_ldst[M]_internal() helper out
>    system/memory: Pass device_endian argument as MemOp bit
>    system/memory: Use ldm_p() and stm_p() helpers
>    system/memory: Directly call address_space_ldst[M]_internal() helper
>    system: Allow restricting the legacy ld/st_phys() 'native-endian' API
>    system: Allow restricting legacy address_space_ldst() native-endian
>      API
>    system: Allow restricting the legacy cpu_ld/st() 'native-endian' API
>    system: Allow restricting the legacy translator_ld() 'native-endian'
>      API
>    system: Allow restricting the legacy tswap() 'native-endian' API
>    system: Allow restricting the legacy MO_TE* 'native-endian'
>      definitions
>    system: Allow restricting the legacy DEVICE_NATIVE_ENDIAN definition

Series queued, thanks.