Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2563691rdb; Wed, 4 Oct 2023 05:19:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7rV8eXUoGpfE/44EcB/lnmN4B/1e4Tl0SLZPn88GxWW2dwzUu/hKUs4KuehuxPAU3yHaL X-Received: by 2002:a05:6a20:12d6:b0:15d:bc0f:9b64 with SMTP id v22-20020a056a2012d600b0015dbc0f9b64mr2426397pzg.45.1696421987599; Wed, 04 Oct 2023 05:19:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696421987; cv=none; d=google.com; s=arc-20160816; b=BIAx5YjWSm2scf3RMu3qvOBpzsrIhshThby0AtUpf01NtZNP/SXsIx3Wli7yBaD0Xj /hSlZOXo39OH/4ycjt/mLAI6EnpNLSlPAlg42U4keiHk7ATaKZgzpBRDPTZro3oEqsyu 3nYa0O3scqr+9eE2lOjWvU1miPvXRXZEc2dLE49FGReqwIu0nJyxQ+20bR/s1Opzptf1 ti62vIvAnnqVT8h4uMC2iaQvbOH8/OXEvJRvsqpdFO8+vK1eyOTpmWFBFgLjFCOimu2i 0DlyV75nu6fNGskrfisblOV8enbwgz6UDYItNLlXyl9fdf9cw6rWK5oqhrbDpBIpvdIu Uv+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oKVN0SzUS80T9TjSwi4wxKUtUULVbBs5mfZ2wuRnEY4=; fh=3qRrABpb+1EVpoK5NGEdR+sXhIOD5YxET8exjV6jbTU=; b=q3iXd51iept0XlI+Og1b5clLlcC3geNOAfY9EutJZ1p0AAB7sv4O7zjDuQgs5a+vhu 0gURMP/C++XE+2KXr6gc5d+jDYpBiHUinHH08h6SrhbkfNclOkZRp/vSAxUCco13xXOF CqPYEwtLPMKSVRTMa7UT/F+V0DnTyQSdw8sf151aWIIlc6nm9Q3F4f9P1WiaJk+xKuoj J5SX4np8cPlFPnvyJWbZj1DTTu2Z4WuTgthzQeguzL/hY1MeqRmbcc0l4hngZgkNWyoG qmsbDKC1LIJgQLHvrO/YUwnRNAKy3ee/G/5EQUcsy8cV9eaaIQ7e5756aCe5YPDIS4I+ pWkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SAcdhEBL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id fb34-20020a056a002da200b0068fe12b361dsi3687970pfb.249.2023.10.04.05.19.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:19:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SAcdhEBL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 34E36833F8F8; Wed, 4 Oct 2023 05:19:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242337AbjJDMTp (ORCPT + 99 others); Wed, 4 Oct 2023 08:19:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233074AbjJDMTp (ORCPT ); Wed, 4 Oct 2023 08:19:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 500E6B0 for ; Wed, 4 Oct 2023 05:19:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27A09C433C7; Wed, 4 Oct 2023 12:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696421980; bh=Jjv+CIZgDjDEX/17AWRFDrfvrea0mMzt1tHHLzjMDhQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SAcdhEBL+OvdiOlN1gqsikDxDKbJgV7ZN6NkjJqaOhajhIAe64VzacCg03JZ5U4W3 Q1N2ZuhuCkSBttSxuWRpl9w+Ta24ATd7f3ZKhFYoDawizaQxrTaJAmdEESSGU8odye NKgDKgTXqUuwEggQ7rLy9qoDoLGy4vKhjJWz+5raTcbFLRbcLiamifjkGDcF+mg6Jc 6CcN5J7HuMPDYk03BG92kNN7n+keXt7cU5ALkR7Qksz+30dBDK8gl0BwVVCouml5xD 8qTId8y4ImeJZi0q+T6qYyAZxKbkPx/XhjHcukdEGat6AGXw0xWYWMBHZsHgjMuBGV HLTyVimzl0Bqw== Date: Wed, 4 Oct 2023 20:07:35 +0800 From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Guo Ren , Drew Fustini Subject: Re: [PATCH v2] riscv: mm: update T-Head memory type definitions Message-ID: References: <20230912072510.2510-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230912072510.2510-1-jszhang@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 05:19:46 -0700 (PDT) On Tue, Sep 12, 2023 at 03:25:10PM +0800, Jisheng Zhang wrote: > Update T-Head memory type definitions according to C910 doc [1] > For NC and IO, SH property isn't configurable, hardcoded as SH, > so set SH for NOCACHE and IO. > > And also set bit[61](Bufferable) for NOCACHE according to the > table 6.1 in the doc [1]. > > Link: https://github.com/T-head-Semi/openc910 [1] > Signed-off-by: Jisheng Zhang > Reviewed-by: Guo Ren > Tested-by: Drew Fustini Hi Palmer, I believe this is a fix, could you please review and take it for 6.6 fix? Thanks > --- > > Since v1: > - collect Reviewed-by and Tested-by tag > - rebase on linux 6.6-rc1 > > arch/riscv/include/asm/pgtable-64.h | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > > diff --git a/arch/riscv/include/asm/pgtable-64.h b/arch/riscv/include/asm/pgtable-64.h > index 7a5097202e15..9a2c780a11e9 100644 > --- a/arch/riscv/include/asm/pgtable-64.h > +++ b/arch/riscv/include/asm/pgtable-64.h > @@ -126,14 +126,18 @@ enum napot_cont_order { > > /* > * [63:59] T-Head Memory Type definitions: > - * > - * 00000 - NC Weakly-ordered, Non-cacheable, Non-bufferable, Non-shareable, Non-trustable > + * bit[63] SO - Strong Order > + * bit[62] C - Cacheable > + * bit[61] B - Bufferable > + * bit[60] SH - Shareable > + * bit[59] Sec - Trustable > + * 00110 - NC Weakly-ordered, Non-cacheable, Bufferable, Shareable, Non-trustable > * 01110 - PMA Weakly-ordered, Cacheable, Bufferable, Shareable, Non-trustable > - * 10000 - IO Strongly-ordered, Non-cacheable, Non-bufferable, Non-shareable, Non-trustable > + * 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 0UL > -#define _PAGE_IO_THEAD (1UL << 63) > +#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)) > > static inline u64 riscv_page_mtmask(void) > -- > 2.40.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv