Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1196632rdb; Wed, 20 Sep 2023 02:21:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4+1gf5z34UyuHK8hz9rXlmmEiclgOkhHGGWM9XDjG7E8z30rjrvQ/UrVcTdx5kkz/sJeu X-Received: by 2002:a17:903:32c7:b0:1c3:be1f:5a20 with SMTP id i7-20020a17090332c700b001c3be1f5a20mr2625847plr.23.1695201714922; Wed, 20 Sep 2023 02:21:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695201714; cv=none; d=google.com; s=arc-20160816; b=aQe7bP8RijDSgjShf6Gd5zF6Dd5Xh9JaAvblwTY0hB8/IxHcykYTMwwuZmAIi3ormH bYcSr2QXXdLDkAyqB1Mbdp3pIqOuPMGrhxaZ0o2nNHA89nAPvszwzFvG+0FW/LToUGqh 0QS0uA6Dq1rFF0bVJQigNK+cvZR92lADGZD2yBr0BBAPL4rFlczmwzoFN+Yt8yFKLprW D4XlIh7GFP7WPKa+j9nWKh5ZNjUr4iCEysY0SK91yHXDFsDNrPnDR4UnLBf4D/tM2j1e gLZfnPfnxFvvE7VKODmxAsXtNKGEm2iAIcBVtoroPEjS8+cNbQWOCj2G+xC/oYO+KbZG yVDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=XCdf3ewdT2bbhrcgomYnVbik3fxN+fz3AVX8aDLzY4M=; fh=WAAVzXtgRRRZzAl2Gdd8gkC2nsjWGG8lYE26uUh24qg=; b=Wc4W7EeqnICVtPoiX7aUKocWCmFyu3NPYOJ6DIC7rsJc2zMt9GzqpKISEGPtj3tBjx 7+CviV/nQG+y5sjT+EYmRNSUW9jk9Z77NcAYkAYCSR+sGXTpXYklzHJzi1QS9aXSu63S 8CwajAhygFUwmwbHC7ynXmhYm6Ko9o5bwH/GxpNH/D/zfzemaEeMUZAYNLduL2494rjK gIQriwtCBnETrCnnFsygUyygrkclH50tY/ZqCcRUo6KjjfyArvRbU1KPd5k410L1id7U HgRVsJB7f9tKhGBvwJqzaJ8arJmYS5XnXhtrhK9VlkCWHsGUZFWruIY4zzFiWSUPUTtX c9pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id cp2-20020a170902e78200b001bf741231f7si11334549plb.570.2023.09.20.02.21.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 02:21:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EFF78802925C; Wed, 20 Sep 2023 02:12:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233954AbjITJMh (ORCPT + 99 others); Wed, 20 Sep 2023 05:12:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234025AbjITJM1 (ORCPT ); Wed, 20 Sep 2023 05:12:27 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6A27EC for ; Wed, 20 Sep 2023 02:12:20 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5907D1BF207; Wed, 20 Sep 2023 09:12:14 +0000 (UTC) Message-ID: <57862c7c-3158-c37b-baae-db6801f4d7e8@ghiti.fr> Date: Wed, 20 Sep 2023 11:12:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v3 2/3] riscv: Introduce PBMT field to PTDUMP Content-Language: en-US To: Yu Chien Peter Lin , paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, david@redhat.com, akpm@linux-foundation.org, alexghiti@rivosinc.com, bjorn@rivosinc.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: conor.dooley@microchip.com References: <20230920035522.3180558-1-peterlin@andestech.com> <20230920035522.3180558-2-peterlin@andestech.com> From: Alexandre Ghiti In-Reply-To: <20230920035522.3180558-2-peterlin@andestech.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-GND-Sasl: alex@ghiti.fr X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS 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 (snail.vger.email [0.0.0.0]); Wed, 20 Sep 2023 02:12:43 -0700 (PDT) On 20/09/2023 05:55, Yu Chien Peter Lin wrote: > This patch introduces the PBMT field to the PTDUMP, so it can > display the memory attributes for NC or IO. > > Signed-off-by: Yu Chien Peter Lin > --- > Changes v1 -> v2 > - no change > Changes v2 -> v3 > - Add ".." when PBMT field is clear > --- > arch/riscv/mm/ptdump.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/arch/riscv/mm/ptdump.c b/arch/riscv/mm/ptdump.c > index 57a0926c6627..13997cf3fe36 100644 > --- a/arch/riscv/mm/ptdump.c > +++ b/arch/riscv/mm/ptdump.c > @@ -135,6 +135,12 @@ struct prot_bits { > > static const struct prot_bits pte_bits[] = { > { > +#ifdef CONFIG_64BIT > + .mask = _PAGE_MTMASK_SVPBMT, > + .set = "MT(%s)", > + .clear = " .. ", > + }, { > +#endif > .mask = _PAGE_SOFT, > .set = "RSW(%d)", > .clear = " .. ", > @@ -205,6 +211,16 @@ static void dump_prot(struct pg_state *st) > if (val) { > if (pte_bits[i].mask == _PAGE_SOFT) > sprintf(s, pte_bits[i].set, val >> 8); > +#ifdef CONFIG_64BIT > + else if (pte_bits[i].mask == _PAGE_MTMASK_SVPBMT) { > + if (val == _PAGE_NOCACHE_SVPBMT) > + sprintf(s, pte_bits[i].set, "NC"); > + else if (val == _PAGE_IO_SVPBMT) > + sprintf(s, pte_bits[i].set, "IO"); > + else > + sprintf(s, pte_bits[i].set, "??"); > + } > +#endif > else > sprintf(s, "%s", pte_bits[i].set); > } else { You can add: Reviewed-by: Alexandre Ghiti Tested-by: Alexandre Ghiti Thanks! Alex