From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEF14F4BB99 for ; Wed, 25 Feb 2026 10:51:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=y/3wNkDp28gvwsxc8YKoc+euvL8Fgg7aXCTW/xAJMN0=; b=2UOxZaBg86WBVI9V8mPD0eBiCA +eOUgxKJO/3vsZbpIhE70q3F4mjfOT6o3xgkYEDUkIT6Rd+yoZiJtuAIOJKL/aI1bPutKsbPtlUdc 3hgPFCbBF9JMhiSQ/lSIXkKqvgvfH6N0M9fXrNw4LM4YjSMNXIyqH94m0I3XW6ZxcJdxBFVNRlGGc LGMobyP0SUZgm9GsxrUITcumxTymZFYIePEN8+94+PV/A8syvQ9DX0tIp/SeYeLNp6KVBerI2UvML qPr7q2jSI/phicltfErLvU9A1n5hDEO70fzjKm8eyUUGrIeugaPgJo+6Rjzh657zjRYKTpO4vlchW wqDTHzRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vvCTp-00000003qAt-2zqe; Wed, 25 Feb 2026 10:50:57 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vvCTo-00000003qAn-0LwV for linux-arm-kernel@lists.infradead.org; Wed, 25 Feb 2026 10:50:56 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id CBA3360054; Wed, 25 Feb 2026 10:50:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78072C116D0; Wed, 25 Feb 2026 10:50:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772016653; bh=uCpqAlivjzyXSSWma+8W04QqWwMFXWWGvQmHpnlWFuA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UjTzUCJN92DzWT9PTx/kj2plYmFVKQAsYETCKCt8ZbZW90LiwOkWrynu0mjO2VQ9+ 56ibgUhe3ZMoONMQ8JIluA93h2IBl4vi6C9KqmKfuMV23JW1Mr0HE0St1FDMkzlfxB /iPyTEyaodj/WH6R3IUpUeBuIqMzuiOExcwGkEkGX68hQFoKVps1BqHNIZ5bVbCkQv sGhf5ftg3Lsnb9iwRc/6D+2/rkl8Er7r43YWhxTMy1L6Uo6HDhy7fH7O0yMNTxPQDQ k+XVFykxmCZO/hAfnM2A09OGIWgKjTSlyHvzvno/3Um/5b+9gtQSm4p5BeLGDEEJPd qS6wEj1KSc09Q== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vvCTj-0000000Dfp3-0cSo; Wed, 25 Feb 2026 10:50:51 +0000 Date: Wed, 25 Feb 2026 10:50:50 +0000 Message-ID: <86a4wx9jw5.wl-maz@kernel.org> From: Marc Zyngier To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Ryan Roberts , Mark Rutland , Oliver Upton , linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH 1/2] arm64/mm: Directly use TTBRx_EL1_ASID_MASK In-Reply-To: <86bjhd9nxq.wl-maz@kernel.org> References: <20260225035157.1159962-1-anshuman.khandual@arm.com> <20260225035157.1159962-2-anshuman.khandual@arm.com> <86bjhd9nxq.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, ryan.roberts@arm.com, mark.rutland@arm.com, oupton@kernel.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 25 Feb 2026 09:23:29 +0000, Marc Zyngier wrote: > > On Wed, 25 Feb 2026 03:51:56 +0000, > Anshuman Khandual 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.