Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2011661lqz; Tue, 2 Apr 2024 04:59:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW72fBUMR3zTtoHnd9neZCvVhsTudKi8p8McDObcDc2FnhTe+Vd/R2ufPP+BTasS7YYdLHswgz3+TjnjhT8JMC8h0+/E6FNfKydyBIurw== X-Google-Smtp-Source: AGHT+IHPE+NoWlaGfi/Kk4Yo8mepQSM6g4qZyDoxS07QdCrYkxtfe00sC2qjYmvPKKTb/W0ZtHZa X-Received: by 2002:a17:906:d1da:b0:a47:134d:2fc8 with SMTP id bs26-20020a170906d1da00b00a47134d2fc8mr12098402ejb.10.1712059143462; Tue, 02 Apr 2024 04:59:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712059143; cv=pass; d=google.com; s=arc-20160816; b=vPJbFq58EvL01nxoqWPfnpRKndAejS0qcwD2FJsbd0kuY9tzeeWqp70VxUPBBZmodY jN1CNcZNtBh6Km83CsTO3RsUYUGIx0mUmLLeRdmP0YF8DWkLaKfqJW1jjCYCKpptcA4c ti8jek4KzlIk4dytfqPNJNEM6rCOHooepfJBvLXWxfPXlyQ9d41mm8GPcAEsXKE12u0t 3giWXfdGH3lXopTWd8Tt67qZX0nHZr42nGtoDXnciDT1iU6hOJova/mcJoaB9L7uQd7s By4drI/Cibd9+3rdLsg7sXI0kpVbzYGizGgYc1IEl7mj660brNslKPvv2RHjf3D+Nwkr pbTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=A1ynztRyWkv0fv+6XRYlZxJU9mWaY9PXw7v8NtkF5A8=; fh=2hkeNeOMxF86hfgpXF4UPSWqnfUf0uUwqs8Bcvp6caY=; b=kAbleAUumiCv5F64xiaQ1TBj1LQSRCxuliGwbN3+Fr/WLViDgwjazh+pn+Xhxb0vgG 55E2+u6VjyIZpN82m1xfW57Fvnw30jtipk1+ZF49xMo9svmotn0m0m8JaRRcY5WvnZB3 nNLgX5nOmCpm8IQr8Y6u/bpxkh0gtJttVRRLB/igLAd1z6hUlI3MZMPLIirCl1SrDO82 AfYA3r6PBVegSrR+rjEu+Rfl0pNoVyDklNRMHQljdSBasmJjEcQtbTj1N7yyH9Mtc47p EVG+20SOmKDK/s7mrYD2te5wTgqUivnnudJ5V88LXMr2yo0OGrCV+UqL/ejzD8itWWZ+ JiaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LiQw91jq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-127886-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127886-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 9-20020a508e09000000b0056c2aa2abe8si5704142edw.157.2024.04.02.04.59.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 04:59:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127886-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LiQw91jq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-127886-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127886-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 339071F22EDC for ; Tue, 2 Apr 2024 11:59:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2311B76036; Tue, 2 Apr 2024 11:58:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LiQw91jq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F9B46A8A8 for ; Tue, 2 Apr 2024 11:58:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712059128; cv=none; b=ErGN9U8/0l5LazrDwWHUkNIuCgeMKDMEPvWDqUK7m8JI9hPGgilvb9O38qSUBXwL/1lErUtZPL+L+2W5ZBse9Si4V7zlMi6oiWMBGmkUGYPqMO+mn77/KfuD/0c7yFSTRieGlcEL0/qBmwaXREh1ipY59riHHNKb9tBVSW80Lxk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712059128; c=relaxed/simple; bh=Hw2vaUWp3gpk6uvfspN8upqqDYFfDn7KHW0rB6j9DgY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gLtRTnvqI+J3p83sMjAx3cwaKec+Z1KBq4Kjb32WIkyx6H7AtJG5qXDJhn5FF4h73VUOxnipjQ6WbP+s6TyfvdMKMJZbfPQTC72/4ftuP41BThdBo0CVq5PUcuDjML1/R6yaK7++UlpGBgjQx3JazXns9XgzNyalvLNo2VFyoME= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LiQw91jq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8532EC433F1; Tue, 2 Apr 2024 11:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712059127; bh=Hw2vaUWp3gpk6uvfspN8upqqDYFfDn7KHW0rB6j9DgY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LiQw91jqMXzj+GnAus9ZnNmyXuwlBxk79xApuMWpOro87vP8LfnM8Z3F8HZblWQP1 LXco6b2zuavEqtVQyHH5dwiuLIAMHzaYV+qDceHd+uzStg+zRXSln1l1bDW00owuGh 3h5QRf4bF+Or77b7X8UhC5rdcNYw9+rA7M96Ckn0DuUuLwS8XgaNetyb9NDFqq5ws8 6UtbFp6xTNEFLzTCtgkThDbayqqVXzQM3WO90fO0jx6bnqGP/GMZEtWwtzIUSq5xSh b7Fp51XBVPAm7YX7OJM3Qnv9vpE5vDNCDNh3+rmJ3DTpqp6DDxlyoLtIHIgjEWcb4X NOMBOfvJwxQ5Q== Date: Tue, 2 Apr 2024 12:58:41 +0100 From: Will Deacon To: Seongsu Park Cc: catalin.marinas@arm.com, ardb@kernel.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Leem ChaeHoon , Gyeonggeon Choi , Soomin Cho , DaeRo Lee , kmasta Subject: Re: [PATCH] arm64: Fix double TCR_T0SZ_OFFSET shift Message-ID: <20240402115841.GA16533@willie-the-truck> References: <20240402104950.170632-1-sgsu.park@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240402104950.170632-1-sgsu.park@samsung.com> User-Agent: Mutt/1.10.1 (2018-07-13) On Tue, Apr 02, 2024 at 07:49:50PM +0900, Seongsu Park wrote: > We have already shifted the value of t0sz in TCR_T0SZ by TCR_T0SZ_OFFSET. > So, the TCR_T0SZ_OFFSET shift here should be removed. > > Co-developed-by: Leem ChaeHoon > Signed-off-by: Leem ChaeHoon > Co-developed-by: Gyeonggeon Choi > Signed-off-by: Gyeonggeon Choi > Co-developed-by: Soomin Cho > Signed-off-by: Soomin Cho > Co-developed-by: DaeRo Lee > Signed-off-by: DaeRo Lee > Co-developed-by: kmasta > Signed-off-by: kmasta > Signed-off-by: Seongsu Park heh, that's quite a lot of people. Did you remove three chars each? :p > --- > arch/arm64/include/asm/mmu_context.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h > index c768d16b81a4..58de99836d2e 100644 > --- a/arch/arm64/include/asm/mmu_context.h > +++ b/arch/arm64/include/asm/mmu_context.h > @@ -76,7 +76,7 @@ static inline void __cpu_set_tcr_t0sz(unsigned long t0sz) > return; > > tcr &= ~TCR_T0SZ_MASK; > - tcr |= t0sz << TCR_T0SZ_OFFSET; > + tcr |= t0sz; Thankfully, TCR_T0SZ_OFFSET is 0 so this isn't as alarming as it looks. Even so, if we're going to make the code consistent, then shouldn't the earlier conditional be updated too? if ((tcr & TCR_T0SZ_MASK) >> TCR_T0SZ_OFFSET == t0sz) return; seems to assume that t0sz is unshifted. Will