Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1069611rdb; Tue, 19 Sep 2023 20:57:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGA3lVpY/beMnMDFzrdCvZ3Avm33BBT2auTXJGSOyZVbpuSOpbrRN3ugfnfZtzAR3x01Xw0 X-Received: by 2002:a05:6a00:80d:b0:68f:e0f0:85f4 with SMTP id m13-20020a056a00080d00b0068fe0f085f4mr1600495pfk.25.1695182263420; Tue, 19 Sep 2023 20:57:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695182263; cv=none; d=google.com; s=arc-20160816; b=Wm40z3Yc3m9GY1axKBJihHv2/J3fyawPoctrR+emnkYSV3jXuk5oXM6YoiZx3Sv+lf SSNXoK8Xfd95mzcgrn0+JYrUYLBFgsR/ljP4xQjBT+9FVTHTWQi4iZ7ot+KestyvdHpo l8l+d1EjqA4Y6NHPVv5e1/xyUVYpthfaQdgO4WnJu3o9utOa2byx77rk+4Z/tITUA9C1 Kg71L+rfmjVyxVZiCeZSj8voiZP9w0dOyPW2z7+4p+K8lXx52MVDyf+tWV79W3oCkS0C 1JConlcjTJ4o8zCare36ymgv/meRqIHTnYhHsROEfpQgD/RYQfBAO92BcL4hDkVwGAL/ h93g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=4SB2nb3o9bFSAQ0dUrV2S1rkewQNDl6P+pcQ1i2bzVc=; fh=KurLJqq2XfuewB6RNJWlRN2u09Gks5pj0rZr7I72NxA=; b=BnrRwmkRdnE35k5km0mOWeFZWvP7jEdc7y/0TGRu+f4LOEAac3txLrdsfhADpdRZjF ajjynfwYPvumW4C3S2MpNdIgzYxOZ5X81sdiBazsr83KC46YQUC+ffTDhI4bQLlfMkAZ KM58+S6O2V6Wu4wjovVKz29O5i/I/9QaLL1RQVyKVZKN7/8hm+3VlyzIbv4QtH0LsIWe Vv93i/OUUmLHkh40G4YUNWddaKfW/sMEmQZsJHk4fh12IRw+1ZK2y7v9xN0Cvlvd9AKn h6KYXj1RZ5V7nW0RzSb/2ozh61VJtFPBUnwO8ZlZEaz9s2RCuXpYS8LKeOjQKsSpva/+ pCBw== 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:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id i3-20020a639d03000000b00578af609d05si2662246pgd.244.2023.09.19.20.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 20:57:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 3375B81904FD; Tue, 19 Sep 2023 20:57:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232632AbjITD46 (ORCPT + 99 others); Tue, 19 Sep 2023 23:56:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232773AbjITD4k (ORCPT ); Tue, 19 Sep 2023 23:56:40 -0400 Received: from Atcsqr.andestech.com (60-248-80-70.hinet-ip.hinet.net [60.248.80.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8C24198D for ; Tue, 19 Sep 2023 20:55:54 -0700 (PDT) Received: from mail.andestech.com (ATCPCS16.andestech.com [10.0.1.222]) by Atcsqr.andestech.com with ESMTP id 38K3tjEw069442; Wed, 20 Sep 2023 11:55:45 +0800 (+08) (envelope-from peterlin@andestech.com) Received: from atctrx.andestech.com (10.0.15.173) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Wed, 20 Sep 2023 11:55:41 +0800 From: Yu Chien Peter Lin To: , , , , , , , , CC: , Yu Chien Peter Lin Subject: [PATCH v3 2/3] riscv: Introduce PBMT field to PTDUMP Date: Wed, 20 Sep 2023 11:55:21 +0800 Message-ID: <20230920035522.3180558-2-peterlin@andestech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230920035522.3180558-1-peterlin@andestech.com> References: <20230920035522.3180558-1-peterlin@andestech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.0.15.173] X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL: Atcsqr.andestech.com 38K3tjEw069442 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Tue, 19 Sep 2023 20:57:07 -0700 (PDT) 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 { -- 2.34.1