[PATCH v2 0/4] KVM: arm64: Handle unsupported guest translation granule sizes

Wei-Lin Chang posted 4 patches 2 months ago
arch/arm64/kvm/at.c     | 125 ++++++++++++++++++++++++++--------
arch/arm64/kvm/nested.c | 144 +++++++++++++++++++++++++++-------------
2 files changed, 196 insertions(+), 73 deletions(-)
[PATCH v2 0/4] KVM: arm64: Handle unsupported guest translation granule sizes
Posted by Wei-Lin Chang 2 months ago
Hi,

This is v2 of fixing the granule size selection for software stage-1
and stage-2 walks. Thanks to Marc for the feedback on v1 ([1]).

* Changes from v1:

  - Take the entire (v)tcr value for TGx decode helpers.

  - Rename vtcr_to_walk_info() to setup_s2_walk() as preparation, also
    pass vcpu as the argument instead of kvm.

  - Use TCR_* instead of TCR_EL1_* definitions.

  - Return unsigned int instead of u64 when returning a granule shift.

  - Split unit changes in get_guest_mapping_ttl() and
    compute_tlb_inval_range() into its own patch.

Thanks!

[1]: https://lore.kernel.org/kvmarm/20260406164618.3312473-1-weilin.chang@arm.com/

Wei-Lin Chang (4):
  KVM: arm64: nv: Rename vtcr_to_walk_info() to setup_s2_walk()
  KVM: arm64: Factor out TG0/1 decoding of VTCR and TCR
  KVM: arm64: nv: Use literal granule size in TLBI range calculation
  KVM: arm64: Fallback to a supported value for unsupported guest TGx

 arch/arm64/kvm/at.c     | 125 ++++++++++++++++++++++++++--------
 arch/arm64/kvm/nested.c | 144 +++++++++++++++++++++++++++-------------
 2 files changed, 196 insertions(+), 73 deletions(-)

-- 
2.43.0
Re: [PATCH v2 0/4] KVM: arm64: Handle unsupported guest translation granule sizes
Posted by Marc Zyngier 2 weeks, 4 days ago
On Tue, 14 Apr 2026 01:03:30 +0100, Wei-Lin Chang wrote:
> This is v2 of fixing the granule size selection for software stage-1
> and stage-2 walks. Thanks to Marc for the feedback on v1 ([1]).
> 
> * Changes from v1:
> 
>   - Take the entire (v)tcr value for TGx decode helpers.
> 
> [...]

Applied to next, thanks!

[1/4] KVM: arm64: nv: Rename vtcr_to_walk_info() to setup_s2_walk()
      commit: a878096e0e86b44e758aafc6b26af97e8f548673
[2/4] KVM: arm64: Factor out TG0/1 decoding of VTCR and TCR
      commit: d7768b4f718503e79e7c626d29e9131b747148ee
[3/4] KVM: arm64: nv: Use literal granule size in TLBI range calculation
      commit: b154da8288add1f6fb958797d0b3462800f9fc77
[4/4] KVM: arm64: Fallback to a supported value for unsupported guest TGx
      commit: 8853566dfbab1a255ae72676ab5ec43e1631ddb7

Cheers,

	M.
-- 
Without deviation from the norm, progress is not possible.
Re: [PATCH v2 0/4] KVM: arm64: Handle unsupported guest translation granule sizes
Posted by Wei-Lin Chang 2 weeks, 4 days ago
On Thu, May 28, 2026 at 10:24:01AM +0100, Marc Zyngier wrote:
> On Tue, 14 Apr 2026 01:03:30 +0100, Wei-Lin Chang wrote:
> > This is v2 of fixing the granule size selection for software stage-1
> > and stage-2 walks. Thanks to Marc for the feedback on v1 ([1]).
> > 
> > * Changes from v1:
> > 
> >   - Take the entire (v)tcr value for TGx decode helpers.
> > 
> > [...]
> 
> Applied to next, thanks!
> 
> [1/4] KVM: arm64: nv: Rename vtcr_to_walk_info() to setup_s2_walk()
>       commit: a878096e0e86b44e758aafc6b26af97e8f548673
> [2/4] KVM: arm64: Factor out TG0/1 decoding of VTCR and TCR
>       commit: d7768b4f718503e79e7c626d29e9131b747148ee
> [3/4] KVM: arm64: nv: Use literal granule size in TLBI range calculation
>       commit: b154da8288add1f6fb958797d0b3462800f9fc77
> [4/4] KVM: arm64: Fallback to a supported value for unsupported guest TGx
>       commit: 8853566dfbab1a255ae72676ab5ec43e1631ddb7

Thanks for fixing the small issues!

Wei-Lin Chang

> 
> Cheers,
> 
> 	M.
> -- 
> Without deviation from the norm, progress is not possible.
> 
>