From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
To: James Morse <james.morse@arm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>
Cc: Marc Zyngier <maz@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
yuzenghui <yuzenghui@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Jing Zhang <jingzhangos@google.com>,
"Wangzhou (B)" <wangzhou1@hisilicon.com>
Subject: RE: [PATCH v3 2/6] arm64: cpufeature: discover CPU support for MPAM
Date: Fri, 28 Jun 2024 08:23:42 +0000 [thread overview]
Message-ID: <b61717873ad84b5d874a5b0b502208a9@huawei.com> (raw)
In-Reply-To: <20240321165728.31907-3-james.morse@arm.com>
> -----Original Message-----
> From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org> On
> Behalf Of James Morse
> Sent: Thursday, March 21, 2024 4:57 PM
> To: linux-arm-kernel@lists.infradead.org; kvmarm@lists.linux.dev
> Cc: Marc Zyngier <maz@kernel.org>; Oliver Upton <oliver.upton@linux.dev>;
> Suzuki K Poulose <suzuki.poulose@arm.com>; yuzenghui
> <yuzenghui@huawei.com>; Catalin Marinas <catalin.marinas@arm.com>; Will
> Deacon <will@kernel.org>; Jing Zhang <jingzhangos@google.com>; James
> Morse <james.morse@arm.com>
> Subject: [PATCH v3 2/6] arm64: cpufeature: discover CPU support for MPAM
>
> ARMv8.4 adds support for 'Memory Partitioning And Monitoring' (MPAM)
> which describes an interface to cache and bandwidth controls wherever
> they appear in the system.
>
> Add support to detect MPAM. Like SVE, MPAM has an extra id register that
> describes some more properties, including the virtualisation support,
> which is optional. Detect this separately so we can detect
> mismatched/insane systems, but still use MPAM on the host even if the
> virtualisation support is missing.
>
> MPAM needs enabling at the highest implemented exception level, otherwise
> the register accesses trap. The 'enabled' flag is accessible to lower
> exception levels, but its in a register that traps when MPAM isn't enabled.
> The cpufeature 'matches' hook is extended to test this on one of the
> CPUs, so that firmware can emulate MPAM as disabled if it is reserved
> for use by secure world.
>
> Secondary CPUs that appear late could trip cpufeature's 'lower safe'
> behaviour after the MPAM properties have been advertised to user-space.
> Add a verify call to ensure late secondaries match the existing CPUs.
>
> (If you have a boot failure that bisects here its likely your CPUs
> advertise MPAM in the id registers, but firmware failed to either enable
> or MPAM, or emulate the trap as if it were disabled)
>
> Signed-off-by: James Morse <james.morse@arm.com>
> ---
> @@ -2852,6 +2912,15 @@ static const struct arm64_cpu_capabilities
> arm64_features[] = {
> ARM64_CPUID_FIELDS(ID_AA64MMFR0_EL1, TGRAN16,
> 52_BIT)
> #endif
> #endif
> +#endif
> +#ifdef CONFIG_ARM64_MPAM
> + {
> + .desc = "Memory Partitioning And Monitoring",
> + .type = ARM64_CPUCAP_SYSTEM_FEATURE,
> + .capability = ARM64_MPAM,
> + .matches = test_has_mpam,
> + .cpu_enable = cpu_enable_mpam,
> + ARM64_CPUID_FIELDS(ID_AA64PFR0_EL1, MPAM, 1)
> },
> #endif
This one gives me a compile error as seems to miss the" }," for the above
ARM64_VA_BITS_52. Please check.
Thanks,
Shameer
next prev parent reply other threads:[~2024-06-28 8:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-21 16:57 [PATCH v3 0/6] KVM: arm64: Hide unsupported MPAM from the guest James Morse
2024-03-21 16:57 ` [PATCH v3 1/6] arm64: head.S: Initialise MPAM EL2 registers and disable traps James Morse
2024-03-21 16:57 ` [PATCH v3 2/6] arm64: cpufeature: discover CPU support for MPAM James Morse
2024-04-12 14:41 ` Will Deacon
2024-06-28 8:23 ` Shameerali Kolothum Thodi [this message]
2024-03-21 16:57 ` [PATCH v3 3/6] KVM: arm64: Fix missing traps of guest accesses to the MPAM registers James Morse
2024-03-21 16:57 ` [PATCH v3 4/6] KVM: arm64: Disable MPAM visibility by default and ignore VMM writes James Morse
2024-06-28 8:10 ` Shameerali Kolothum Thodi
2024-08-27 8:58 ` Shameerali Kolothum Thodi
2024-03-21 16:57 ` [PATCH v3 5/6] KVM: arm64: selftests: Move the bulky macro invocation to a helper James Morse
2024-03-21 16:57 ` [PATCH v3 6/6] KVM: arm64: selftests: Test ID_AA64PFR0.MPAM isn't completely ignored James Morse
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=b61717873ad84b5d874a5b0b502208a9@huawei.com \
--to=shameerali.kolothum.thodi@huawei.com \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=jingzhangos@google.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=suzuki.poulose@arm.com \
--cc=wangzhou1@hisilicon.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).