qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: qemu-devel@nongnu.org
Cc: philmd@linaro.org,
	"Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>,
	alex.bennee@linaro.org, kvm@vger.kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	richard.henderson@linaro.org, manos.pitsidianakis@linaro.org
Subject: Re: [PATCH v2 5/7] hw/hyperv/syndbg: common compilation unit
Date: Fri, 7 Mar 2025 11:32:37 -0800	[thread overview]
Message-ID: <8739f1cd-e2d0-4720-9f72-c7ca60c85d8a@linaro.org> (raw)
In-Reply-To: <20250307191003.248950-6-pierrick.bouvier@linaro.org>

On 3/7/25 11:10, Pierrick Bouvier wrote:
> Replace TARGET_PAGE.* by runtime calls
> 
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
>   hw/hyperv/syndbg.c    | 10 +++++++---
>   hw/hyperv/meson.build |  2 +-
>   2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/hyperv/syndbg.c b/hw/hyperv/syndbg.c
> index d3e39170772..ee91266c070 100644
> --- a/hw/hyperv/syndbg.c
> +++ b/hw/hyperv/syndbg.c
> @@ -14,7 +14,7 @@
>   #include "migration/vmstate.h"
>   #include "hw/qdev-properties.h"
>   #include "hw/loader.h"
> -#include "cpu.h"
> +#include "exec/target_page.h"
>   #include "hw/hyperv/hyperv.h"
>   #include "hw/hyperv/vmbus-bridge.h"
>   #include "hw/hyperv/hyperv-proto.h"
> @@ -183,12 +183,14 @@ static bool create_udp_pkt(HvSynDbg *syndbg, void *pkt, uint32_t pkt_len,
>       return true;
>   }
>   
> +#define MSG_BUFSZ 4096
> +
>   static uint16_t handle_recv_msg(HvSynDbg *syndbg, uint64_t outgpa,
>                                   uint32_t count, bool is_raw, uint32_t options,
>                                   uint64_t timeout, uint32_t *retrieved_count)
>   {
>       uint16_t ret;
> -    uint8_t data_buf[TARGET_PAGE_SIZE - UDP_PKT_HEADER_SIZE];
> +    uint8_t data_buf[MSG_BUFSZ];
>       hwaddr out_len;
>       void *out_data;
>       ssize_t recv_byte_count;
> @@ -201,7 +203,7 @@ static uint16_t handle_recv_msg(HvSynDbg *syndbg, uint64_t outgpa,
>           recv_byte_count = 0;
>       } else {
>           recv_byte_count = recv(syndbg->socket, data_buf,
> -                               MIN(sizeof(data_buf), count), MSG_WAITALL);
> +                               MIN(MSG_BUFSZ, count), MSG_WAITALL);
>           if (recv_byte_count == -1) {
>               return HV_STATUS_INVALID_PARAMETER;
>           }
> @@ -374,6 +376,8 @@ static const Property hv_syndbg_properties[] = {
>   
>   static void hv_syndbg_class_init(ObjectClass *klass, void *data)
>   {
> +    g_assert(MSG_BUFSZ > qemu_target_page_size());
> +

Should be >= here.

>       DeviceClass *dc = DEVICE_CLASS(klass);
>   
>       device_class_set_props(dc, hv_syndbg_properties);
> diff --git a/hw/hyperv/meson.build b/hw/hyperv/meson.build
> index c855fdcf04c..a9f2045a9af 100644
> --- a/hw/hyperv/meson.build
> +++ b/hw/hyperv/meson.build
> @@ -1,6 +1,6 @@
>   specific_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'))
>   specific_ss.add(when: 'CONFIG_HYPERV_TESTDEV', if_true: files('hyperv_testdev.c'))
>   system_ss.add(when: 'CONFIG_VMBUS', if_true: files('vmbus.c'))
> -specific_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c'))
> +system_ss.add(when: 'CONFIG_SYNDBG', if_true: files('syndbg.c'))
>   specific_ss.add(when: 'CONFIG_HV_BALLOON', if_true: files('hv-balloon.c', 'hv-balloon-page_range_tree.c', 'hv-balloon-our_range_memslots.c'))
>   system_ss.add(when: 'CONFIG_HV_BALLOON', if_false: files('hv-balloon-stub.c'))



  parent reply	other threads:[~2025-03-07 19:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07 19:09 [PATCH v2 0/7] hw/hyperv: remove duplication compilation units Pierrick Bouvier
2025-03-07 19:09 ` [PATCH v2 1/7] hw/hyperv/hv-balloon-stub: common compilation unit Pierrick Bouvier
2025-03-07 19:29   ` Richard Henderson
2025-03-07 19:09 ` [PATCH v2 2/7] hw/hyperv/hyperv.h: header cleanup Pierrick Bouvier
2025-03-07 19:29   ` Richard Henderson
2025-03-07 19:09 ` [PATCH v2 3/7] hw/hyperv/vmbus: common compilation unit Pierrick Bouvier
2025-03-07 19:30   ` Richard Henderson
2025-03-07 19:10 ` [PATCH v2 4/7] hw/hyperv/hyperv-proto: move SYNDBG definition from target/i386 Pierrick Bouvier
2025-03-07 19:30   ` Richard Henderson
2025-03-07 19:10 ` [PATCH v2 5/7] hw/hyperv/syndbg: common compilation unit Pierrick Bouvier
2025-03-07 19:32   ` Richard Henderson
2025-03-07 19:32   ` Pierrick Bouvier [this message]
2025-03-07 19:10 ` [PATCH v2 6/7] hw/hyperv/balloon: common balloon compilation units Pierrick Bouvier
2025-03-07 19:33   ` Richard Henderson
2025-03-07 19:10 ` [PATCH v2 7/7] hw/hyperv/hyperv_testdev: common compilation unit Pierrick Bouvier
2025-03-07 19:33   ` Richard Henderson

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=8739f1cd-e2d0-4720-9f72-c7ca60c85d8a@linaro.org \
    --to=pierrick.bouvier@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=maciej.szmigiero@oracle.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).