From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Vadim Chichikalyuk <chichikalyuk@gmail.com>
Cc: <qemu-devel@nongnu.org>, <qemu-arm@nongnu.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Ani Sinha <anisinha@redhat.com>,
Shannon Zhao <shannon.zhaosl@gmail.com>,
"Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: [PATCH 1/4] hw: acpi: add support for SPCR revision 3
Date: Mon, 21 Jul 2025 10:39:37 +0100 [thread overview]
Message-ID: <20250721103937.00007933@huawei.com> (raw)
In-Reply-To: <20250718162045.49012-2-chichikalyuk@gmail.com>
On Fri, 18 Jul 2025 19:20:42 +0300
Vadim Chichikalyuk <chichikalyuk@gmail.com> wrote:
> The UART clock frequency field of the SPCR table was added in revision 3.
> Currently, build_spcr() treats revision 3 tables the same as revision 2 and
> only includes this field in revision 4 tables.
Given this isn't in the ACPI spec, I'd make sure you have a reference to the MS
documentation for this. I think it is this one:
https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/serial-port-console-redirection-table
>
> Fix build_spcr() to include the clock frequency field in revision 3 tables.
> Per the specification, this is the only change between revisions 2 and 3.
Maybe say why this has never mattered - I think because no code actually uses
revision 3. Prior to this series, arm-virt and loongarch were 2 and
riscv-virt was 4.
>
> Signed-off-by: Vadim Chichikalyuk <chichikalyuk@gmail.com>
Code looks fine so with those additions to the description
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> ---
> hw/acpi/aml-build.c | 20 +++++++++++---------
> 1 file changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index 1e685f982f..9855d5f053 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -2123,20 +2123,22 @@ void build_spcr(GArray *table_data, BIOSLinker *linker,
> build_append_int_noprefix(table_data, f->pci_flags, 4);
> /* PCI Segment */
> build_append_int_noprefix(table_data, f->pci_segment, 1);
> - if (rev < 4) {
> + if (rev < 3) {
> /* Reserved */
> build_append_int_noprefix(table_data, 0, 4);
> } else {
> /* UartClkFreq */
> build_append_int_noprefix(table_data, f->uart_clk_freq, 4);
> - /* PreciseBaudrate */
> - build_append_int_noprefix(table_data, f->precise_baudrate, 4);
> - /* NameSpaceStringLength */
> - build_append_int_noprefix(table_data, f->namespace_string_length, 2);
> - /* NameSpaceStringOffset */
> - build_append_int_noprefix(table_data, f->namespace_string_offset, 2);
> - /* NamespaceString[] */
> - g_array_append_vals(table_data, name, f->namespace_string_length);
> + if (rev >= 4) {
> + /* PreciseBaudrate */
Obviously historical, but this does seem like a lot of unnecessary comments
given the clear naming of the input parameters!
> + build_append_int_noprefix(table_data, f->precise_baudrate, 4);
> + /* NameSpaceStringLength */
> + build_append_int_noprefix(table_data, f->namespace_string_length, 2);
> + /* NameSpaceStringOffset */
> + build_append_int_noprefix(table_data, f->namespace_string_offset, 2);
> + /* NamespaceString[] */
> + g_array_append_vals(table_data, name, f->namespace_string_length);
> + }
> }
> acpi_table_end(linker, &table);
> }
next prev parent reply other threads:[~2025-07-21 9:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-18 16:20 [PATCH 0/4] hw: acpi: support SPCR rev. 3 & UART clock freq in ARM SPCR Vadim Chichikalyuk
2025-07-18 16:20 ` [PATCH 1/4] hw: acpi: add support for SPCR revision 3 Vadim Chichikalyuk
2025-07-21 9:39 ` Jonathan Cameron via [this message]
2025-07-21 20:12 ` Vadim Chichikalyuk
2025-07-18 16:20 ` [PATCH 2/4] tests: acpi: whitelist expected blobs Vadim Chichikalyuk
2025-07-21 9:39 ` Jonathan Cameron via
2025-07-18 16:20 ` [PATCH 3/4] hw: arm: acpi: add UART clock frequency to SPCR table Vadim Chichikalyuk
2025-07-21 9:41 ` Jonathan Cameron via
2025-07-21 21:06 ` Vadim Chichikalyuk
2025-07-18 16:20 ` [PATCH 4/4] tests: acpi: update expected blobs Vadim Chichikalyuk
2025-07-21 9:44 ` Jonathan Cameron via
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=20250721103937.00007933@huawei.com \
--to=qemu-devel@nongnu.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=anisinha@redhat.com \
--cc=chichikalyuk@gmail.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=shannon.zhaosl@gmail.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 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).