[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 21/30] target/ppc: Introduce PowerPCCPUClass::has_work()
- To: Richard Henderson <richard.henderson@xxxxxxxxxx>, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>, Cédric Le Goater <clg@xxxxxxxx>, Greg Kurz <groug@xxxxxxxx>
- From: Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>
- Date: Sun, 12 Sep 2021 00:31:31 +0200
- Cc: Peter Maydell <peter.maydell@xxxxxxxxxx>, Chris Wulff <crwulff@xxxxxxxxx>, kvm@xxxxxxxxxxxxxxx, David Hildenbrand <david@xxxxxxxxxx>, Bin Meng <bin.meng@xxxxxxxxxxxxx>, Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx>, qemu-devel@xxxxxxxxxx, Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, Taylor Simpson <tsimpson@xxxxxxxxxxx>, haxm-team@xxxxxxxxx, Colin Xu <colin.xu@xxxxxxxxx>, Sunil Muthuswamy <sunilmut@xxxxxxxxxxxxx>, Marek Vasut <marex@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Kamil Rytarowski <kamil@xxxxxxxxxx>, Reinoud Zandijk <reinoud@xxxxxxxxxx>, Claudio Fontana <cfontana@xxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Artyom Tarasenko <atar4qemu@xxxxxxxxx>, Laurent Vivier <lvivier@xxxxxxxxxx>, Thomas Huth <thuth@xxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, Cameron Esfahani <dirty@xxxxxxxxx>, qemu-s390x@xxxxxxxxxx, qemu-arm@xxxxxxxxxx, Michael Rolnik <mrolnik@xxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, qemu-ppc@xxxxxxxxxx, Stafford Horne <shorne@xxxxxxxxx>, qemu-riscv@xxxxxxxxxx, Bastian Koppelmann <kbastian@xxxxxxxxxxxxxxxxxxxxx>, Cornelia Huck <cohuck@xxxxxxxxxx>, Roman Bolshakov <r.bolshakov@xxxxxxxxx>, Laurent Vivier <laurent@xxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Wenchao Wang <wenchao.wang@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxxx>, Aurelien Jarno <aurelien@xxxxxxxxxxx>
- Delivery-date: Sat, 11 Sep 2021 22:31:55 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 9/3/21 11:11 PM, Philippe Mathieu-Daudé wrote:
> On 9/3/21 10:42 PM, Richard Henderson wrote:
>> On 9/3/21 2:50 AM, David Gibson wrote:
>>> On Thu, Sep 02, 2021 at 06:15:34PM +0200, Philippe Mathieu-Daudé wrote:
>>>> Each POWER cpu has its own has_work() implementation. Instead of
>>>> overloading CPUClass on each PowerPCCPUClass init, register the
>>>> generic ppc_cpu_has_work() handler, and have it call the POWER
>>>> specific has_work().
>>>
>>> I don't quite see the rationale for introducing a second layer of
>>> indirection here. What's wrong with switching the base has_work for
>>> each cpu variant?
>>
>> We're moving the hook from CPUState to TCGCPUOps.
>> Phil was trying to avoid creating N versions of
>>
>> static const struct TCGCPUOps ppc_tcg_ops = {
>> ...
>> };
>
> Ah yes this is the reason! Too many context switching so
> I forgot about it.
>
>> A plausible alternative is to remove the const from this struct and
>> modify it, just as we do for CPUState, on the assumption that we cannot
>> mix and match ppc cpu types in any one machine.
>
> I thought about this case and remembered how it works on the ARM arch,
> i.e. ZynqMP machine uses both Cortex-R5F and Cortex-A53. Even if no
> similar PPC machine exists, IMHO we should try to generally allow to
> possibility to experiment machine with different CPUs. Restricting it
> on PPC goes the other way around. Thoughts?
I'm running out of ideas to do avoid the indirection and multiple
copies of TCGCPUOps. I'm not giving up, I suppose I'm simply not
seeing it... David, any suggestions?
|