All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: arm64: Fix kvm_get_vtcr() kernel-doc
@ 2026-09-09  6:31 Karl Mehltretter
  2026-09-09  7:36 ` Fuad Tabba
  0 siblings, 1 reply; 4+ messages in thread
From: Karl Mehltretter @ 2026-09-09  6:31 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton
  Cc: Karl Mehltretter, Quentin Perret, Fuad Tabba, Joey Gouly,
	Steffen Eiden, Suzuki K Poulose, Zenghui Yu, Catalin Marinas,
	Will Deacon, Mark Rutland, linux-arm-kernel, kvmarm, linux-kernel

kvm_get_vtcr() takes a parameter named phys_shift, but its kernel-doc
describes phys_shfit. This leaves the real parameter undescribed and
adds an excess parameter description to the generated documentation.

Correct the spelling.

Fixes: bcb25a2b86b4 ("KVM: arm64: Refactor kvm_arm_setup_stage2()")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
 arch/arm64/include/asm/kvm_pgtable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h
index 41a8687938eb..c078cfedce19 100644
--- a/arch/arm64/include/asm/kvm_pgtable.h
+++ b/arch/arm64/include/asm/kvm_pgtable.h
@@ -532,7 +532,7 @@ u64 kvm_pgtable_hyp_unmap(struct kvm_pgtable *pgt, u64 addr, u64 size);
  * kvm_get_vtcr() - Helper to construct VTCR_EL2
  * @mmfr0:	Sanitized value of SYS_ID_AA64MMFR0_EL1 register.
  * @mmfr1:	Sanitized value of SYS_ID_AA64MMFR1_EL1 register.
- * @phys_shfit:	Value to set in VTCR_EL2.T0SZ.
+ * @phys_shift:	Value to set in VTCR_EL2.T0SZ.
  *
  * The VTCR value is common across all the physical CPUs on the system.
  * We use system wide sanitised values to fill in different fields,

base-commit: 893e11787f78e43b534e252249ac3fff4d1333f8
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] KVM: arm64: Fix kvm_get_vtcr() kernel-doc
  2026-09-09  6:31 [PATCH] KVM: arm64: Fix kvm_get_vtcr() kernel-doc Karl Mehltretter
@ 2026-09-09  7:36 ` Fuad Tabba
  2026-09-10  2:54   ` Karl Mehltretter
  2026-09-10 19:05   ` [PATCH v2] " Karl Mehltretter
  0 siblings, 2 replies; 4+ messages in thread
From: Fuad Tabba @ 2026-09-09  7:36 UTC (permalink / raw)
  To: Karl Mehltretter
  Cc: Marc Zyngier, Oliver Upton, Quentin Perret, Joey Gouly,
	Steffen Eiden, Suzuki K Poulose, Zenghui Yu, Catalin Marinas,
	Will Deacon, Mark Rutland, linux-arm-kernel, kvmarm, linux-kernel

Hi Karl,

...

Good catch, I'm a fan of documentation fixes :)

While you're on that line, the description is also inaccurate, so you
could fix both in one go and save a follow-up touching the same line:

> - * @phys_shfit:        Value to set in VTCR_EL2.T0SZ.
> + * @phys_shift:        Value to set in VTCR_EL2.T0SZ.

kvm_get_vtcr() sets T0SZ to 64 - phys_shift, so phys_shift isn't the
value written to the field, it's the IPA size in bits. Something like:

     * @phys_shift:    IPA size, in bits.

Cheers,
/fuad

>
> base-commit: 893e11787f78e43b534e252249ac3fff4d1333f8
> --
> 2.53.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] KVM: arm64: Fix kvm_get_vtcr() kernel-doc
  2026-09-09  7:36 ` Fuad Tabba
@ 2026-09-10  2:54   ` Karl Mehltretter
  2026-09-10 19:05   ` [PATCH v2] " Karl Mehltretter
  1 sibling, 0 replies; 4+ messages in thread
From: Karl Mehltretter @ 2026-09-10  2:54 UTC (permalink / raw)
  To: Fuad Tabba
  Cc: Marc Zyngier, Oliver Upton, Quentin Perret, Joey Gouly,
	Steffen Eiden, Suzuki K Poulose, Zenghui Yu, Catalin Marinas,
	Will Deacon, Mark Rutland, linux-arm-kernel, kvmarm, linux-kernel

On Wed, Sep 09, 2026 at 08:36:40AM +0100, Fuad Tabba wrote:
> Hi Karl,
> While you're on that line, the description is also inaccurate, so you
> could fix both in one go and save a follow-up touching the same line:
> 
> > - * @phys_shfit:        Value to set in VTCR_EL2.T0SZ.
> > + * @phys_shift:        Value to set in VTCR_EL2.T0SZ.
> 
> kvm_get_vtcr() sets T0SZ to 64 - phys_shift, so phys_shift isn't the
> value written to the field, it's the IPA size in bits. Something like:
> 
>      * @phys_shift:    IPA size, in bits.
> 

Hi Fuad. 

well spotted. A typo seldom comes alone :)

I'll fix that.

Thanks,
Karl


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] KVM: arm64: Fix kvm_get_vtcr() kernel-doc
  2026-09-09  7:36 ` Fuad Tabba
  2026-09-10  2:54   ` Karl Mehltretter
@ 2026-09-10 19:05   ` Karl Mehltretter
  1 sibling, 0 replies; 4+ messages in thread
From: Karl Mehltretter @ 2026-09-10 19:05 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton
  Cc: Karl Mehltretter, Quentin Perret, Fuad Tabba, Joey Gouly,
	Steffen Eiden, Suzuki K Poulose, Zenghui Yu, Catalin Marinas,
	Will Deacon, Mark Rutland, linux-arm-kernel, kvmarm, linux-kernel

kvm_get_vtcr() takes a parameter named phys_shift, but its kernel-doc
describes phys_shfit. This leaves the real parameter undescribed and
adds an excess parameter description to the generated documentation.

Correct the spelling and describe phys_shift as the IPA size in bits.
The value written to VTCR_EL2.T0SZ is 64 - phys_shift, rather than
phys_shift itself.

Fixes: bcb25a2b86b4 ("KVM: arm64: Refactor kvm_arm_setup_stage2()")
Suggested-by: Fuad Tabba <fuad.tabba@linux.dev>
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
Changes in v2:
- Describe phys_shift as the IPA size in bits (Fuad).

 arch/arm64/include/asm/kvm_pgtable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h
index 41a8687938eb..20d12da3d28e 100644
--- a/arch/arm64/include/asm/kvm_pgtable.h
+++ b/arch/arm64/include/asm/kvm_pgtable.h
@@ -532,7 +532,7 @@ u64 kvm_pgtable_hyp_unmap(struct kvm_pgtable *pgt, u64 addr, u64 size);
  * kvm_get_vtcr() - Helper to construct VTCR_EL2
  * @mmfr0:	Sanitized value of SYS_ID_AA64MMFR0_EL1 register.
  * @mmfr1:	Sanitized value of SYS_ID_AA64MMFR1_EL1 register.
- * @phys_shfit:	Value to set in VTCR_EL2.T0SZ.
+ * @phys_shift:	IPA size, in bits.
  *
  * The VTCR value is common across all the physical CPUs on the system.
  * We use system wide sanitised values to fill in different fields,

base-commit: 893e11787f78e43b534e252249ac3fff4d1333f8
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-10 19:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-09  6:31 [PATCH] KVM: arm64: Fix kvm_get_vtcr() kernel-doc Karl Mehltretter
2026-09-09  7:36 ` Fuad Tabba
2026-09-10  2:54   ` Karl Mehltretter
2026-09-10 19:05   ` [PATCH v2] " Karl Mehltretter

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.