From: Zhao Liu <zhao1.liu@intel.com>
To: Alireza Sanaee <alireza.sanaee@huawei.com>
Cc: qemu-devel@nongnu.org, anisinha@redhat.com, armbru@redhat.com,
berrange@redhat.com, dapeng1.mi@linux.intel.com,
eric.auger@redhat.com, farman@linux.ibm.com,
gustavo.romero@linaro.org, imammedo@redhat.com,
jiangkunkun@huawei.com, jonathan.cameron@huawei.com,
linuxarm@huawei.com, maobibo@loongson.cn, mst@redhat.com,
mtosatti@redhat.com, peter.maydell@linaro.org, philmd@linaro.org,
qemu-arm@nongnu.org, richard.henderson@linaro.org,
shameerali.kolothum.thodi@huawei.com, shannon.zhaosl@gmail.com,
yangyicong@hisilicon.com
Subject: Re: [PATCH v14 2/7] hw/core/machine: topology functions capabilities added
Date: Tue, 8 Jul 2025 17:02:52 +0800 [thread overview]
Message-ID: <aGzevGnyfOM4WyKJ@intel.com> (raw)
In-Reply-To: <20250707121908.155-3-alireza.sanaee@huawei.com>
On Mon, Jul 07, 2025 at 01:19:03PM +0100, Alireza Sanaee via wrote:
> Date: Mon, 7 Jul 2025 13:19:03 +0100
> From: Alireza Sanaee via <qemu-devel@nongnu.org>
> Subject: [PATCH v14 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 <alireza.sanaee@huawei.com>
> ---
> hw/core/machine-smp.c | 59 +++++++++++++++++++++++++++++++++++++++++++
> include/hw/boards.h | 7 +++++
> 2 files changed, 66 insertions(+)
>
> diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c
> index 0be0ac044c..4baf4a878e 100644
> --- a/hw/core/machine-smp.c
> +++ b/hw/core/machine-smp.c
> @@ -406,3 +406,62 @@ bool machine_check_smp_cache(const MachineState *ms, Error **errp)
>
> return true;
> }
> +
> +/*
> + * This function assumes l3 and l2 have unified cache and l1 is split l1d
> + * and l1i, and further prepares the lowest cache level for a topology
> + * level. The info will be fed to build_caches to create caches at the
> + * right level.
> + */
> +bool machine_find_lowest_level_cache_at_topo_level(const MachineState *ms,
> + int *level_found,
> + CpuTopologyLevel topo_level)
> +{
> +
> + CpuTopologyLevel level;
> +
> + level = machine_get_cache_topo_level(ms, CACHE_LEVEL_AND_TYPE_L1I);
> + if (level == topo_level) {
> + *level_found = 1;
Unfortunately, there is no proper mapping between the cache enumeration
and the cache level...
> + return true;
> + }
> +
...at least for now, this is fine for me. We can think of how to
organize everything better afterwards. So,
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
next prev parent reply other threads:[~2025-07-08 21:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 12:19 [PATCH v14 0/7] Specifying cache topology on ARM Alireza Sanaee via
2025-07-07 12:19 ` Alireza Sanaee via
2025-07-07 12:19 ` [PATCH v14 1/7] target/arm/tcg: increase cache level for cpu=max Alireza Sanaee via
2025-07-07 12:19 ` Alireza Sanaee via
2025-07-07 12:19 ` [PATCH v14 2/7] hw/core/machine: topology functions capabilities added Alireza Sanaee via
2025-07-07 12:19 ` Alireza Sanaee via
2025-07-08 9:02 ` Zhao Liu [this message]
2025-07-07 12:19 ` [PATCH v14 3/7] hw/arm/virt: add cache hierarchy to device tree Alireza Sanaee via
2025-07-07 12:19 ` Alireza Sanaee via
2025-07-07 12:19 ` [PATCH v14 4/7] bios-tables-test: prepare to change ARM ACPI virt PPTT Alireza Sanaee via
2025-07-07 12:19 ` Alireza Sanaee via
2025-07-07 12:19 ` [PATCH v14 5/7] hw/acpi: add cache hierarchy to pptt table Alireza Sanaee via
2025-07-07 12:19 ` Alireza Sanaee via
2025-07-13 21:15 ` Michael S. Tsirkin
2025-07-14 9:59 ` Alireza Sanaee via
2025-07-14 9:59 ` Alireza Sanaee via
2025-07-14 10:11 ` Michael S. Tsirkin
2025-07-14 10:20 ` Alireza Sanaee via
2025-07-14 10:20 ` Alireza Sanaee via
2025-07-07 12:19 ` [PATCH v14 6/7] tests/qtest/bios-table-test: testing new ARM ACPI PPTT topology Alireza Sanaee via
2025-07-07 12:19 ` Alireza Sanaee via
2025-07-07 12:19 ` [PATCH v14 7/7] Update the ACPI tables based on new aml-build.c Alireza Sanaee via
2025-07-07 12:19 ` Alireza Sanaee via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aGzevGnyfOM4WyKJ@intel.com \
--to=zhao1.liu@intel.com \
--cc=alireza.sanaee@huawei.com \
--cc=anisinha@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=dapeng1.mi@linux.intel.com \
--cc=eric.auger@redhat.com \
--cc=farman@linux.ibm.com \
--cc=gustavo.romero@linaro.org \
--cc=imammedo@redhat.com \
--cc=jiangkunkun@huawei.com \
--cc=jonathan.cameron@huawei.com \
--cc=linuxarm@huawei.com \
--cc=maobibo@loongson.cn \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=shannon.zhaosl@gmail.com \
--cc=yangyicong@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.