hw/core: Add a helper to check the cache topology level
authorZhao Liu <zhao1.liu@intel.com>
Fri, 1 Nov 2024 08:33:27 +0000 (16:33 +0800)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 5 Nov 2024 23:32:25 +0000 (23:32 +0000)
commit07995a46bae9d2ec0971b435834c60a4df84b03f
tree56b2a09a4cd529a8f342e0c64e9501e96a6ce23f
parentf35c0221fef864e65db7641bb041c5f913e31475
hw/core: Add a helper to check the cache topology level

Currently, we have no way to expose the arch-specific default cache
model because the cache model is sometimes related to the CPU model
(e.g., i386).

Since the user might configure "default" level, any comparison with
"default" is meaningless before the machine knows the specific level
that "default" refers to.

We can only check the correctness of the cache topology after the arch
loads the user-configured cache model from MachineState.smp_cache and
consumes the special "default" level by replacing it with the specific
level.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-ID: <20241101083331.340178-6-zhao1.liu@intel.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/core/machine-smp.c
include/hw/boards.h