From: "Michael S. Tsirkin" <mst@redhat.com>
To: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Nicholas Piggin" <npiggin@gmail.com>
Subject: Re: [PATCH 2/6] include/hw/virtio/virtio-access.h: remove target specifics define
Date: Sat, 31 Jan 2026 12:48:57 -0500 [thread overview]
Message-ID: <20260131124842-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260131020100.1115203-3-pierrick.bouvier@linaro.org>
On Fri, Jan 30, 2026 at 06:00:56PM -0800, Pierrick Bouvier wrote:
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Performance impact?
the reason we have these is for performance ...
> ---
> include/hw/virtio/virtio-access.h | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/include/hw/virtio/virtio-access.h b/include/hw/virtio/virtio-access.h
> index cd17d0c87eb..51d9d725690 100644
> --- a/include/hw/virtio/virtio-access.h
> +++ b/include/hw/virtio/virtio-access.h
> @@ -17,27 +17,27 @@
> #define QEMU_VIRTIO_ACCESS_H
>
> #include "exec/hwaddr.h"
> +#include "qemu/target-info.h"
> #include "system/memory_cached.h"
> #include "hw/virtio/virtio.h"
> #include "hw/virtio/virtio-bus.h"
>
> -#if defined(TARGET_PPC64) || defined(TARGET_ARM)
> -#define LEGACY_VIRTIO_IS_BIENDIAN 1
> -#endif
> -
> static inline bool virtio_access_is_big_endian(VirtIODevice *vdev)
> {
> -#if defined(LEGACY_VIRTIO_IS_BIENDIAN)
> - return virtio_is_big_endian(vdev);
> -#elif TARGET_BIG_ENDIAN
> - if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> - /* Devices conforming to VIRTIO 1.0 or later are always LE. */
> - return false;
> + if (target_ppc64() || target_base_arm()) {
> + return virtio_is_big_endian(vdev);
> }
> - return true;
> -#else
> +
> + if (target_big_endian()) {
> + if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> + /* Devices conforming to VIRTIO 1.0 or later are always LE. */
> + return false;
> + } else {
> + return true;
> + }
> + }
> +
> return false;
> -#endif
> }
>
> static inline void virtio_stw_p(VirtIODevice *vdev, void *ptr, uint16_t v)
> --
> 2.47.3
next prev parent reply other threads:[~2026-01-31 17:49 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-31 2:00 [PATCH 0/6] single-binary: hw/virtio Pierrick Bouvier
2026-01-31 2:00 ` [PATCH 1/6] target-info: add target_base_ppc, target_ppc and target_ppc64 Pierrick Bouvier
2026-02-01 22:28 ` Philippe Mathieu-Daudé
2026-02-01 23:11 ` Philippe Mathieu-Daudé
2026-01-31 2:00 ` [PATCH 2/6] include/hw/virtio/virtio-access.h: remove target specifics define Pierrick Bouvier
2026-01-31 17:48 ` Michael S. Tsirkin [this message]
2026-02-01 22:36 ` Philippe Mathieu-Daudé
2026-02-01 22:41 ` Philippe Mathieu-Daudé
2026-02-01 23:20 ` Philippe Mathieu-Daudé
2026-02-02 1:25 ` Pierrick Bouvier
2026-02-02 7:40 ` Michael S. Tsirkin
2026-02-02 11:03 ` Philippe Mathieu-Daudé
2026-02-02 1:24 ` Pierrick Bouvier
2026-02-02 7:50 ` Michael S. Tsirkin
2026-02-02 18:00 ` Stefan Hajnoczi
2026-02-02 19:12 ` Pierrick Bouvier
2026-01-31 2:00 ` [PATCH 3/6] include/hw/ppc/spapr: extract SPAPR_MAX_RAM_SLOTS in a new header Pierrick Bouvier
2026-02-01 22:26 ` Philippe Mathieu-Daudé
2026-02-01 23:11 ` Philippe Mathieu-Daudé
2026-01-31 2:00 ` [PATCH 4/6] hw/virtio/vhost-user: make compilation unit common Pierrick Bouvier
2026-02-01 23:11 ` Philippe Mathieu-Daudé
2026-01-31 2:00 ` [PATCH 5/6] hw/virtio/virtio-qmp: " Pierrick Bouvier
2026-02-01 23:11 ` Philippe Mathieu-Daudé
2026-01-31 2:01 ` [PATCH 6/6] hw/virtio/: make all compilation units common Pierrick Bouvier
2026-02-01 22:28 ` Philippe Mathieu-Daudé
2026-02-01 23:13 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260131124842-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=harshpb@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=sgarzare@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.