All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: Igor Mammedov <imammedo@redhat.com>,
	Sia Jee Heng <jeeheng.sia@starfivetech.com>,
	Ani Sinha <anisinha@redhat.com>,
	qemu-devel@nongnu.org,
	Alistair Francis <alistair.francis@wdc.com>
Subject: Re: [PATCH] hw/acpi: correct field sequence in SPCR table
Date: Thu, 26 Mar 2026 09:41:21 -0400	[thread overview]
Message-ID: <20260326093653-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260326121947.51200-1-heinrich.schuchardt@canonical.com>

the fix is correct, thanks!
something more to improve:


On Thu, Mar 26, 2026 at 01:19:47PM +0100, Heinrich Schuchardt wrote:
> On LoongArch and RISC-V invalid SPCR tables are created:
> 
> Terrminal Type : 00
> Language : 03
> 
> The correct values are:
> 
> Terrminal Type : 03
> Language : 00
> 
> This is due to commit 7dd0b070fa09 ("hw/arm/virt-acpi-build.c: Migrate
> SPCR creation to common location") that swapped the fields.
> 
> See the specification of the table in
> https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/serial-port-console-redirection-table

should mention revision you are consulting.

> 
> Fixes: 7dd0b070fa09 ("hw/arm/virt-acpi-build.c: Migrate SPCR creation to common location")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


BTW I think the link to the spec should move to build_spcr.

And also:
/*      
 * Serial Port Console Redirection Table (SPCR)
 * Rev: 1.07
 */     

is probably wrong:
1.07	Fixed incorrect description in Stop Bits field. Undo accidental removal of Flow Control field. Edited formatting.

it's likely not the earliest version we adhere to.


> ---
>  hw/acpi/aml-build.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index 4b37405088..a999320e61 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -2115,10 +2115,10 @@ void build_spcr(GArray *table_data, BIOSLinker *linker,
>      build_append_int_noprefix(table_data, f->stop_bits, 1);
>      /* Flow Control */
>      build_append_int_noprefix(table_data, f->flow_control, 1);
> -    /* Language */
> -    build_append_int_noprefix(table_data, f->language, 1);
>      /* Terminal Type */
>      build_append_int_noprefix(table_data, f->terminal_type, 1);
> +    /* Language */
> +    build_append_int_noprefix(table_data, f->language, 1);
>      /* PCI Device ID  */
>      build_append_int_noprefix(table_data, f->pci_device_id, 2);
>      /* PCI Vendor ID */
> -- 
> 2.53.0



  reply	other threads:[~2026-03-26 13:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26 12:19 [PATCH] hw/acpi: correct field sequence in SPCR table Heinrich Schuchardt
2026-03-26 13:41 ` Michael S. Tsirkin [this message]
2026-03-26 14:40   ` Heinrich Schuchardt

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=20260326093653-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=alistair.francis@wdc.com \
    --cc=anisinha@redhat.com \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=imammedo@redhat.com \
    --cc=jeeheng.sia@starfivetech.com \
    --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 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.