[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/5] hw/cpu/cluster: Restrict CPU cluster to a particular CPU
From: |
Peter Maydell |
Subject: |
Re: [PATCH 3/5] hw/cpu/cluster: Restrict CPU cluster to a particular CPU type |
Date: |
Tue, 21 Feb 2023 17:59:06 +0000 |
On Thu, 16 Feb 2023 at 14:23, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> CPU cluster id is used by TCG accelerator to "group" CPUs
> sharing the same ISA features, so TranslationBlock can be
> shared between the cluster (see commit f7b78602fd "accel/tcg:
> Add cluster number to TCG TB hash"). This mean we shouldn't
> mix different kind of CPUs into the same cluster.
>
> Enforce that by adding a 'cpu-type' property. The cluster's
> realize() method will check all children are of that 'cpu-type'
> class.
>
> If the property is not set, the first CPU added to a cluster
> sets its CPU type, and only that type fo CPU can be added.
This seems like a reasonable extra assertion to add.
It won't catch all accidental "wrong thing put into
cluster" bugs (you can still put two differently
configured CPUs of the same type in a cluster) but it's
better than nothing.
Personally I think I would just have the "check they're
all the same type" guard, rather than having the board
code set a property explicitly.
thanks
-- PMM
- [PATCH 0/5] hw/cpu/cluster: Restrict CPU cluster to a particular CPU type, Philippe Mathieu-Daudé, 2023/02/16
- [PATCH 1/5] hw/cpu: Extend CPUState::cluster_index documentation, Philippe Mathieu-Daudé, 2023/02/16
- [PATCH 2/5] hw/cpu/cluster: Only add CPU objects to CPU cluster, Philippe Mathieu-Daudé, 2023/02/16
- [PATCH 3/5] hw/cpu/cluster: Restrict CPU cluster to a particular CPU type, Philippe Mathieu-Daudé, 2023/02/16
- Re: [PATCH 3/5] hw/cpu/cluster: Restrict CPU cluster to a particular CPU type,
Peter Maydell <=
- [PATCH 4/5] hw/arm: Restrict CPU clusters to the expected type, Philippe Mathieu-Daudé, 2023/02/16
- [PATCH 5/5] hw/riscv: Restrict CPU clusters to the expected type, Philippe Mathieu-Daudé, 2023/02/16