From: Zenghui Yu <zenghui.yu@linux.dev>
To: Mark Brown <broonie@kernel.org>, Marc Zyngier <maz@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>,
James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>
Cc: Joey Gouly <joey.gouly@arm.com>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev
Subject: Re: [PATCH v5 1/2] arm64: Add feature detection for fine grained traps
Date: Sun, 16 Jul 2023 22:44:01 +0800 [thread overview]
Message-ID: <d5d26d8e-e1ba-b6a2-0643-f3a6c2c667d4@linux.dev> (raw)
In-Reply-To: <20230712-kvm-arm64-fgt-v5-1-dae3ec236288@kernel.org>
On 2023/7/12 20:50, Mark Brown wrote:
> In order to allow us to have shared code for managing fine grained traps
> for KVM guests add it as a detected feature rather than relying on it
> being a dependency of other features.
>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
> arch/arm64/kernel/cpufeature.c | 11 +++++++++++
> arch/arm64/tools/cpucaps | 1 +
> 2 files changed, 12 insertions(+)
>
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index f9d456fe132d..0768f98c49cc 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -2627,6 +2627,17 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
> .matches = has_cpuid_feature,
> ARM64_CPUID_FIELDS(ID_AA64ISAR1_EL1, LRCPC, IMP)
> },
> + {
> + .desc = "Fine Grained Traps",
> + .type = ARM64_CPUCAP_SYSTEM_FEATURE,
> + .capability = ARM64_HAS_FGT,
> + .sys_reg = SYS_ID_AA64MMFR0_EL1,
> + .sign = FTR_UNSIGNED,
> + .field_pos = ID_AA64MMFR0_EL1_FGT_SHIFT,
> + .field_width = 4,
> + .min_field_value = 1,
> + .matches = has_cpuid_feature,
> + },
Any reason not to use the ARM64_CPUID_FIELDS() helper?
Zenghui
WARNING: multiple messages have this Message-ID (diff)
From: Zenghui Yu <zenghui.yu@linux.dev>
To: Mark Brown <broonie@kernel.org>, Marc Zyngier <maz@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>,
James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>
Cc: Joey Gouly <joey.gouly@arm.com>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev
Subject: Re: [PATCH v5 1/2] arm64: Add feature detection for fine grained traps
Date: Sun, 16 Jul 2023 22:44:01 +0800 [thread overview]
Message-ID: <d5d26d8e-e1ba-b6a2-0643-f3a6c2c667d4@linux.dev> (raw)
In-Reply-To: <20230712-kvm-arm64-fgt-v5-1-dae3ec236288@kernel.org>
On 2023/7/12 20:50, Mark Brown wrote:
> In order to allow us to have shared code for managing fine grained traps
> for KVM guests add it as a detected feature rather than relying on it
> being a dependency of other features.
>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
> arch/arm64/kernel/cpufeature.c | 11 +++++++++++
> arch/arm64/tools/cpucaps | 1 +
> 2 files changed, 12 insertions(+)
>
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index f9d456fe132d..0768f98c49cc 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -2627,6 +2627,17 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
> .matches = has_cpuid_feature,
> ARM64_CPUID_FIELDS(ID_AA64ISAR1_EL1, LRCPC, IMP)
> },
> + {
> + .desc = "Fine Grained Traps",
> + .type = ARM64_CPUCAP_SYSTEM_FEATURE,
> + .capability = ARM64_HAS_FGT,
> + .sys_reg = SYS_ID_AA64MMFR0_EL1,
> + .sign = FTR_UNSIGNED,
> + .field_pos = ID_AA64MMFR0_EL1_FGT_SHIFT,
> + .field_width = 4,
> + .min_field_value = 1,
> + .matches = has_cpuid_feature,
> + },
Any reason not to use the ARM64_CPUID_FIELDS() helper?
Zenghui
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-16 14:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 12:50 [PATCH v5 0/2] KVM: arm64: Support for per-guest fine grained traps configuration Mark Brown
2023-07-12 12:50 ` Mark Brown
2023-07-12 12:50 ` [PATCH v5 1/2] arm64: Add feature detection for fine grained traps Mark Brown
2023-07-12 12:50 ` Mark Brown
2023-07-16 14:44 ` Zenghui Yu [this message]
2023-07-16 14:44 ` Zenghui Yu
2023-07-16 14:46 ` Mark Brown
2023-07-16 14:46 ` Mark Brown
2023-07-12 12:50 ` [PATCH v5 2/2] KVM: arm64: Move FGT value configuration to vCPU state Mark Brown
2023-07-12 12:50 ` Mark Brown
2023-07-13 9:48 ` Suzuki K Poulose
2023-07-13 9:48 ` Suzuki K Poulose
2023-07-13 15:15 ` Mark Brown
2023-07-13 15:15 ` Mark Brown
2023-07-13 15:22 ` Suzuki K Poulose
2023-07-13 15:22 ` Suzuki K Poulose
2023-07-13 15:22 ` Marc Zyngier
2023-07-13 15:22 ` Marc Zyngier
2023-07-13 15:35 ` Mark Brown
2023-07-13 15:35 ` Mark Brown
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=d5d26d8e-e1ba-b6a2-0643-f3a6c2c667d4@linux.dev \
--to=zenghui.yu@linux.dev \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=joey.gouly@arm.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=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 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.