[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 04/10] hw/riscv/virt: virt-acpi-build.c: Add basic ACPI table
From: |
Bin Meng |
Subject: |
Re: [PATCH 04/10] hw/riscv/virt: virt-acpi-build.c: Add basic ACPI tables |
Date: |
Wed, 8 Feb 2023 00:10:55 +0800 |
On Mon, Feb 6, 2023 at 9:24 PM Sunil V L <sunilvl@ventanamicro.com> wrote:
>
> On Mon, Feb 06, 2023 at 06:17:50PM +0800, Bin Meng wrote:
> > On Thu, Feb 2, 2023 at 12:54 PM Sunil V L <sunilvl@ventanamicro.com> wrote:
> > >
> > > Add few basic ACPI tables and DSDT with few devices in a
> > > new file virt-acpi-build.c.
> > >
> > > These are mostly leveraged from arm64.
> >
> > There are lots of same ACPI codes existing in x86/arm/riscv. I believe
> > some refactoring work is needed before ACPI support fully lands on
> > RISC-V.
> > For example, we can extract the common part among x86/arm/riscv into a
> > separate file, like hw/acpi/acpi-build.c?
> >
>
> While it appears like there is same code in multiple places, those
> functions take architecture specific MachineState parameter. Some tables
> like MADT though with same name, will have different contents for
> different architectures.
>
> Only one function which Daniel also pointed is the wrapper
> acpi_align_size() which can be made common. I am not
> sure whether it is worth of refactoring.
>
It's more than that. For example,
With acpi_dsdt_add_cpus(), the only meaningful parameter is the number
of cpus, so there is no need to pass the architecture specific
MachineState as the parameter.
Likewise, acpi_dsdt_add_fw_cfg() can be made generic as well.
Regards,
Bin
- Re: [PATCH 02/10] hw/riscv/virt: Add a switch to enable/disable ACPI, (continued)
- Re: [PATCH 02/10] hw/riscv/virt: Add a switch to enable/disable ACPI, Andrew Jones, 2023/02/07
- Re: [PATCH 02/10] hw/riscv/virt: Add a switch to enable/disable ACPI, Andrea Bolognani, 2023/02/07
- Re: [PATCH 02/10] hw/riscv/virt: Add a switch to enable/disable ACPI, Thomas Huth, 2023/02/07
- Re: [PATCH 02/10] hw/riscv/virt: Add a switch to enable/disable ACPI, Andrea Bolognani, 2023/02/07
- Re: [PATCH 02/10] hw/riscv/virt: Add a switch to enable/disable ACPI, Andrew Jones, 2023/02/07
- Re: [PATCH 02/10] hw/riscv/virt: Add a switch to enable/disable ACPI, Andrea Bolognani, 2023/02/08
- Re: [PATCH 02/10] hw/riscv/virt: Add a switch to enable/disable ACPI, Thomas Huth, 2023/02/09
[PATCH 04/10] hw/riscv/virt: virt-acpi-build.c: Add basic ACPI tables, Sunil V L, 2023/02/01
- Re: [PATCH 04/10] hw/riscv/virt: virt-acpi-build.c: Add basic ACPI tables, Bin Meng, 2023/02/06
- Re: [PATCH 04/10] hw/riscv/virt: virt-acpi-build.c: Add basic ACPI tables, Sunil V L, 2023/02/06
- Re: [PATCH 04/10] hw/riscv/virt: virt-acpi-build.c: Add basic ACPI tables,
Bin Meng <=
- Re: [PATCH 04/10] hw/riscv/virt: virt-acpi-build.c: Add basic ACPI tables, Sunil V L, 2023/02/07
- Re: [PATCH 04/10] hw/riscv/virt: virt-acpi-build.c: Add basic ACPI tables, Bin Meng, 2023/02/07
- Re: [PATCH 04/10] hw/riscv/virt: virt-acpi-build.c: Add basic ACPI tables, Sunil V L, 2023/02/07
- Re: [PATCH 04/10] hw/riscv/virt: virt-acpi-build.c: Add basic ACPI tables, Igor Mammedov, 2023/02/24
[PATCH 05/10] hw/riscv/virt: virt-acpi-build.c: Add RINTC in MADT, Sunil V L, 2023/02/01
[PATCH 06/10] hw/riscv/virt: virt-acpi-build.c: Add RHCT Table, Sunil V L, 2023/02/01
[PATCH 08/10] hw/riscv/Kconfig: virt: Enable ACPI config options, Sunil V L, 2023/02/01