From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
"Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
qemu-arm@nongnu.org, Shannon Zhao <shannon.zhao@linaro.org>,
Shannon Zhao <zhaoshenglong@huawei.com>
Subject: Re: [Qemu-devel] [Qemu-arm] [PATCH] ARM: ACPI: Fix MPIDR value in ACPI table
Date: Mon, 2 Nov 2015 20:33:47 -0800 [thread overview]
Message-ID: <CAPokK=q9G22p6LZFcnzpjuNo2KntmstQDTeoVTSmmAx-Tw3S1Q@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA9d2VLd=3spu_3Ji+Zw_pRJr_yEQUjyh87Av6c7wHHE-w@mail.gmail.com>
On Sat, Oct 31, 2015 at 5:04 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 31 October 2015 at 18:53, Peter Crosthwaite
> <crosthwaitepeter@gmail.com> wrote:
>> On Sat, Oct 31, 2015 at 2:50 AM, Shannon Zhao <zhaoshenglong@huawei.com> wrote:
>>> From: Shannon Zhao <shannon.zhao@linaro.org>
>>>
>>> Use mp_affinity of ARMCPU as the CPU MPIDR instead of the CPU index.
>>>
>>> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
>>> ---
>>> 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?
>
> This is just doing the same thing the hw/arm/virt.c code does
> to populate the dt... (In real firmware it would presumably
> either (a) have a fixed ACPI table or (b) maybe read the MPIDR,
> but neither of those really fits here I think.)
So, I think this is just another case of the MPIDR information flow
going the wrong way. It should go from board to all of CPU, DT and now
this. I guess we can just fix this incrementally when we fix the
implicit setting of MPIDR in mach-virt.
Regards,
Peter
>
> thanks
> -- PMM
next prev parent reply other threads:[~2015-11-03 4:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-31 9:50 [Qemu-devel] [PATCH] ARM: ACPI: Fix MPIDR value in ACPI table Shannon Zhao
2015-10-31 18:53 ` [Qemu-devel] [Qemu-arm] " Peter Crosthwaite
2015-11-01 0:04 ` Peter Maydell
2015-11-03 4:33 ` Peter Crosthwaite [this message]
2015-11-03 8:15 ` Peter Maydell
2015-11-03 13:32 ` [Qemu-devel] " Peter Maydell
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='CAPokK=q9G22p6LZFcnzpjuNo2KntmstQDTeoVTSmmAx-Tw3S1Q@mail.gmail.com' \
--to=crosthwaitepeter@gmail.com \
--cc=peter.huangpeng@huawei.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shannon.zhao@linaro.org \
--cc=zhaoshenglong@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).