mbox series

[RESEND,v4,0/3] Upgrade ACPI SPCR table to support SPCR table revision 4 format

Message ID 20240823113142.161727-1-jeeheng.sia@starfivetech.com (mailing list archive)
Headers show
Series Upgrade ACPI SPCR table to support SPCR table revision 4 format | expand

Message

Sia Jee Heng Aug. 23, 2024, 11:31 a.m. UTC
Update the SPCR table to accommodate the SPCR Table revision 4 [1].
The SPCR table has been modified to adhere to the revision 4 format [2].

Meanwhile, the virt SPCR golden reference file for RISC-V have been updated to
accommodate the SPCR Table revision 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

Changes in v4:
- Remove the SPCR table revision 4 update for the ARM architecture.

Changes in v3:
- Rebased on the latest QEMU.
- Added Acked-by: Alistair Francis <alistair.francis@wdc.com>

Changes in v2:
- Utilizes a three-patch approach to modify the ACPI pre-built binary
  files required by the Bios-Table-Test.
- Rebases and incorporates changes to support both ARM and RISC-V ACPI
  pre-built binary files.

Sia Jee Heng (3):
  qtest: allow SPCR acpi table changes
  hw/acpi: Upgrade ACPI SPCR table to support SPCR table revision 4
    format
  tests/qtest/bios-tables-test: Update virt SPCR golden reference for
    RISC-V

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

Comments

Sunil V L Aug. 23, 2024, 2:29 p.m. UTC | #1
Hi Jee Heng,
On Fri, Aug 23, 2024 at 04:31:39AM -0700, Sia Jee Heng wrote:
> Update the SPCR table to accommodate the SPCR Table revision 4 [1].
> The SPCR table has been modified to adhere to the revision 4 format [2].
> 
> Meanwhile, the virt SPCR golden reference file for RISC-V have been updated to
> accommodate the SPCR Table revision 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
> 
Just curious - whether this needs changes in linux side as well? Does
current linux code work fine with version 4 of SPCR table on RISC-V?

Thanks,
Sunil
Sia Jee Heng Aug. 26, 2024, 7:04 a.m. UTC | #2
> -----Original Message-----
> From: Sunil V L <sunilvl@ventanamicro.com>
> Sent: Friday, August 23, 2024 10:29 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; peter.maydell@linaro.org; shannon.zhaosl@gmail.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 RESEND v4 0/3] Upgrade ACPI SPCR table to support SPCR table revision 4 format
> 
> Hi Jee Heng,
> On Fri, Aug 23, 2024 at 04:31:39AM -0700, Sia Jee Heng wrote:
> > Update the SPCR table to accommodate the SPCR Table revision 4 [1].
> > The SPCR table has been modified to adhere to the revision 4 format [2].
> >
> > Meanwhile, the virt SPCR golden reference file for RISC-V have been updated to
> > accommodate the SPCR Table revision 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
> >
> Just curious - whether this needs changes in linux side as well? Does
> current linux code work fine with version 4 of SPCR table on RISC-V?
The current Linux ACPI Table has not yet been updated to support SPCR v4.
However, Linux RISC-V will be able to use the information in the QEMU's
SPCR table to boot with behaviour similar to ARM. 
> 
> Thanks,
> Sunil
Sunil V L Aug. 26, 2024, 7:13 a.m. UTC | #3
Hi Jee Heng,

On Mon, Aug 26, 2024 at 07:04:11AM +0000, JeeHeng Sia wrote:
> 
> 
> > -----Original Message-----
> > From: Sunil V L <sunilvl@ventanamicro.com>
> > Sent: Friday, August 23, 2024 10:29 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; peter.maydell@linaro.org; shannon.zhaosl@gmail.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 RESEND v4 0/3] Upgrade ACPI SPCR table to support SPCR table revision 4 format
> > 
> > Hi Jee Heng,
> > On Fri, Aug 23, 2024 at 04:31:39AM -0700, Sia Jee Heng wrote:
> > > Update the SPCR table to accommodate the SPCR Table revision 4 [1].
> > > The SPCR table has been modified to adhere to the revision 4 format [2].
> > >
> > > Meanwhile, the virt SPCR golden reference file for RISC-V have been updated to
> > > accommodate the SPCR Table revision 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
> > >
> > Just curious - whether this needs changes in linux side as well? Does
> > current linux code work fine with version 4 of SPCR table on RISC-V?
> The current Linux ACPI Table has not yet been updated to support SPCR v4.
> However, Linux RISC-V will be able to use the information in the QEMU's
> SPCR table to boot with behaviour similar to ARM. 
> > 
So, it means even if qemu risc-v SPCR is upgraded to version 4,
current linux continues to work. It may be just able to decode SPCR v2
fields only until enhanced to understand v4 but but doesn't break
anything or crash. Is that correct?

Just wanted to confirm qemu changes can get merged without any
dependency.

Thanks!
Sunil
Sia Jee Heng Aug. 26, 2024, 7:19 a.m. UTC | #4
> -----Original Message-----
> From: Sunil V L <sunilvl@ventanamicro.com>
> Sent: Monday, August 26, 2024 3:14 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; peter.maydell@linaro.org; shannon.zhaosl@gmail.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 RESEND v4 0/3] Upgrade ACPI SPCR table to support SPCR table revision 4 format
> 
> Hi Jee Heng,
> 
> On Mon, Aug 26, 2024 at 07:04:11AM +0000, JeeHeng Sia wrote:
> >
> >
> > > -----Original Message-----
> > > From: Sunil V L <sunilvl@ventanamicro.com>
> > > Sent: Friday, August 23, 2024 10:29 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; peter.maydell@linaro.org; shannon.zhaosl@gmail.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 RESEND v4 0/3] Upgrade ACPI SPCR table to support SPCR table revision 4 format
> > >
> > > Hi Jee Heng,
> > > On Fri, Aug 23, 2024 at 04:31:39AM -0700, Sia Jee Heng wrote:
> > > > Update the SPCR table to accommodate the SPCR Table revision 4 [1].
> > > > The SPCR table has been modified to adhere to the revision 4 format [2].
> > > >
> > > > Meanwhile, the virt SPCR golden reference file for RISC-V have been updated to
> > > > accommodate the SPCR Table revision 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
> > > >
> > > Just curious - whether this needs changes in linux side as well? Does
> > > current linux code work fine with version 4 of SPCR table on RISC-V?
> > The current Linux ACPI Table has not yet been updated to support SPCR v4.
> > However, Linux RISC-V will be able to use the information in the QEMU's
> > SPCR table to boot with behaviour similar to ARM.
> > >
> So, it means even if qemu risc-v SPCR is upgraded to version 4,
> current linux continues to work. It may be just able to decode SPCR v2
> fields only until enhanced to understand v4 but but doesn't break
> anything or crash. Is that correct?
Yes, correct.
> 
> Just wanted to confirm qemu changes can get merged without any
> dependency.
> 
> Thanks!
> Sunil