All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Eric Blake" <eblake@redhat.com>,
	"Dr. David Alan Gilbert" <dave@treblig.org>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Eduardo Habkost" <eduardo@habkost.net>
Subject: Re: [PATCH v3] hw/uefi: add "info firmware-log" + "query-firmware-log" monitor commands
Date: Fri, 10 Oct 2025 10:31:41 +0100	[thread overview]
Message-ID: <aOjSfQMrRpanYZ7g@redhat.com> (raw)
In-Reply-To: <dyzu3h5qh7y3isn7m2ech3tq2lbr23aswrmc6npvjupm3wepqr@366kl5b2jkws>

On Fri, Oct 10, 2025 at 11:27:36AM +0200, Gerd Hoffmann wrote:
> > > +static void handle_ovmf_log_range(GString *out,
> > > +                                  dma_addr_t start,
> > > +                                  dma_addr_t end,
> > > +                                  Error **errp)
> > > +{
> 
> > How about eliminating the intermediate buffer alloocation / printf by
> > reading straight into the GString buf ? Something like
> > 
> >    size_t len = end - start;
> >    g_string_set_size(out, out->len + len);
> >    if (dma_memory_read(&address_space_memory, start,
> >                        out->str + (out->len - len),
> > 	               len, MEMTXATTRS_UNSPECIFIED)) {
> >        ...
> >    }
> 
> There are two ranges in the wrap-around case, and I don't think I can
> put multiple chunks into a single gstring.

I'm not sure I understand ?  The code I've suggest here satisfies the
existing API contract you've got for handle_ovmf_log_range, so should
be happy with being called multiple times.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2025-10-10  9:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10  7:10 [PATCH v3] hw/uefi: add "info firmware-log" + "query-firmware-log" monitor commands Gerd Hoffmann
2025-10-10  9:12 ` Daniel P. Berrangé
2025-10-10  9:27   ` Gerd Hoffmann
2025-10-10  9:31     ` Daniel P. Berrangé [this message]
2025-10-13  8:42       ` Gerd Hoffmann
2025-10-10 11:41 ` Markus Armbruster
2025-10-10 17:36   ` Markus Armbruster
2025-10-10 20:23     ` Dr. David Alan Gilbert
2025-10-11  4:43       ` Markus Armbruster
2025-10-11  9:29     ` Markus Armbruster
2025-10-13  9:19   ` Gerd Hoffmann
2025-10-13 10:43     ` Markus Armbruster
2025-10-13 11:47       ` Gerd Hoffmann
2025-10-10 20:36 ` Dr. David Alan Gilbert
2025-10-13 11:55   ` Gerd Hoffmann
2025-10-13 13:12     ` Dr. David Alan Gilbert
2025-10-13 19:11 ` Philippe Mathieu-Daudé
2025-10-14 13:02   ` Daniel P. Berrangé

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=aOjSfQMrRpanYZ7g@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dave@treblig.org \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=farosas@suse.de \
    --cc=kraxel@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wangyanan55@huawei.com \
    --cc=zhao1.liu@intel.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.