Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1467534rdb; Mon, 19 Feb 2024 17:47:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWpddbb0FsteMlTY2mmz6qzo9rEZ8BUejKcBEWmDZNTHS+8EjEiPv0uLbn4LItkQwbIULWicPIYpiXqikq6+YNNPetmBzz0sVWeiK750A== X-Google-Smtp-Source: AGHT+IG0MylUeB5LJ+e1XwFopEnKTAEGy+w/LPOa8BEv4/HawUdk4D6Yztkpg4rMjJcwWMtpW2X2 X-Received: by 2002:a05:6870:9108:b0:21e:673f:96cc with SMTP id o8-20020a056870910800b0021e673f96ccmr12996070oae.51.1708393631752; Mon, 19 Feb 2024 17:47:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708393631; cv=pass; d=google.com; s=arc-20160816; b=SHlmyW79D3zZL1Z09D1jey4yKPEh7HUIp6IgWLlfMOoZp52J1b8RQ8Ee5FuQmzGv0P +pBXomdcThPav7YL0IY6kEbbqfJZb+olFie6XSR51pfcdL19nWVJFj3/ZxCdZzkdONQO 6y6PjOo3xgaBS1AQO/2TEBRWe/4RF0pLCnuoBapfTJoqLsRikGv7jZ6pXdS+ePZGmJaC zBOJoQyv+Hpko1aEQaGvhgLzOp6ofH+n+5g3bXSHp8OWFGv7GBGAgCgsGNEJ7nniGyN7 PZrLxq2Dxm3j1k/ed4GGbHNcTuVj99L6owSNwfJFH5t2QyXWHa6A7eGwuSKWIP+dNl6Z RyTA== 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:dkim-signature; bh=zBIrOuIpFIMcvGi7NREUi827rUQ7x+A1LO21wOGlXHI=; fh=arB5mT4CB6n7PAhJ/jW/poaXFSslAGwJTjOhWHcGa8E=; b=vMpY3fT1v4SuU7pwhbyiKXjXYhAu9EPqRcNlC6/pg2Cp1r45pyG2+0CeDkvBxGKCvu BAvy9tQK9f6dPqrbJH3WNlyqa/1SSDW44KfE8bdX7pvs72w4i9BoOv8n6phR3cLVE967 n5n6uhGIlkDdXbHunqSZATUl8y6LITF9AcrrYJCSjJgpGfUsk3RurTlLfsjrYkggkU/S r822kW4npLm1JMED+3hqg9oTx1vlqmNa4ApZN+44myNsa/lO/BT5vyThjV1U0awYUp64 qZR2XRG3dKoLA7FwPbi04SUo7JmRyZ33xPuLMRXQqOs7BG/qNNUhs6BUVRZqKfVakFBm 1+fQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O1W0cgbT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-72190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72190-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m21-20020a638c15000000b005dc816e3073si639177pgd.19.2024.02.19.17.47.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 17:47:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O1W0cgbT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-72190-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72190-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5FD7AB22887 for ; Tue, 20 Feb 2024 01:45:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 57C3438DD7; Tue, 20 Feb 2024 01:45:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O1W0cgbT" 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 81769374DD for ; Tue, 20 Feb 2024 01:45:50 +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=1708393550; cv=none; b=shiOjgXHMo21kjYw82jAOhbXpIXrRircPAktYGmvmldFLe0zlCeyc2XTwVzGEnLIhxkUT9umQDY/iG8Pf85VOasX0u+3Z63TUGzvgViSideZTKFOvo7QrRGa6lZbdgkpqIJC7vV0w5v1oei694iXDVeW2aafnN9CwUDCIJHE+/c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708393550; c=relaxed/simple; bh=xwMhIGtEqqY2ZsJjJOtA/QlKbBot/S9r36wBtxBVccA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=N9/RGDwCSGGz4vg0H6tGcVxU7puBESqxIZ66iNw6turgZsb+7acdLdJFESGTEbETU5A9Dr7p9e97hjixW6sQjcADsJdzC5vwZa8W4MsjflhgRd2sKQjhWSLe+yiiPJMDHV518qLiG+fwplwjCsYsdMqQldLDlQQ4YZr3l+6cjQA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O1W0cgbT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EF93C433F1; Tue, 20 Feb 2024 01:45:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708393550; bh=xwMhIGtEqqY2ZsJjJOtA/QlKbBot/S9r36wBtxBVccA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O1W0cgbTEGgHawrTybfrqZA2h4w70iM1SEZtnjXNGPMnrpImDFWWacaxZdDvQeVpw Tt2FSsPBWHrVRTCsluKvgjQVX9xG01G4hHeqhr5wvotXpT/xoxR/BtBuhVmGorB1S9 6JJoiQIrM7kaocCdYogkW5qw1XjN8hfeGl516L5RGjaymvfCSP/Q2YDx8Nou7dTsje Fr8F1U32HoluRGf7UpFJOz0T7b6R8jAwoFZw/hoY+FHyGoU1cNvFpKQYdZuae0hSm0 NNrEhiFU/R3INlK/0x/LxEyv8VApX/phDuvX7ph3ZKzXY7v7L55lOyZZBFNGTFNIPZ iIKEMP27yoHRA== Date: Tue, 20 Feb 2024 09:32:43 +0800 From: Jisheng Zhang To: Yangyu Chen Cc: linux-riscv@lists.infradead.org, Paul Walmsley , Palmer Dabbelt , Guo Ren , Alexandre Ghiti , linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: mm: fix NOCACHE_THEAD does not set bit[61] correctly Message-ID: References: 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=utf-8 Content-Disposition: inline In-Reply-To: On Tue, Feb 20, 2024 at 12:32:09AM +0800, Yangyu Chen wrote: > Previous commit dbfbda3bd6bf("riscv: mm: update T-Head memory type > definitions") missed a `<` for bit shifting, result in bit[61] does not set > in _PAGE_NOCACHE_THEAD and leaves bit[0] set instead. This patch get this > fixed. > > Link: https://lore.kernel.org/linux-riscv/20230912072510.2510-1-jszhang@kernel.org/ [1] > > Signed-off-by: Yangyu Chen Good catch! We're lucky just because _PAGE_NOCACHE_THEAD isn't used now. Reviewed-by: Jisheng Zhang > --- > arch/riscv/include/asm/pgtable-64.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/include/asm/pgtable-64.h b/arch/riscv/include/asm/pgtable-64.h > index b42017d76924..b99bd66107a6 100644 > --- a/arch/riscv/include/asm/pgtable-64.h > +++ b/arch/riscv/include/asm/pgtable-64.h > @@ -136,7 +136,7 @@ enum napot_cont_order { > * 10010 - IO Strongly-ordered, Non-cacheable, Non-bufferable, Shareable, Non-trustable > */ > #define _PAGE_PMA_THEAD ((1UL << 62) | (1UL << 61) | (1UL << 60)) > -#define _PAGE_NOCACHE_THEAD ((1UL < 61) | (1UL << 60)) > +#define _PAGE_NOCACHE_THEAD ((1UL << 61) | (1UL << 60)) > #define _PAGE_IO_THEAD ((1UL << 63) | (1UL << 60)) > #define _PAGE_MTMASK_THEAD (_PAGE_PMA_THEAD | _PAGE_IO_THEAD | (1UL << 59)) > > -- > 2.43.0 >