[PATCH v1 0/2] Upgrade ACPI SPCR table to support SPCR table version 4 format

Sia Jee Heng posted 2 patches 2 weeks, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240502051233.50749-1-jeeheng.sia@starfivetech.com
Maintainers: "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>, Sunil V L <sunilvl@ventanamicro.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Bin Meng <bin.meng@windriver.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
There is a newer version of this series
hw/acpi/aml-build.c         |  14 +++++++++++---
hw/arm/virt-acpi-build.c    |  10 ++++++++--
hw/riscv/virt-acpi-build.c  |  10 ++++++++--
include/hw/acpi/acpi-defs.h |   7 +++++--
include/hw/acpi/aml-build.h |   2 +-
tests/data/acpi/virt/SPCR   | Bin 80 -> 90 bytes
6 files changed, 33 insertions(+), 10 deletions(-)
[PATCH v1 0/2] Upgrade ACPI SPCR table to support SPCR table version 4 format
Posted by Sia Jee Heng 2 weeks, 1 day ago
Update the SPCR table to accommodate the SPCR Table version 4 [1].
The SPCR table has been modified to adhere to the version 4 format [2].

Meanwhile, the virt SPCR golden reference files have been updated to
accommodate the SPCR Table version 4.

[1]: https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table
[2]: https://github.com/acpica/acpica/pull/931

Sia Jee Heng (2):
  tests/qtest/bios-tables-test: Update virt SPCR golden references
  hw/acpi: Upgrade ACPI SPCR table to support SPCR table version 4
    format

 hw/acpi/aml-build.c         |  14 +++++++++++---
 hw/arm/virt-acpi-build.c    |  10 ++++++++--
 hw/riscv/virt-acpi-build.c  |  10 ++++++++--
 include/hw/acpi/acpi-defs.h |   7 +++++--
 include/hw/acpi/aml-build.h |   2 +-
 tests/data/acpi/virt/SPCR   | Bin 80 -> 90 bytes
 6 files changed, 33 insertions(+), 10 deletions(-)


base-commit: 4977ce198d2390bff8c71ad5cb1a5f6aa24b56fb
-- 
2.34.1
Re: [PATCH v1 0/2] Upgrade ACPI SPCR table to support SPCR table version 4 format
Posted by Peter Maydell 2 weeks, 1 day ago
On Thu, 2 May 2024 at 06:12, Sia Jee Heng <jeeheng.sia@starfivetech.com> wrote:
>
> Update the SPCR table to accommodate the SPCR Table version 4 [1].
> The SPCR table has been modified to adhere to the version 4 format [2].
>
> Meanwhile, the virt SPCR golden reference files have been updated to
> accommodate the SPCR Table version 4.
>
> [1]: https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table
> [2]: https://github.com/acpica/acpica/pull/931
>
> Sia Jee Heng (2):
>   tests/qtest/bios-tables-test: Update virt SPCR golden references
>   hw/acpi: Upgrade ACPI SPCR table to support SPCR table version 4
>     format

This isn't the right way to make a change that requires
updates to the bios-tables-test reference files, because
"make check" will fail after patch 1 but before patch 2.

You need a three-patch approach. How to do that is documented
in the comment at the top of bios-tables-test.c. The resulting
three patches should look like:
 * patch 1 updates bios-tables-test-allowed-diff.h to
   mark the affected test or tests as "OK to fail"
 * patch 2 makes the changes to QEMU that alter the
   required table output
 * patch 3 updates the reference files and removes the
   tests from the allowed-diff file

See for instance commits 6c1c2e912fcf9, 1ec896fe7ca938,
ea2fde5bccc514 as an example.

Side note: if riscv virt has APCI tables now, maybe we
should add testing of them to the bios-tables-test ?

thanks
-- PMM
RE: [PATCH v1 0/2] Upgrade ACPI SPCR table to support SPCR table version 4 format
Posted by JeeHeng Sia 1 week, 4 days ago

> -----Original Message-----
> From: Peter Maydell <peter.maydell@linaro.org>
> Sent: Thursday, May 2, 2024 5:19 PM
> To: JeeHeng Sia <jeeheng.sia@starfivetech.com>
> Cc: qemu-arm@nongnu.org; qemu-devel@nongnu.org; qemu-riscv@nongnu.org; mst@redhat.com; imammedo@redhat.com;
> anisinha@redhat.com; shannon.zhaosl@gmail.com; sunilvl@ventanamicro.com; palmer@dabbelt.com; alistair.francis@wdc.com;
> bin.meng@windriver.com; liwei1518@gmail.com; dbarboza@ventanamicro.com; zhiwei_liu@linux.alibaba.com
> Subject: Re: [PATCH v1 0/2] Upgrade ACPI SPCR table to support SPCR table version 4 format
> 
> On Thu, 2 May 2024 at 06:12, Sia Jee Heng <jeeheng.sia@starfivetech.com> wrote:
> >
> > Update the SPCR table to accommodate the SPCR Table version 4 [1].
> > The SPCR table has been modified to adhere to the version 4 format [2].
> >
> > Meanwhile, the virt SPCR golden reference files have been updated to
> > accommodate the SPCR Table version 4.
> >
> > [1]: https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table
> > [2]: https://github.com/acpica/acpica/pull/931
> >
> > Sia Jee Heng (2):
> >   tests/qtest/bios-tables-test: Update virt SPCR golden references
> >   hw/acpi: Upgrade ACPI SPCR table to support SPCR table version 4
> >     format
> 
> This isn't the right way to make a change that requires
> updates to the bios-tables-test reference files, because
> "make check" will fail after patch 1 but before patch 2.
> 
> You need a three-patch approach. How to do that is documented
> in the comment at the top of bios-tables-test.c. The resulting
> three patches should look like:
>  * patch 1 updates bios-tables-test-allowed-diff.h to
>    mark the affected test or tests as "OK to fail"
>  * patch 2 makes the changes to QEMU that alter the
>    required table output
>  * patch 3 updates the reference files and removes the
>    tests from the allowed-diff file
> 
> See for instance commits 6c1c2e912fcf9, 1ec896fe7ca938,
> ea2fde5bccc514 as an example.
Thank you for the guidance. I will improve the patch by referring to the example provided.
> 
> Side note: if riscv virt has APCI tables now, maybe we
> should add testing of them to the bios-tables-test ?
Sure. I will make modifications based on the RISC-V test.
> 
> thanks
> -- PMM