From: Jonathan Cameron via <qemu-arm@nongnu.org>
To: Alireza Sanaee <alireza.sanaee@huawei.com>, <linuxarm@huawei.com>
Cc: <qemu-devel@nongnu.org>, <qemu-arm@nongnu.org>,
<zhao1.liu@intel.com>, <zhenyu.z.wang@intel.com>,
<dapeng1.mi@linux.intel.com>, <yongwei.ma@intel.com>,
<armbru@redhat.com>, <farman@linux.ibm.com>,
<peter.maydell@linaro.org>, <mst@redhat.com>,
<anisinha@redhat.com>, <shannon.zhaosl@gmail.com>,
<imammedo@redhat.com>, <mtosatti@redhat.com>,
<berrange@redhat.com>, <richard.henderson@linaro.org>,
<shameerali.kolothum.thodi@huawei.com>,
<Jonathan.Cameron@Huawei.com>, <jiangkunkun@huawei.com>,
<yangyicong@hisilicon.com>, <sarsanaee@gmail.com>
Subject: Re: [PATCH v4 2/7] target/arm/tcg: increase cache level for cpu=max
Date: Mon, 23 Dec 2024 17:47:20 +0000 [thread overview]
Message-ID: <20241223174720.0000358e@huawei.com> (raw)
In-Reply-To: <20241216175414.1953-3-alireza.sanaee@huawei.com>
On Mon, 16 Dec 2024 17:54:09 +0000
Alireza Sanaee <alireza.sanaee@huawei.com> wrote:
> This patch addresses cache description in the `aarch64_max_tcg_initfn`
> function for cpu=max. It introduces three layers of caches and modifies
> the cache description registers accordingly.
>
> Signed-off-by: Alireza Sanaee <alireza.sanaee@huawei.com>
I think this makes sense as a MAX cpu with out an L3 sounds pretty minimal
and it provides a way to exercise the rest of this series in TCG. For KVM
it will come from host registers (or overridden ones) anyway.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> target/arm/tcg/cpu64.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c
> index 904a7e90b4..47d8c9c9ae 100644
> --- a/target/arm/tcg/cpu64.c
> +++ b/target/arm/tcg/cpu64.c
> @@ -1086,6 +1086,19 @@ void aarch64_max_tcg_initfn(Object *obj)
> uint64_t t;
> uint32_t u;
>
> + /*
> + * Expanded cache set
> + */
> + cpu->clidr = 0x8200123; /* 4 4 3 in 3 bit fields */
> + /* 64KB L1 dcache */
> + cpu->ccsidr[0] = make_ccsidr(CCSIDR_FORMAT_LEGACY, 4, 64, 64 * KiB, 7);
> + /* 64KB L1 icache */
> + cpu->ccsidr[1] = make_ccsidr(CCSIDR_FORMAT_LEGACY, 4, 64, 64 * KiB, 2);
> + /* 1MB L2 unified cache */
> + cpu->ccsidr[2] = make_ccsidr(CCSIDR_FORMAT_LEGACY, 8, 64, 1 * MiB, 7);
> + /* 2MB L3 unified cache */
> + cpu->ccsidr[4] = make_ccsidr(CCSIDR_FORMAT_LEGACY, 8, 64, 2 * MiB, 7);
> +
> /*
> * Unset ARM_FEATURE_BACKCOMPAT_CNTFRQ, which we would otherwise default
> * to because we started with aarch64_a57_initfn(). A 'max' CPU might
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Alireza Sanaee <alireza.sanaee@huawei.com>, <linuxarm@huawei.com>
Cc: <qemu-devel@nongnu.org>, <qemu-arm@nongnu.org>,
<zhao1.liu@intel.com>, <zhenyu.z.wang@intel.com>,
<dapeng1.mi@linux.intel.com>, <yongwei.ma@intel.com>,
<armbru@redhat.com>, <farman@linux.ibm.com>,
<peter.maydell@linaro.org>, <mst@redhat.com>,
<anisinha@redhat.com>, <shannon.zhaosl@gmail.com>,
<imammedo@redhat.com>, <mtosatti@redhat.com>,
<berrange@redhat.com>, <richard.henderson@linaro.org>,
<shameerali.kolothum.thodi@huawei.com>,
<Jonathan.Cameron@Huawei.com>, <jiangkunkun@huawei.com>,
<yangyicong@hisilicon.com>, <sarsanaee@gmail.com>
Subject: Re: [PATCH v4 2/7] target/arm/tcg: increase cache level for cpu=max
Date: Mon, 23 Dec 2024 17:47:20 +0000 [thread overview]
Message-ID: <20241223174720.0000358e@huawei.com> (raw)
In-Reply-To: <20241216175414.1953-3-alireza.sanaee@huawei.com>
On Mon, 16 Dec 2024 17:54:09 +0000
Alireza Sanaee <alireza.sanaee@huawei.com> wrote:
> This patch addresses cache description in the `aarch64_max_tcg_initfn`
> function for cpu=max. It introduces three layers of caches and modifies
> the cache description registers accordingly.
>
> Signed-off-by: Alireza Sanaee <alireza.sanaee@huawei.com>
I think this makes sense as a MAX cpu with out an L3 sounds pretty minimal
and it provides a way to exercise the rest of this series in TCG. For KVM
it will come from host registers (or overridden ones) anyway.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> target/arm/tcg/cpu64.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c
> index 904a7e90b4..47d8c9c9ae 100644
> --- a/target/arm/tcg/cpu64.c
> +++ b/target/arm/tcg/cpu64.c
> @@ -1086,6 +1086,19 @@ void aarch64_max_tcg_initfn(Object *obj)
> uint64_t t;
> uint32_t u;
>
> + /*
> + * Expanded cache set
> + */
> + cpu->clidr = 0x8200123; /* 4 4 3 in 3 bit fields */
> + /* 64KB L1 dcache */
> + cpu->ccsidr[0] = make_ccsidr(CCSIDR_FORMAT_LEGACY, 4, 64, 64 * KiB, 7);
> + /* 64KB L1 icache */
> + cpu->ccsidr[1] = make_ccsidr(CCSIDR_FORMAT_LEGACY, 4, 64, 64 * KiB, 2);
> + /* 1MB L2 unified cache */
> + cpu->ccsidr[2] = make_ccsidr(CCSIDR_FORMAT_LEGACY, 8, 64, 1 * MiB, 7);
> + /* 2MB L3 unified cache */
> + cpu->ccsidr[4] = make_ccsidr(CCSIDR_FORMAT_LEGACY, 8, 64, 2 * MiB, 7);
> +
> /*
> * Unset ARM_FEATURE_BACKCOMPAT_CNTFRQ, which we would otherwise default
> * to because we started with aarch64_a57_initfn(). A 'max' CPU might
next prev parent reply other threads:[~2024-12-23 17:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 17:54 [RFC PATCH v4 0/7] Specifying cache topology on ARM Alireza Sanaee via
2024-12-16 17:54 ` Alireza Sanaee via
2024-12-16 17:54 ` [PATCH v4 1/7] i386/cpu: add IsDefined flag to smp-cache property Alireza Sanaee via
2024-12-16 17:54 ` Alireza Sanaee via
2024-12-23 17:48 ` Jonathan Cameron via
2024-12-23 17:48 ` Jonathan Cameron via
2024-12-24 8:41 ` Alireza Sanaee via
2024-12-24 8:41 ` Alireza Sanaee via
2024-12-24 10:24 ` Zhao Liu
2024-12-16 17:54 ` [PATCH v4 2/7] target/arm/tcg: increase cache level for cpu=max Alireza Sanaee via
2024-12-16 17:54 ` Alireza Sanaee via
2024-12-23 17:47 ` Jonathan Cameron via [this message]
2024-12-23 17:47 ` Jonathan Cameron via
2024-12-16 17:54 ` [PATCH v4 3/7] arm/virt.c: add cache hierarchy to device tree Alireza Sanaee via
2024-12-16 17:54 ` Alireza Sanaee via
2024-12-23 18:09 ` Jonathan Cameron via
2024-12-23 18:09 ` Jonathan Cameron via
2024-12-16 17:54 ` [PATCH v4 4/7] bios-tables-test: prepare to change ARM ACPI virt PPTT Alireza Sanaee via
2024-12-16 17:54 ` [PATCH v4 5/7] hw/acpi/aml-build.c: add cache hierarchy to pptt table Alireza Sanaee via
2024-12-16 17:54 ` Alireza Sanaee via
2024-12-16 17:54 ` [PATCH v4 6/7] tests/qtest/bios-table-test: testing new ARM ACPI PPTT topology Alireza Sanaee via
2024-12-16 17:54 ` Alireza Sanaee via
2024-12-23 18:11 ` Jonathan Cameron via
2024-12-23 18:11 ` Jonathan Cameron via
2024-12-24 8:44 ` Alireza Sanaee via
2024-12-24 8:44 ` Alireza Sanaee via
2024-12-16 17:54 ` [PATCH v4 7/7] Update the ACPI tables according to the acpi aml_build change, also empty bios-tables-test-allowed-diff.h Alireza Sanaee via
2024-12-16 17:54 ` Alireza Sanaee via
2024-12-23 18:13 ` Jonathan Cameron via
2024-12-23 18:13 ` Jonathan Cameron via
2024-12-24 8:53 ` Alireza Sanaee via
2024-12-24 8:53 ` 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=20241223174720.0000358e@huawei.com \
--to=qemu-arm@nongnu.org \
--cc=Jonathan.Cameron@Huawei.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=farman@linux.ibm.com \
--cc=imammedo@redhat.com \
--cc=jiangkunkun@huawei.com \
--cc=linuxarm@huawei.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sarsanaee@gmail.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=shannon.zhaosl@gmail.com \
--cc=yangyicong@hisilicon.com \
--cc=yongwei.ma@intel.com \
--cc=zhao1.liu@intel.com \
--cc=zhenyu.z.wang@intel.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.