qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Yicong Yang <yangyicong@huawei.com>
Cc: imammedo@redhat.com, ani@anisinha.ca, eduardo@habkost.net,
	marcel.apfelbaum@gmail.com, f4bug@amsat.org,
	wangyanan55@huawei.com, qemu-devel@nongnu.org,
	jonathan.cameron@huawei.com, linuxarm@huawei.com,
	yangyicong@hisilicon.com, prime.zeng@huawei.com,
	hesham.almatary@huawei.com, ionela.voinescu@arm.com,
	darren@os.amperecomputing.com
Subject: Re: [PATCH 1/4] hw/acpi/aml-build: Only generate cluster node in PPTT when specified
Date: Fri, 7 Oct 2022 09:48:05 -0400	[thread overview]
Message-ID: <20221007094701-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20220922131143.58003-2-yangyicong@huawei.com>

On Thu, Sep 22, 2022 at 09:11:40PM +0800, Yicong Yang wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
> 
> Currently we'll always generate a cluster node no matter user has
> specified '-smp clusters=X' or not. Cluster is an optional level
> and it's unncessary to build it if user don't need. So only generate
> it when user specify explicitly.
> 
> Also update the test ACPI tables.
> 
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>

This is an example of a commit log repeating what the patch does.
Which is ok but the important thing is to explain the motivation -
why is it a bug to generate a cluster node without '-smp clusters'?


> ---
>  hw/acpi/aml-build.c   | 2 +-
>  hw/core/machine-smp.c | 3 +++
>  include/hw/boards.h   | 2 ++
>  3 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index e6bfac95c7..aab73af66d 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -2030,7 +2030,7 @@ void build_pptt(GArray *table_data, BIOSLinker *linker, MachineState *ms,
>                  0, socket_id, NULL, 0);
>          }
>  
> -        if (mc->smp_props.clusters_supported) {
> +        if (mc->smp_props.clusters_supported && ms->smp.build_cluster) {
>              if (cpus->cpus[n].props.cluster_id != cluster_id) {
>                  assert(cpus->cpus[n].props.cluster_id > cluster_id);
>                  cluster_id = cpus->cpus[n].props.cluster_id;
> diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c
> index b39ed21e65..5d37e8d07a 100644
> --- a/hw/core/machine-smp.c
> +++ b/hw/core/machine-smp.c
> @@ -158,6 +158,9 @@ void machine_parse_smp_config(MachineState *ms,
>      ms->smp.threads = threads;
>      ms->smp.max_cpus = maxcpus;
>  
> +    if (config->has_clusters)
> +        ms->smp.build_cluster = true;
> +
>      /* sanity-check of the computed topology */
>      if (sockets * dies * clusters * cores * threads != maxcpus) {
>          g_autofree char *topo_msg = cpu_hierarchy_to_string(ms);
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index 7b416c9787..24aafc213d 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -305,6 +305,7 @@ typedef struct DeviceMemoryState {
>   * @cores: the number of cores in one cluster
>   * @threads: the number of threads in one core
>   * @max_cpus: the maximum number of logical processors on the machine
> + * @build_cluster: build cluster topology or not
>   */
>  typedef struct CpuTopology {
>      unsigned int cpus;
> @@ -314,6 +315,7 @@ typedef struct CpuTopology {
>      unsigned int cores;
>      unsigned int threads;
>      unsigned int max_cpus;
> +    bool build_cluster;
>  } CpuTopology;
>  
>  /**
> -- 
> 2.24.0



  reply	other threads:[~2022-10-07 15:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 13:11 [PATCH 0/4] Only generate cluster node in PPTT when specified Yicong Yang via
2022-09-22 13:11 ` [PATCH 1/4] hw/acpi/aml-build: " Yicong Yang via
2022-10-07 13:48   ` Michael S. Tsirkin [this message]
2022-10-12  2:15     ` Yicong Yang via
2022-10-09  6:46   ` wangyanan (Y) via
2022-10-12  2:12     ` Yicong Yang via
2022-09-22 13:11 ` [PATCH 2/4] tests: virt: update expected ACPI tables for virt test Yicong Yang via
2022-09-22 13:11 ` [PATCH 3/4] tests: acpi: aarch64: add topology test for aarch64 Yicong Yang via
2022-09-22 13:11 ` [PATCH 4/4] tests: acpi: aarch64: add *.topology tables Yicong Yang via
2022-09-22 14:31 ` [PATCH 0/4] Only generate cluster node in PPTT when specified Jonathan Cameron via
2022-09-23  7:50   ` Yicong Yang via
2022-10-07 13:46 ` Michael S. Tsirkin
2022-10-26 14:52 ` Michael S. Tsirkin
2022-10-27  3:06   ` Yicong Yang via

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=20221007094701-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=darren@os.amperecomputing.com \
    --cc=eduardo@habkost.net \
    --cc=f4bug@amsat.org \
    --cc=hesham.almatary@huawei.com \
    --cc=imammedo@redhat.com \
    --cc=ionela.voinescu@arm.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linuxarm@huawei.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=prime.zeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wangyanan55@huawei.com \
    --cc=yangyicong@hisilicon.com \
    --cc=yangyicong@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).