[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH] ARM: ACPI: Fix MPIDR value in ACPI table
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-arm] [PATCH] ARM: ACPI: Fix MPIDR value in ACPI table |
Date: |
Sat, 31 Oct 2015 11:53:03 -0700 |
On Sat, Oct 31, 2015 at 2:50 AM, Shannon Zhao <address@hidden> wrote:
> From: Shannon Zhao <address@hidden>
>
> Use mp_affinity of ARMCPU as the CPU MPIDR instead of the CPU index.
>
> Signed-off-by: Shannon Zhao <address@hidden>
> ---
> This patch is based on below patch.
> http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg06919.html
>
> hw/arm/virt-acpi-build.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 29a1980..1c621cb 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -451,13 +451,15 @@ build_madt(GArray *table_data, GArray *linker,
> VirtGuestInfo *guest_info,
> for (i = 0; i < guest_info->smp_cpus; i++) {
> AcpiMadtGenericInterrupt *gicc = acpi_data_push(table_data,
> sizeof *gicc);
> + ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(i));
> +
> gicc->type = ACPI_APIC_GENERIC_INTERRUPT;
> gicc->length = sizeof(*gicc);
> if (guest_info->gic_version == 2) {
> gicc->base_address = memmap[VIRT_GIC_CPU].base;
> }
> gicc->cpu_interface_number = i;
> - gicc->arm_mpidr = i;
> + gicc->arm_mpidr = armcpu->mp_affinity;
As a general rule, hw/ should not be reaching into the CPU state
struct like this. What is the real HW equivalent of this query?
Regards,
Peter
> gicc->uid = i;
> if (test_bit(i, cpuinfo->found_cpus)) {
> gicc->flags = cpu_to_le32(ACPI_GICC_ENABLED);
> --
> 2.0.4
>
>
>