Re: [PATCH v13 2/7] hw/core/machine: topology functions capabilities added

2025-06-16 Thread Jonathan Cameron via
On Wed, 11 Jun 2025 16:56:13 +0100
Alireza Sanaee  wrote:

> Add two functions one of which finds the lowest level cache defined in
> the cache description input, and the other checks if caches are defined
> at a particular level.
> 
> Signed-off-by: Alireza Sanaee 
> ---
>  hw/core/machine-smp.c | 52 +++
>  include/hw/boards.h   |  7 ++
>  2 files changed, 59 insertions(+)
> 
> diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c
> index 0be0ac044c..a4d79e0aa4 100644
> --- a/hw/core/machine-smp.c
> +++ b/hw/core/machine-smp.c

> +
> +bool machine_check_cache_at_topo_level(const MachineState *ms,

Maybe avoid machine_check naming. It has too many other meanings!

machine_is_cache_at_topo_level() perhaps?

> +   CpuTopologyLevel level)
> +{
> +if (machine_get_cache_topo_level(ms, CACHE_LEVEL_AND_TYPE_L3) == level ||
> +machine_get_cache_topo_level(ms, CACHE_LEVEL_AND_TYPE_L2) == level ||
> +machine_get_cache_topo_level(ms, CACHE_LEVEL_AND_TYPE_L1I) == level 
> ||
> +machine_get_cache_topo_level(ms, CACHE_LEVEL_AND_TYPE_L1D) == level) 
> {
> +return true;
> +}
> +return false;
> +}





Re: [PATCH v13 2/7] hw/core/machine: topology functions capabilities added

2025-06-12 Thread Zhao Liu
On Wed, Jun 11, 2025 at 04:56:13PM +0100, Alireza Sanaee wrote:
> Date: Wed, 11 Jun 2025 16:56:13 +0100
> From: Alireza Sanaee 
> Subject: [PATCH v13 2/7] hw/core/machine: topology functions capabilities
>  added
> X-Mailer: git-send-email 2.34.1
> 
> Add two functions one of which finds the lowest level cache defined in
> the cache description input, and the other checks if caches are defined
> at a particular level.
> 
> Signed-off-by: Alireza Sanaee 
> ---
>  hw/core/machine-smp.c | 52 +++
>  include/hw/boards.h   |  7 ++
>  2 files changed, 59 insertions(+)

Reviewed-by: Zhao Liu