All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Gavin Shan <gshan@redhat.com>
Cc: peter.maydell@linaro.org, drjones@redhat.com,
	richard.henderson@linaro.org, qemu-devel@nongnu.org,
	zhenyzha@redhat.com, wangyanan55@huawei.com, qemu-arm@nongnu.org,
	shan.gavin@gmail.com
Subject: Re: [PATCH v3 4/4] hw/arm/virt: Unify ACPI processor ID in MADT and SRAT table
Date: Fri, 25 Mar 2022 15:00:20 +0100	[thread overview]
Message-ID: <20220325150020.0063c782@redhat.com> (raw)
In-Reply-To: <20220323072438.71815-5-gshan@redhat.com>

On Wed, 23 Mar 2022 15:24:38 +0800
Gavin Shan <gshan@redhat.com> wrote:

> The value of the following field has been used in ACPI PPTT table
> to identify the corresponding processor. This takes the same field
> as the ACPI processor ID in MADT and SRAT tables.
> 
>   ms->possible_cpus->cpus[i].props.thread_id

thread-id could be something different than ACPI processor ID
(to be discussed in the first patch).

I'd prefer to keep both decoupled, i.e. use [0 - possible_cpus->len)
for ACPI processor ID as it's done with x86 madt/srat and ACPI CPU
hotplug code. So we could reuse at least the later when implementing
CPU hotplug for arm/virt and it's good from consistency point of view.

> Signed-off-by: Gavin Shan <gshan@redhat.com>
> ---
>  hw/arm/virt-acpi-build.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 449fab0080..7fedb56eea 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -534,13 +534,16 @@ build_srat(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>  
>      for (i = 0; i < cpu_list->len; ++i) {
>          uint32_t nodeid = cpu_list->cpus[i].props.node_id;
> +        uint32_t thread_id = cpu_list->cpus[i].props.thread_id;
> +
>          /*
>           * 5.2.16.4 GICC Affinity Structure
>           */
>          build_append_int_noprefix(table_data, 3, 1);      /* Type */
>          build_append_int_noprefix(table_data, 18, 1);     /* Length */
>          build_append_int_noprefix(table_data, nodeid, 4); /* Proximity Domain */
> -        build_append_int_noprefix(table_data, i, 4); /* ACPI Processor UID */
> +        build_append_int_noprefix(table_data,
> +                                  thread_id, 4); /* ACPI Processor UID */
>          /* Flags, Table 5-76 */
>          build_append_int_noprefix(table_data, 1 /* Enabled */, 4);
>          build_append_int_noprefix(table_data, 0, 4); /* Clock Domain */
> @@ -704,6 +707,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>  {
>      int i;
>      VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
> +    MachineState *ms = MACHINE(vms);
>      const MemMapEntry *memmap = vms->memmap;
>      AcpiTable table = { .sig = "APIC", .rev = 3, .oem_id = vms->oem_id,
>                          .oem_table_id = vms->oem_table_id };
> @@ -725,8 +729,9 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>      build_append_int_noprefix(table_data, vms->gic_version, 1);
>      build_append_int_noprefix(table_data, 0, 3);   /* Reserved */
>  
> -    for (i = 0; i < MACHINE(vms)->smp.cpus; i++) {
> +    for (i = 0; i < ms->smp.cpus; i++) {
>          ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(i));
> +        uint32_t thread_id = ms->possible_cpus->cpus[i].props.thread_id;
>          uint64_t physical_base_address = 0, gich = 0, gicv = 0;
>          uint32_t vgic_interrupt = vms->virt ? PPI(ARCH_GIC_MAINT_IRQ) : 0;
>          uint32_t pmu_interrupt = arm_feature(&armcpu->env, ARM_FEATURE_PMU) ?
> @@ -743,7 +748,8 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
>          build_append_int_noprefix(table_data, 76, 1);   /* Length */
>          build_append_int_noprefix(table_data, 0, 2);    /* Reserved */
>          build_append_int_noprefix(table_data, i, 4);    /* GIC ID */
> -        build_append_int_noprefix(table_data, i, 4);    /* ACPI Processor UID */
> +        build_append_int_noprefix(table_data,
> +                                  thread_id, 4);        /* ACPI Processor UID */
>          /* Flags */
>          build_append_int_noprefix(table_data, 1, 4);    /* Enabled */
>          /* Parking Protocol Version */


  reply	other threads:[~2022-03-25 14:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23  7:24 [PATCH v3 0/4] hw/arm/virt: Fix CPU's default NUMA node ID Gavin Shan
2022-03-23  7:24 ` [PATCH v3 1/4] hw/arm/virt: Consider SMP configuration in CPU topology Gavin Shan
2022-03-25 13:19   ` Igor Mammedov
2022-03-25 18:49     ` Gavin Shan
2022-03-30 12:50       ` Igor Mammedov
2022-04-02  2:27         ` wangyanan (Y) via
2022-04-02  2:27           ` wangyanan (Y) via
2022-04-03 10:46         ` Gavin Shan
2022-03-30 13:18   ` Igor Mammedov
2022-04-03 10:48     ` Gavin Shan
2022-04-02  2:17   ` wangyanan (Y) via
2022-04-02  2:17     ` wangyanan (Y) via
2022-04-03 11:55     ` Gavin Shan
2022-03-23  7:24 ` [PATCH v3 2/4] hw/arm/virt: Fix CPU's default NUMA node ID Gavin Shan
2022-03-25 13:25   ` Igor Mammedov
2022-04-02  2:02   ` wangyanan (Y) via
2022-04-02  2:02     ` wangyanan (Y) via
2022-04-03 11:57     ` Gavin Shan
2022-03-23  7:24 ` [PATCH v3 3/4] hw/acpi/aml-build: Use existing CPU topology to build PPTT table Gavin Shan
2022-03-30 14:10   ` Igor Mammedov
2022-04-03 14:40     ` Gavin Shan
2022-03-23  7:24 ` [PATCH v3 4/4] hw/arm/virt: Unify ACPI processor ID in MADT and SRAT table Gavin Shan
2022-03-25 14:00   ` Igor Mammedov [this message]
2022-03-25 19:08     ` Gavin Shan
2022-03-30 12:52       ` Igor Mammedov
2022-04-03 10:43         ` Gavin Shan

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=20220325150020.0063c782@redhat.com \
    --to=imammedo@redhat.com \
    --cc=drjones@redhat.com \
    --cc=gshan@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shan.gavin@gmail.com \
    --cc=wangyanan55@huawei.com \
    --cc=zhenyzha@redhat.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.