[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hw/arm/bcm2835_property: Implement "get command line" messag
From: |
Peter Maydell |
Subject: |
Re: [PATCH] hw/arm/bcm2835_property: Implement "get command line" message |
Date: |
Tue, 2 May 2023 11:15:52 +0100 |
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
- Re: [PATCH] hw/arm/bcm2835_property: Implement "get command line" message,
Peter Maydell <=