Subject: Re: [PATCH] arm64: Clear VTCR_EL2 in __init_el2_stage2()

From: Marc Zyngier <[email-masked]>
Date: Fri, 13 Mar 2026 09:06:14 +0000

On Fri, 13 Mar 2026 08:39:46 +0000,
Anshuman Khandual <[email-masked]> wrote:
> 
> 
> 
> On 13/03/26 1:41 PM, Marc Zyngier wrote:
> > On Fri, 13 Mar 2026 07:54:04 +0000,
> > Anshuman Khandual <[email-masked]> wrote:
> >>
> >> But it can be argued that these registers
> >> need not have to be cleared now and can just be initialised before
> >> setting up HCR_EL2_VM itself. In which case should we drop
> >> __init_el2_stage2() entirely ?
> > 
> > And something worth thinking of: the role of VTTBR_EL2.VMID when
> > HCR_EL2.VM is 0.
> 
> Are you suggesting that VTTBR_EL2_VMID needs to be 0 even when
> HCR_EL2_VM = 0 because of its corresponding TLB entries ? But
> during system boot such possibilities might not really exist ?

This is not a suggestion. This is an architectural requirement.

TLBs filled from the EL1&0 translation regime are always tagged by
VMID when EL2 is implemented, irrespective of HCR_EL2.VM.

	M.

-- 
Jazz isn't dead. It just smells funny.