public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Ryan Roberts <ryan.roberts@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Oliver Upton <oupton@kernel.org>,
	linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev
Subject: Re: [PATCH 1/2] arm64/mm: Directly use TTBRx_EL1_ASID_MASK
Date: Wed, 25 Feb 2026 10:50:50 +0000	[thread overview]
Message-ID: <86a4wx9jw5.wl-maz@kernel.org> (raw)
In-Reply-To: <86bjhd9nxq.wl-maz@kernel.org>

On Wed, 25 Feb 2026 09:23:29 +0000,
Marc Zyngier <maz@kernel.org> wrote:
> 
> On Wed, 25 Feb 2026 03:51:56 +0000,
> Anshuman Khandual <anshuman.khandual@arm.com> wrote:
> > 
> > diff --git a/arch/arm64/kvm/at.c b/arch/arm64/kvm/at.c
> > index 885bd5bb2f41..d5c342ccf0f9 100644
> > --- a/arch/arm64/kvm/at.c
> > +++ b/arch/arm64/kvm/at.c
> > @@ -560,7 +560,7 @@ static int walk_s1(struct kvm_vcpu *vcpu, struct s1_walk_info *wi,
> >  			BUG();
> >  		}
> >  
> > -		wr->asid = FIELD_GET(TTBR_ASID_MASK, asid_ttbr);
> > +		wr->asid = FIELD_GET(TTBRx_EL1_ASID_MASK, asid_ttbr);
> >  		if (!kvm_has_feat_enum(vcpu->kvm, ID_AA64MMFR0_EL1, ASIDBITS, 16) ||
> >  		    !(tcr & TCR_ASID16))
> >  			wr->asid &= GENMASK(7, 0);
> > diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
> > index 620126d1f0dc..82558fb2685f 100644
> > --- a/arch/arm64/kvm/nested.c
> > +++ b/arch/arm64/kvm/nested.c
> > @@ -1343,7 +1343,7 @@ static bool kvm_vncr_tlb_lookup(struct kvm_vcpu *vcpu)
> >  			    vcpu_read_sys_reg(vcpu, TTBR0_EL2));
> >  		u16 asid;
> >  
> > -		asid = FIELD_GET(TTBR_ASID_MASK, ttbr);
> > +		asid = FIELD_GET(TTBRx_EL1_ASID_MASK, ttbr);
> >  		if (!kvm_has_feat_enum(vcpu->kvm, ID_AA64MMFR0_EL1, ASIDBITS, 16) ||
> >  		    !(tcr & TCR_ASID16))
> >  			asid &= GENMASK(7, 0);
> > @@ -1459,7 +1459,7 @@ static void kvm_map_l1_vncr(struct kvm_vcpu *vcpu)
> >  			    vcpu_read_sys_reg(vcpu, TTBR0_EL2));
> >  		u16 asid;
> >  
> > -		asid = FIELD_GET(TTBR_ASID_MASK, ttbr);
> > +		asid = FIELD_GET(TTBRx_EL1_ASID_MASK, ttbr);
> >  		if (!kvm_has_feat_enum(vcpu->kvm, ID_AA64MMFR0_EL1, ASIDBITS, 16) ||
> >  		    !(tcr & TCR_ASID16))
> >  			asid &= GENMASK(7, 0);
> 
> Given the 3 hunks above, there is clearly a better approach.

https://lore.kernel.org/r/20260225104718.14209-1-maz@kernel.org

	M.

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

  parent reply	other threads:[~2026-02-25 10:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25  3:51 [PATCH 0/2] arm64/mm: Drop TTBR_CNP_BIT and TTBR_ASID_MASK Anshuman Khandual
2026-02-25  3:51 ` [PATCH 1/2] arm64/mm: Directly use TTBRx_EL1_ASID_MASK Anshuman Khandual
2026-02-25  9:23   ` Marc Zyngier
2026-02-25 10:40     ` Anshuman Khandual
2026-02-25 10:50     ` Marc Zyngier [this message]
2026-02-25  3:51 ` [PATCH 2/2] arm64/mm: Directly use TTBRx_EL1_CnP Anshuman Khandual

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=86a4wx9jw5.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=anshuman.khandual@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=oupton@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=will@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox