From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org, Anthony PERARD <anthony@xenproject.org>,
xen-devel@lists.xenproject.org,
Pierrick Bouvier <pierrick.bouvier@linaro.org>,
Paul Durrant <paul@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>,
Anton Johansson <anjo@rev.ng>
Subject: Re: [PATCH 2/3] hw/xen: Replace target_ulong by agnostic target_long_bits()
Date: Tue, 28 Oct 2025 13:49:00 +0100 [thread overview]
Message-ID: <aQC7vCX4OHElpfDD@zapote> (raw)
In-Reply-To: <20251022140114.72372-3-philmd@linaro.org>
On Wed, Oct 22, 2025 at 04:01:12PM +0200, Philippe Mathieu-Daudé wrote:
> Both are equivalent:
>
> target_long_bits()
>
> sizeof(target_u?long) * BITS_PER_BYTE
>
> Prefer the former which is target-agnostic.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> ---
> hw/xen/xen-hvm-common.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c
> index 258014370e1..b40ae0b3af0 100644
> --- a/hw/xen/xen-hvm-common.c
> +++ b/hw/xen/xen-hvm-common.c
> @@ -2,8 +2,8 @@
> #include "qemu/units.h"
> #include "qemu/bitops.h"
> #include "qemu/error-report.h"
> +#include "qemu/target-info.h"
> #include "qapi/error.h"
> -#include "exec/target_long.h"
> #include "exec/target_page.h"
> #include "trace.h"
>
> @@ -455,7 +455,7 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req)
> req->addr, req->data, req->count, req->size);
>
> if (!req->data_is_ptr && (req->dir == IOREQ_WRITE) &&
> - (req->size < sizeof (target_ulong))) {
> + (req_size_bits < target_long_bits())) {
> req->data &= MAKE_64BIT_MASK(0, req_size_bits);
> }
>
> --
> 2.51.0
>
next prev parent reply other threads:[~2025-10-28 12:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-22 14:01 [PATCH 0/3] hw/xen: Build only once Philippe Mathieu-Daudé
2025-10-22 14:01 ` [PATCH 1/3] hw/xen: Use BITS_PER_BYTE & MAKE_64BIT_MASK() in req_size_bits() Philippe Mathieu-Daudé
2025-10-28 8:08 ` Pierrick Bouvier
2025-10-28 12:48 ` Edgar E. Iglesias
2025-10-22 14:01 ` [PATCH 2/3] hw/xen: Replace target_ulong by agnostic target_long_bits() Philippe Mathieu-Daudé
2025-10-28 8:09 ` Pierrick Bouvier
2025-10-28 12:49 ` Edgar E. Iglesias [this message]
2025-10-22 14:01 ` [PATCH 3/3] hw/xen: Build only once Philippe Mathieu-Daudé
2025-10-28 8:09 ` Pierrick Bouvier
2025-10-28 13:57 ` Edgar E. Iglesias
2025-10-27 19:17 ` [PATCH 0/3] " Philippe Mathieu-Daudé
2025-10-29 18:03 ` 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=aQC7vCX4OHElpfDD@zapote \
--to=edgar.iglesias@gmail.com \
--cc=anjo@rev.ng \
--cc=anthony@xenproject.org \
--cc=paul@xen.org \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).