Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3614182rdb; Wed, 13 Sep 2023 18:41:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4pG83dGLTcVe1K32De9N4YhLsjEPlcLxWQA7VCzBn/ZDj2BXQNYV5j6fbvR1Bovqqtoio X-Received: by 2002:a05:6a00:39a5:b0:68f:b8ca:b11 with SMTP id fi37-20020a056a0039a500b0068fb8ca0b11mr4722381pfb.11.1694655703839; Wed, 13 Sep 2023 18:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694655703; cv=none; d=google.com; s=arc-20160816; b=nq/5Lew0YwPBVVhArLO9io0j9KtUv7eoMQeAWzO1YrTZXhvlME+b3N7yRCYabR4mc9 nX61m3lLGXbhIyDyCc/r0NuR+QjVMcj8owIout5v0oSX8j7ewGz1G8QAMICubGqGU3kW TGm7eNRfFsuZF6G/GWkZt6fmQ3SHk8s9/pwwUDzoThzzsuEc/EugHztaa1q0TXNkOSuB HStearoHzBc+RgVq8YMdGbUeglAbpXvWrrqWedGpW0IDsshhI1A1ytAGn45fYOn3agU1 TV+pu5bSDXmtZkWiaPj9Qt+3T14ALGTjVIIqodfNrkUZHm/e41MFqbjv3KJPOikmkB0u gCag== 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=h29UP7u9ZaaRbd9SZCpb+876d7BgZ7yQ+6JtQxTtChU=; fh=v+TWoTDZBRK/EiEjVs/yF6epfLq71Wy8o9JoPx8xgF8=; b=TnXpHCnMAjfsDZUEqdbl8vL2W05lzfa/+U6HEWR0+qJUwBeqc5uflt9r8tyqWkKhvi kDZYXDD4IpTjotvQ/xYHC+TmH7eAamuI9pupCgSTBIT9K1W9o23+eQOWQXPRtIWOiOZr RqtP34JphkR6xEfUiSsO31upRCO+2xHsQUdsAJVZaFXh4mfSuLgp1Sd2puvY+HYsuCKx XsetyWBHR8PHdBzNs8RG7yXbQ3ww0FpbKhAB0u1/1X3YeEeZUCtJCA5XbuQ8AfSXPS28 6SoeiYD5Uqa69IHrjnueyk4JqkDQdQZukPPLBqYgBdUIpvhCOxyDNVQooTQWYVsCQK6r qcrw== 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:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id ch14-20020a056a00288e00b0068e3efe866esi476213pfb.146.2023.09.13.18.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 18:41:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id BDDC182771B9; Wed, 13 Sep 2023 18:41:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233597AbjINBkz (ORCPT + 99 others); Wed, 13 Sep 2023 21:40:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233481AbjINBky (ORCPT ); Wed, 13 Sep 2023 21:40:54 -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 1F59F1BD0 for ; Wed, 13 Sep 2023 18:40:49 -0700 (PDT) Received: from mail.andestech.com (ATCPCS16.andestech.com [10.0.1.222]) by Atcsqr.andestech.com with ESMTP id 38E1eaCW060607; Thu, 14 Sep 2023 09:40:36 +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; Thu, 14 Sep 2023 09:40:32 +0800 From: Yu Chien Peter Lin To: , , , , , , , , CC: , Yu Chien Peter Lin Subject: [PATCH v2 2/3] riscv: Introduce PBMT field to PTDUMP Date: Thu, 14 Sep 2023 09:40:26 +0800 Message-ID: <20230914014027.273002-2-peterlin@andestech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230914014027.273002-1-peterlin@andestech.com> References: <20230914014027.273002-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 38E1eaCW060607 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 (groat.vger.email [0.0.0.0]); Wed, 13 Sep 2023 18:41:03 -0700 (PDT) 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 groat.vger.email 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 --- 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 85686652f342..b5026fc867e8 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