[PATCH v2 0/3] target-info: set target_arch statically

Richard Henderson posted 3 patches 4 days, 5 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260205030617.266625-1-richard.henderson@linaro.org
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Pierrick Bouvier <pierrick.bouvier@linaro.org>
target-info-stub.c | 2 +-
target-info.c      | 8 +-------
meson.build        | 4 +++-
qapi/machine.json  | 4 +++-
4 files changed, 8 insertions(+), 10 deletions(-)
[PATCH v2 0/3] target-info: set target_arch statically
Posted by Richard Henderson 4 days, 5 hours ago
Based-on: 20260205030244.266447-1-richard.henderson@linaro.org
("[PATCH 0/6] or1k: Rename the architecture from openrisc")

target_arch() function would reparse target_name() every time if
it was not set to a proper SYS_EMU_TARGET_* value (when using
target-info-stub.c), which is not efficient.

This was found when doing changes to virtio_access_is_big_endian()
function, having an overhead of 50% after switching to runtime checks.
With this, overhead left is around 3%, due to indirect function calls.


r~


Richard Henderson (3):
  qapi: Add hexagon to SysEmuTarget
  meson: Add TARGET_ARCH to config_target_data
  target-info: Statically initialize target_arch

 target-info-stub.c | 2 +-
 target-info.c      | 8 +-------
 meson.build        | 4 +++-
 qapi/machine.json  | 4 +++-
 4 files changed, 8 insertions(+), 10 deletions(-)

-- 
2.43.0