Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2611581lqz; Wed, 3 Apr 2024 03:30:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVAfbZTBbg0oSs9eUuIm/MgnIWFIgTtK6sQx6EmlmZgLMz5hjeDbW8xUdwJ+pc5oqenQs0Z24dRIEioCz1l5vAB+DCTZ0UudWs5CF4uPw== X-Google-Smtp-Source: AGHT+IGyVxgdVSAqSOcnL05L1rrBJ6wY9uOIBBLr7LxddbxCKBY2hnz2T5xXFoHcYefeGwk1sopP X-Received: by 2002:a05:6e02:3993:b0:369:b922:65bd with SMTP id cp19-20020a056e02399300b00369b92265bdmr9389114ilb.5.1712140232628; Wed, 03 Apr 2024 03:30:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712140232; cv=pass; d=google.com; s=arc-20160816; b=xGfHSzju5e77xHvDyEHbCnmn1JWszkPpL5gJ0nYJ4mUmzY/BVCR+PjNsh8+ij8lKG2 WTSq9uPDHBe0fnb8f9TSKjrQ5V82Qsv68Owr98MhIKlxYG1kGEmIEKSoUhIPggiUyCVW jC+HYG4vhJrEbKbEt/xmfv7KoxXxAfnaUTYnUIfhVItHjHyxBD9NdZv0BkhqqSxzTQd6 iIOo9+7TrCDlBGh91Sb2Ww3HtSeixEdTohJnNTdpnSxbtVu1B2CoW1JCBem1kwbdrMtK 7J3bRxkcIwSh/Qr9htzhYeflaSNHRiyamITANKP3hI6bdAbirgQrVrecZGd2KTWWI3jg w5Ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=QmVrO0MQMiAF/G8Dd2oMhe2SHaFT2q2cTH8Vr12RxKs=; fh=M8EgpsV+yrgSObK/4Q2ynQYVqgSdGZRHeq0B2hfAmJg=; b=B5IEIVOgJROdB68MhoAKyb1EhiCHnM7apEeft0cJxcmejRrJJOfVx8ufc3UGE8Ts0t ICN9jj1i4rpB4FaBO6O0PC66PBmEVmBJwJFvmICS6Znzn2B2rVoQHe9UydG9t7XdOMkB M9IUJhaA143Uj7IruxyKCYu7vFWiynalsG51rbbFqTA3ZcRbMwuRKVFqc4MbXLzwOopo 9ZXVVT6A+W1jByGJ5WNf8D9lG6OR6i3Q4OaCo4xDbZUc5RSZ36Ue8tvaK4KsqQXlzagp p2s8EC6y4XbnKnyeAyXxbh4yQEXHvZX2c+GYDrQDJQyl2B16PY8ZUu7kMU3oslPulM6k /Vtg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-129475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129475-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i10-20020a63130a000000b005e858e345dbsi12417032pgl.373.2024.04.03.03.30.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 03:30:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-129475-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129475-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6CB33B25998 for ; Wed, 3 Apr 2024 10:02:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66C39136E2B; Wed, 3 Apr 2024 10:01:57 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6435313775D for ; Wed, 3 Apr 2024 10:01:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712138516; cv=none; b=liBoa0Thz08hax4rXPJjkoxjd0x8X2YPDwzIsUXI1mG5obxW0sASbnMZ+AC2FHZISHeDjr9BGGVsPts3525rcCPqOo1G7nzoZDHNhT9ymbLEiV5zMD1uZFGthaY9oYu6GK0vLQH51ydllwbtMXLvwUxUKlrrJSY+GyorQNPTfbE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712138516; c=relaxed/simple; bh=m8OL45WGc8UgK6yb9pP1r2KBpUYXIKaBpx6utXio7m0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pGdKRoMLyDYtVnHkuaIevNcdEYL/Jg7G/xHCr5t2SiAsam6LBuP6lNeGBate5BgUc88S7Y7tM1p8sORMEA/Qd0ZNCw/QBmgTJS5hrDmsjPsaRnd6I77JDYwobaNONfKj24bcIjmoWHrLVGTK0W0qop09fqED8K6NrIMaCBpgLV8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C44C2FEC; Wed, 3 Apr 2024 03:02:25 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.16.212]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B3FF53F64C; Wed, 3 Apr 2024 03:01:52 -0700 (PDT) Date: Wed, 3 Apr 2024 11:01:49 +0100 From: Mark Rutland To: Seongsu Park Cc: will@kernel.org, catalin.marinas@arm.com, ardb@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Leem ChaeHoon , Gyeonggeon Choi , Soomin Cho , DaeRo Lee , kmasta Subject: Re: [PATCH v2] arm64: Fix double TCR_T0SZ_OFFSET shift Message-ID: References: <20240403024236.193428-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: <20240403024236.193428-1-sgsu.park@samsung.com> On Wed, Apr 03, 2024 at 11:42:36AM +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. Can we please write a better commit message? This doesn't explain: * Where we have already shifted the value of t0sz, nor why it makes sense to do that there. * That the value of TCR_T0SZ_OFFSET is 0, and hence shifting this repeatedly is beningn, and this patch is a cleanup rather than a fix. Mark. > 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 > --- > > Changes in v2: > - Condition is updated > > --- > arch/arm64/include/asm/mmu_context.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h > index c768d16b81a4..bd19f4c758b7 100644 > --- a/arch/arm64/include/asm/mmu_context.h > +++ b/arch/arm64/include/asm/mmu_context.h > @@ -72,11 +72,11 @@ static inline void __cpu_set_tcr_t0sz(unsigned long t0sz) > { > unsigned long tcr = read_sysreg(tcr_el1); > > - if ((tcr & TCR_T0SZ_MASK) >> TCR_T0SZ_OFFSET == t0sz) > + if ((tcr & TCR_T0SZ_MASK) == t0sz) > return; > > tcr &= ~TCR_T0SZ_MASK; > - tcr |= t0sz << TCR_T0SZ_OFFSET; > + tcr |= t0sz; > write_sysreg(tcr, tcr_el1); > isb(); > } > -- > 2.34.1 >