From: Peter Maydell <peter.maydell@linaro.org>
To: Daniel Bertalan <dani@danielbertalan.dev>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/arm/bcm2835_property: Implement "get command line" message
Date: Tue, 2 May 2023 11:15:52 +0100 [thread overview]
Message-ID: <CAFEAcA9vHxxNGp4SC9AYnqCmLZ-a87MeD7Uq6no8n2Vxy9gi_w@mail.gmail.com> (raw)
In-Reply-To: <20230425103250.56653-1-dani@danielbertalan.dev>
On Tue, 25 Apr 2023 at 11:34, Daniel Bertalan <dani@danielbertalan.dev> wrote:
>
> This query copies the kernel command line into the message buffer. It
> was previously stubbed out to return empty, this commit makes it reflect
> the arguments specified with `-append`.
>
> I observed the following peculiarities on my Pi 3B+:
> - If the buffer is shorter than the string, the response header gives
> the full length, but no data is actually copied.
> - No NUL terminator is added: even if the buffer is long enough to fit
> one, the buffer's original contents are preserved past the string's
> end.
> - The VC firmware adds the following extra parameters beside the
> user-supplied ones (via /boot/cmdline.txt): `video`, `vc_mem.mem_base`
> and `vc_mem.mem_size`. This is currently not implemented in qemu.
Are there any particularly interesting bits of guest software
that try to read this property ?
I added a brief comment to the code about the no-NUL-terminator
and short-buffer handling so that future readers of the code
don't have to refer back to the commit message:
+ /*
+ * We follow the firmware behaviour: no NUL terminator is
+ * written to the buffer, and if the buffer is too short
+ * we report the required length in the response header
+ * and copy nothing to the buffer.
+ */
and have applied this to target-arm.next; thanks.
-- PMM
next prev parent reply other threads:[~2023-05-02 10:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-25 10:34 [PATCH] hw/arm/bcm2835_property: Implement "get command line" message Daniel Bertalan
2023-05-02 10:15 ` Peter Maydell [this message]
2023-05-02 11:10 ` Daniel Bertalan
2023-05-02 11:42 ` Peter Maydell
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=CAFEAcA9vHxxNGp4SC9AYnqCmLZ-a87MeD7Uq6no8n2Vxy9gi_w@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=dani@danielbertalan.dev \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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).