[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 01/19] cpus: Add argument to qemu_get_cpu() to filter CPU
From: |
Peter Maydell |
Subject: |
Re: [RFC PATCH 01/19] cpus: Add argument to qemu_get_cpu() to filter CPUs by QOM type |
Date: |
Fri, 20 Oct 2023 18:40:09 +0100 |
On Fri, 20 Oct 2023 at 18:29, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Hi Peter,
>
> On 20/10/23 19:14, Peter Maydell wrote:
> > So overall there are some places where figuring out the right
> > replacement for qemu_get_cpu() is tricky, and some places where
> > it's probably fairly straightforward but just an annoying
> > amount of extra code to write, and some places where we don't
> > care because we know the board model is not heterogenous.
> > But I don't think "filter by CPU architecture type" is usually
> > going to be what we want.
>
> Thank for these feedbacks. I agree the correct way to fix that
> is a tedious case by case audit, most often using link properties.
>
> "we know the board model is not heterogeneous" but we want to
> link such board/model altogether in a single binary, using common
> APIs.
This seems to me like a different thing -- just compiling
the different boards into one binary. That should be fine:
in this single-binary qemu, if you tell it -M foo that's an arm
board then qemu_get_cpu() returns the CPUs that are created,
and those will all be Arm. If you tell it -M bar that's a PPC
board, then qemu_get_cpu() will return the CPUs that are
created, and those will all be PPC. The assumptions of the
code that's currently calling qemu_get_cpu() or using the
first_cpu global won't be broken. It shouldn't need us to
change a lot of code that we don't intend to try to use in a
heterogenous-at-runtime setup.
thanks
-- PMM
- [PATCH 00/19] cpus: Step toward removing global 'first_cpu', Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 02/19] cpus: Filter for target specific CPU (generic), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 03/19] cpus: Filter for target specific CPU (arm), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 05/19] cpus: Filter for target specific CPU (mips), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 06/19] cpus: Filter for target specific CPU (s390x), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 04/19] cpus: Filter for target specific CPU (loongarch), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 07/19] cpus: Filter for target specific CPU (riscv), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 08/19] cpus: Filter for target specific CPU (ppc), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 09/19] cpus: Filter for target specific CPU (x86), Philippe Mathieu-Daudé, 2023/10/20