* [PATCH 0/2] KVM: arm64: Fine grained traps documentation clarification
@ 2024-07-31 18:58 Mark Brown
2024-07-31 18:58 ` [PATCH 1/2] KVM: arm64: Fix outdated comment about incomplete FGT bitmask definitions Mark Brown
2024-07-31 18:58 ` [PATCH 2/2] KVM: arm64: Clarify meaning of _MASK and _nMASK for FGT registers Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Mark Brown @ 2024-07-31 18:58 UTC (permalink / raw)
To: Marc Zyngier, Oliver Upton, James Morse, Suzuki K Poulose,
Catalin Marinas, Will Deacon, Fuad Tabba
Cc: linux-arm-kernel, kvmarm, linux-kernel, Mark Brown
When looking at the code for management of fine grained traps I noticed
that some comments were out of date, and that there's some potentially
suprising usage which could usefully be clarified.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
Mark Brown (2):
KVM: arm64: Fix outdated comment about incomplete FGT bitmask definitions
KVM: arm64: Clarify meaning of _MASK and _nMASK for FGT registers
arch/arm64/include/asm/kvm_arm.h | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
---
base-commit: 8400291e289ee6b2bf9779ff1c83a291501f017b
change-id: 20240730-kvm-arm64-fgt-doc-a664856fa7d6
Best regards,
--
Mark Brown <broonie@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/2] KVM: arm64: Fix outdated comment about incomplete FGT bitmask definitions
2024-07-31 18:58 [PATCH 0/2] KVM: arm64: Fine grained traps documentation clarification Mark Brown
@ 2024-07-31 18:58 ` Mark Brown
2024-07-31 19:55 ` Marc Zyngier
2024-07-31 18:58 ` [PATCH 2/2] KVM: arm64: Clarify meaning of _MASK and _nMASK for FGT registers Mark Brown
1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2024-07-31 18:58 UTC (permalink / raw)
To: Marc Zyngier, Oliver Upton, James Morse, Suzuki K Poulose,
Catalin Marinas, Will Deacon, Fuad Tabba
Cc: linux-arm-kernel, kvmarm, linux-kernel, Mark Brown
Comments in the code say that our definitions for the FGT registers are not
the generated ones and are updated only as far as DDI0487 J.a however in
commit 9ff67dd26a9e ("KVM: arm64: Use generated FGT RES0 bits instead of
specifying them") we updated to use the generated definitions, and as of
the release of DDI0487 K.a the XML in DD0601 is in sync with the ARM.
Remove the outdated comment about divergence.
Fixes: 9ff67dd26a9e ("KVM: arm64: Use generated FGT RES0 bits instead of specifying them")
Signed-off-by: Mark Brown <broonie@kernel.org>
---
arch/arm64/include/asm/kvm_arm.h | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index d81cc746e0eb..d347483395b4 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -342,12 +342,7 @@
/*
* FGT register definitions
*
- * RES0 and polarity masks as of DDI0487J.a, to be updated as needed.
- * We're not using the generated masks as they are usually ahead of
- * the published ARM ARM, which we use as a reference.
- *
- * Once we get to a point where the two describe the same thing, we'll
- * merge the definitions. One day.
+ * RES0 and polarity masks for the FGT registers.
*/
#define __HFGRTR_EL2_RES0 HFGxTR_EL2_RES0
#define __HFGRTR_EL2_MASK GENMASK(49, 0)
--
2.39.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/2] KVM: arm64: Fix outdated comment about incomplete FGT bitmask definitions
2024-07-31 18:58 ` [PATCH 1/2] KVM: arm64: Fix outdated comment about incomplete FGT bitmask definitions Mark Brown
@ 2024-07-31 19:55 ` Marc Zyngier
0 siblings, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2024-07-31 19:55 UTC (permalink / raw)
To: Mark Brown
Cc: Oliver Upton, James Morse, Suzuki K Poulose, Catalin Marinas,
Will Deacon, Fuad Tabba, linux-arm-kernel, kvmarm, linux-kernel
On Wed, 31 Jul 2024 19:58:37 +0100,
Mark Brown <broonie@kernel.org> wrote:
>
> Comments in the code say that our definitions for the FGT registers are not
> the generated ones and are updated only as far as DDI0487 J.a however in
> commit 9ff67dd26a9e ("KVM: arm64: Use generated FGT RES0 bits instead of
> specifying them") we updated to use the generated definitions, and as of
> the release of DDI0487 K.a the XML in DD0601 is in sync with the ARM.
s/ARM/ARM ARM/. Which revision of the XML? K.a and the latest version
of the XML are definitely not in sync.
Also, please make use of punctuation. I can't parse this *single*
sentence as it stands.
> Remove the outdated comment about divergence.
>
> Fixes: 9ff67dd26a9e ("KVM: arm64: Use generated FGT RES0 bits instead of specifying them")
Definitely *not* a fix.
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] KVM: arm64: Clarify meaning of _MASK and _nMASK for FGT registers
2024-07-31 18:58 [PATCH 0/2] KVM: arm64: Fine grained traps documentation clarification Mark Brown
2024-07-31 18:58 ` [PATCH 1/2] KVM: arm64: Fix outdated comment about incomplete FGT bitmask definitions Mark Brown
@ 2024-07-31 18:58 ` Mark Brown
2024-07-31 20:12 ` Marc Zyngier
1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2024-07-31 18:58 UTC (permalink / raw)
To: Marc Zyngier, Oliver Upton, James Morse, Suzuki K Poulose,
Catalin Marinas, Will Deacon, Fuad Tabba
Cc: linux-arm-kernel, kvmarm, linux-kernel, Mark Brown
Since the use of _MASK to mean bits where setting the bit causes traps to
be generated is a little unusual add a clarifying comment.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
arch/arm64/include/asm/kvm_arm.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index d347483395b4..1d8745740fb1 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -343,6 +343,10 @@
* FGT register definitions
*
* RES0 and polarity masks for the FGT registers.
+ *
+ * _RES0: Bits which are RES0
+ * _MASK: Bits which enable traps when set
+ * _nMASK: Bits which disable traps when set
*/
#define __HFGRTR_EL2_RES0 HFGxTR_EL2_RES0
#define __HFGRTR_EL2_MASK GENMASK(49, 0)
--
2.39.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] KVM: arm64: Clarify meaning of _MASK and _nMASK for FGT registers
2024-07-31 18:58 ` [PATCH 2/2] KVM: arm64: Clarify meaning of _MASK and _nMASK for FGT registers Mark Brown
@ 2024-07-31 20:12 ` Marc Zyngier
0 siblings, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2024-07-31 20:12 UTC (permalink / raw)
To: Mark Brown
Cc: Oliver Upton, James Morse, Suzuki K Poulose, Catalin Marinas,
Will Deacon, Fuad Tabba, linux-arm-kernel, kvmarm, linux-kernel
On Wed, 31 Jul 2024 19:58:38 +0100,
Mark Brown <broonie@kernel.org> wrote:
>
> Since the use of _MASK to mean bits where setting the bit causes traps to
> be generated is a little unusual add a clarifying comment.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
> arch/arm64/include/asm/kvm_arm.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
> index d347483395b4..1d8745740fb1 100644
> --- a/arch/arm64/include/asm/kvm_arm.h
> +++ b/arch/arm64/include/asm/kvm_arm.h
> @@ -343,6 +343,10 @@
> * FGT register definitions
> *
> * RES0 and polarity masks for the FGT registers.
> + *
> + * _RES0: Bits which are RES0
> + * _MASK: Bits which enable traps when set
> + * _nMASK: Bits which disable traps when set
The rest of the code call this "negative polarity". Also, in some
cases (such as with HCRX_EL2), such bits are *enable* bits. So you
probably want to capture this as well.
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-31 20:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31 18:58 [PATCH 0/2] KVM: arm64: Fine grained traps documentation clarification Mark Brown
2024-07-31 18:58 ` [PATCH 1/2] KVM: arm64: Fix outdated comment about incomplete FGT bitmask definitions Mark Brown
2024-07-31 19:55 ` Marc Zyngier
2024-07-31 18:58 ` [PATCH 2/2] KVM: arm64: Clarify meaning of _MASK and _nMASK for FGT registers Mark Brown
2024-07-31 20:12 ` Marc Zyngier
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).