All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Auger <eauger@redhat.com>
To: Yanan Wang <wangyanan55@huawei.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Andrew Jones <drjones@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, Shannon Zhao <shannon.zhaosl@gmail.com>,
	qemu-arm@nongnu.org, Alistair Francis <alistair.francis@wdc.com>,
	wanghaibin.wang@huawei.com,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH v8 4/8] hw/acpi/aml-build: Add Processor hierarchy node structure
Date: Wed, 20 Oct 2021 09:43:32 +0200	[thread overview]
Message-ID: <3089e3c8-0eb0-3360-357d-4ba82ede8952@redhat.com> (raw)
In-Reply-To: <20211014132206.19220-5-wangyanan55@huawei.com>

Hi

On 10/14/21 3:22 PM, Yanan Wang wrote:
> Add a generic API to build Processor hierarchy node structure (Type 0),
> which is strictly consistent with descriptions in ACPI 6.2: 5.2.29.1.
> 
> This function will be used to build ACPI PPTT table for cpu topology.
> 
> Co-developed-by: Ying Fang <fangying1@huawei.com>
> Co-developed-by: Henglong Fan <fanhenglong@huawei.com>
> Co-developed-by: Yanan Wang <wangyanan55@huawei.com>
> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
> Reviewed-by: Andrew Jones <drjones@redhat.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  hw/acpi/aml-build.c         | 26 ++++++++++++++++++++++++++
>  include/hw/acpi/aml-build.h |  4 ++++
>  2 files changed, 30 insertions(+)
> 
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index 76af0ebaf9..b7b9db6888 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -1964,6 +1964,32 @@ void build_slit(GArray *table_data, BIOSLinker *linker, MachineState *ms,
>      acpi_table_end(linker, &table);
>  }
>  
> +/* ACPI 6.2: 5.2.29.1 Processor hierarchy node structure (Type 0) */
> +void build_processor_hierarchy_node(GArray *tbl, uint32_t flags,
> +                                    uint32_t parent, uint32_t id,
> +                                    uint32_t *priv_rsrc, uint32_t priv_num)
> +{
> +    int i;
> +
> +    build_append_byte(tbl, 0);                 /* Type 0 - processor */
nit: I think Igor would generally prefer
build_append_byte(tbl, 0 /* processor structure */);  /* Type */
although it generates checkpatch warnings

> +    build_append_byte(tbl, 20 + priv_num * 4); /* Length */
> +    build_append_int_noprefix(tbl, 0, 2);      /* Reserved */
> +    build_append_int_noprefix(tbl, flags, 4);  /* Flags */
> +    build_append_int_noprefix(tbl, parent, 4); /* Parent */
> +    build_append_int_noprefix(tbl, id, 4);     /* ACPI Processor ID */
> +
> +    /* Number of private resources */
> +    build_append_int_noprefix(tbl, priv_num, 4);
> +
> +    /* Private resources[N] */
> +    if (priv_num > 0) {
> +        assert(priv_rsrc);
> +        for (i = 0; i < priv_num; i++) {
> +            build_append_int_noprefix(tbl, priv_rsrc[i], 4);
> +        }
> +    }
> +}
> +
>  /* build rev1/rev3/rev5.1 FADT */
>  void build_fadt(GArray *tbl, BIOSLinker *linker, const AcpiFadtData *f,
>                  const char *oem_id, const char *oem_table_id)
> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
> index 3cf6f2c1b9..2c457c8f17 100644
> --- a/include/hw/acpi/aml-build.h
> +++ b/include/hw/acpi/aml-build.h
> @@ -489,6 +489,10 @@ void build_srat_memory(GArray *table_data, uint64_t base,
>  void build_slit(GArray *table_data, BIOSLinker *linker, MachineState *ms,
>                  const char *oem_id, const char *oem_table_id);
>  
> +void build_processor_hierarchy_node(GArray *tbl, uint32_t flags,
> +                                    uint32_t parent, uint32_t id,
> +                                    uint32_t *priv_rsrc, uint32_t priv_num);
> +
>  void build_fadt(GArray *tbl, BIOSLinker *linker, const AcpiFadtData *f,
>                  const char *oem_id, const char *oem_table_id);
>  
> 
Besides
Reviewed-by: Eric Auger <eric.auger@redhat.com>


Eric



  reply	other threads:[~2021-10-20  7:59 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 13:21 [PATCH v8 0/8] hw/arm/virt: Introduce cpu topology support Yanan Wang
2021-10-14 13:21 ` [PATCH v8 1/8] hw/arm/virt: Only describe cpu topology since virt-6.2 Yanan Wang
2021-10-14 13:22 ` [PATCH v8 2/8] device_tree: Add qemu_fdt_add_path Yanan Wang
2021-10-14 13:22 ` [PATCH v8 3/8] hw/arm/virt: Add cpu-map to device tree Yanan Wang
2021-10-14 13:22 ` [PATCH v8 4/8] hw/acpi/aml-build: Add Processor hierarchy node structure Yanan Wang
2021-10-20  7:43   ` Eric Auger [this message]
2021-10-20  9:51     ` wangyanan (Y)
2021-10-20 10:04       ` Michael S. Tsirkin
2021-10-20 12:32         ` wangyanan (Y)
2021-10-14 13:22 ` [PATCH v8 5/8] hw/acpi/aml-build: Add PPTT table Yanan Wang
2021-10-20  8:02   ` Eric Auger
2021-10-20  9:51     ` wangyanan (Y)
2021-10-20 11:11       ` Eric Auger
2021-10-20 12:27         ` wangyanan (Y)
2021-10-20 12:43           ` Eric Auger
2021-10-20 12:53             ` wangyanan (Y)
2021-10-21  9:08               ` Andrew Jones
2021-10-21  9:25                 ` wangyanan (Y)
2021-10-14 13:22 ` [PATCH v8 6/8] tests/data/acpi/virt: Add an empty expected file for PPTT Yanan Wang
2021-10-20  1:41   ` wangyanan (Y)
2021-10-20  7:12   ` Eric Auger
2021-10-14 13:22 ` [PATCH v8 7/8] hw/arm/virt-acpi-build: Generate PPTT table Yanan Wang
2021-10-20  8:05   ` Eric Auger
2021-10-20  9:51     ` wangyanan (Y)
2021-10-14 13:22 ` [PATCH v8 8/8] tests/data/acpi/virt: Update the empty expected file for PPTT Yanan Wang
2021-10-20  1:41   ` wangyanan (Y)
2021-10-20  1:41 ` [PATCH v8 0/8] hw/arm/virt: Introduce cpu topology support wangyanan (Y)

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=3089e3c8-0eb0-3360-357d-4ba82ede8952@redhat.com \
    --to=eauger@redhat.com \
    --cc=alistair.francis@wdc.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=drjones@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shannon.zhaosl@gmail.com \
    --cc=wanghaibin.wang@huawei.com \
    --cc=wangyanan55@huawei.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 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.