From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F29E3C531F9 for ; Tue, 28 Jul 2026 16:15:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tHjTTI8rrDhAFRW+Rp8ileUyo1j/LtgSBb+AInmlYHU=; b=CWahm51HZdhZtu B3MQy0VGpvaoljkcTusnAvXPJzcrhWL0uwJZxpUAnvZkgFvz9auNUsC/quKvmra+ooGWIYiSHoELK kRNuPwXf0IXQG7RpawsszBF/yR6edmUOruAULE+I2jYJPcITRs5aorGW7yhHb5JDT+54Jj5LJGkUV QwViyniWpgBmwvAkDrLgaQsTJsi6D5ezDPwxT6/8n2+9PSSpO4S+3f2f3FcgC2j96BT/sS17JtugI sJ/wWRHV+PZuHp5EE4oIaIQjGkHwQ5nXVODpjrkUM1hwCWU9tXQ3P61vS+RL1etJUzexX9DAN6Jnl KaDioQjqLbMbf7aDRagA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wokSe-00000005nLi-2atn; Tue, 28 Jul 2026 16:15:20 +0000 Received: from mail-pj2-x04.google.com ([2607:f8b0:4864:39::4]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wokSc-00000005nL0-2hG5 for kvm-riscv@lists.infradead.org; Tue, 28 Jul 2026 16:15:19 +0000 Received: by mail-pj2-x04.google.com with SMTP id 98e67ed59e1d1-383390e7584so1933a91.0 for ; Tue, 28 Jul 2026 09:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785255317; x=1785860117; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ZvQY85JSs1DQ7oy04X11i3pK8UnfzkNAg8LAaOu6/1E=; b=aOwMte4/0dP6ej/ALKdtbru7xdqgNQE10yE///h19aS1axVZRHfsjMTI+jVYxQtZYd 6dABeSLweGm7ZjkDKQDXp7N2U0LjIdmOCk666yzP9i2oMPZiiOwXsTSmFDtwL2w3bugB lphtM/dS9IZPYw9trhqaXFD1ZqUTurKTUSxUE3Ohoir9ucRRxWjA5iILv1rPxujO5jeC WMFBBdyu4mKwH1HOPubHt3Inb9z2b23YGXfWLLhojErK+fSMR9hBkoqzPG1cWxMuWF6x ym9naiUfgdiVAULlzYYxCHoSbP4gHEr0fGHhFvHlcpj/oazvXuyJrEuPcS2XyGg7oiUz 1IQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785255317; x=1785860117; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=ZvQY85JSs1DQ7oy04X11i3pK8UnfzkNAg8LAaOu6/1E=; b=hgka+5G7IZDLsSR6QRKtB0J/95z0iAfjFntvmA6UVycwQKZePtHlMiyNQLee76tBd7 X39xsSdVwXTy9vWCkg9Ew/FSzIoWWABKhGovihL+HNMW0Vf6PlcSO598nIm4imGJ1wJy UcJTdbGKKPm2SS6OLjcudLX7DMX0pmySb1Nteg0+uyg1gTe0csPoeDArbXdX3VSeYKq9 WQ7+nLMssg5H1K8yihWEYE18mLV482NvB8BGYvRwB72gWmQsbPiiKAVtKC/ONV5L9iwV Uz4aj/XBRKL/4YOTN49akybisCUfATWI9PsQyrCuMYM3chHQhsrAYInRTcwKYDGCJ2sV 8Hhw== X-Forwarded-Encrypted: i=1; AHgh+RrmZGzOclHhYCnGKfihITN9ZQDVLyHMAZJWB76+vkZfRKeQsBoeUjeYiU/P1wnsW/DMIZBLM32jHvs=@lists.infradead.org X-Gm-Message-State: AOJu0Yz7XQ+LWEREQVBtep0moVaMPwSrk1v07OG5A555cN+igDIQYtU4 dXKcChXJv6wRrUD/EauT2b3LiUtWDjnFZuaWPgAAdzoesHm+Ayap66QV X-Gm-Gg: AR+sD10uXcZ5/qTBddsn5GFTZHL007zdWxNuf1IxAEa2I+k5R+pCUCv8TM+b5Lt4o3p +yywkF1MLATHKKuIOOQ3e8L/LSpRhOdC1VmnMf4uRSY7yDaHXxtiZMhflFfIYlG6fzYKxB6kwtK yeCIGaBCzOigvDWGH/jCpiArUcFAejTMiNmVMo2tRy/J1xZS4uLWzDndu/0Z3g/z+QCYlFwtkLi V8SztOW+tO33LbIsWwW41H7ZgxkusERwAnZ+hvebZ+tf61LBV9J+i6f/PaUP1dKE5CS0tWBgMBB Ejjd91IVojY0MSiqMYf+qh9j9bi1fqyY3YSae8/xYMXeWDiZJyIdiLWVGGYCnPJFZFDvGxfcuva tEc/XFFCpONHU9UB1RQ+V4NSUNaqKewA/2Y+S2eNWiZn/ukvduo0eVML8KTTg7vgWgRITtS4= X-Received: by 2002:a17:90b:3c8a:b0:38e:9ca8:e99 with SMTP id 98e67ed59e1d1-38f6a24719fmr2890912a91.5.1785255316861; Tue, 28 Jul 2026 09:15:16 -0700 (PDT) Received: from wud.. ([218.194.32.52]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38f7f292b06sm161141a91.10.2026.07.28.09.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2026 09:15:16 -0700 (PDT) From: "Dylan.Wu" To: paul.walmsley@sifive.com, pjw@kernel.org Cc: palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, anup@brainfault.org, atish.patra@linux.dev, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, "Dylan.Wu" Subject: [PATCH v3 0/3] RISC-V KVM gstage page table dumper Date: Tue, 28 Jul 2026 12:14:46 -0400 Message-Id: <20260728161449.190058-1-fredwudi0305@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <3bb2f519-c70b-6c35-c404-6fbfe8adbeb1@kernel.org> References: <3bb2f519-c70b-6c35-c404-6fbfe8adbeb1@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260728_091518_682455_1136D606 X-CRM114-Status: GOOD ( 10.19 ) X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+kvm-riscv=archiver.kernel.org@lists.infradead.org This series adds support for dumping RISC-V KVM gstage (second-stage) page tables via debugfs, allowing inspection of the guest physical address translation setup. Changes since v2: - Split the first patch into two as requested by Paul Walmsley: Patch 1 now only creates ptdump.h and moves declarations there with no functional changes (structures moved verbatim). Patch 2 handles the structure renames and per-level attribute bit parsing logic. Patch 1: Create ptdump.h and move declarations Patch 2: Use per-level attribute bits for parsing Patch 3: Register gstage ptdump with debugfs on guest creation Dylan.Wu (3): riscv: ptdump: Create ptdump.h and move declarations riscv: ptdump: Use per-level attribute bits for parsing KVM: riscv: Register ptdump with debugfs on guest creation arch/riscv/include/asm/ptdump.h | 43 ++++++++ arch/riscv/kvm/Kconfig | 12 +++ arch/riscv/kvm/Makefile | 1 + arch/riscv/kvm/ptdump.c | 177 ++++++++++++++++++++++++++++++++ arch/riscv/mm/ptdump.c | 106 ++++++++----------- 5 files changed, 275 insertions(+), 64 deletions(-) create mode 100644 arch/riscv/include/asm/ptdump.h create mode 100644 arch/riscv/kvm/ptdump.c -- 2.34.1 -- kvm-riscv mailing list kvm-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kvm-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 08054C54F4D for ; Tue, 28 Jul 2026 16:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PcC2NdkbAjVVDaYD3z3DbkFvmBPW0bxoyxB/Pv5O2lE=; b=pci2LnOZ5TYZY2 nD2lY79MtvlQ7bj9ArgqiW9EhX5vTMDA9/zCgItYYesTCfAaSYp1AKztRH3SyqC+GSoO9kiHxswZN Pk+9HGirAyhbjnhVlW+SGtoU9NcW9IGBsnXnS7eq5S0Y0G2NRALWME2c/etSJGCYJPuztXQATxeIs xUA6j1mc6Go9lZYxfKVOlal1FBj565/iejPbSK7MI4jw+KQcCeB0YooEwi4KkVGN3tHwUBT86/Hnr iy4tczBbh0WTMUX9BULeJ9dyMue7sCJtxZ7naBTQyBBeHn47bbG8cnTfUf2jdKPNow70is9E3QmQG /yRkIXAri8lIruQsqkoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wokSe-00000005nLe-2DFe; Tue, 28 Jul 2026 16:15:20 +0000 Received: from mail-pj2-x04.google.com ([2607:f8b0:4864:39::4]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wokSc-00000005nKz-305l for linux-riscv@lists.infradead.org; Tue, 28 Jul 2026 16:15:19 +0000 Received: by mail-pj2-x04.google.com with SMTP id 98e67ed59e1d1-383390e7584so1930a91.0 for ; Tue, 28 Jul 2026 09:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785255317; x=1785860117; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ZvQY85JSs1DQ7oy04X11i3pK8UnfzkNAg8LAaOu6/1E=; b=aOwMte4/0dP6ej/ALKdtbru7xdqgNQE10yE///h19aS1axVZRHfsjMTI+jVYxQtZYd 6dABeSLweGm7ZjkDKQDXp7N2U0LjIdmOCk666yzP9i2oMPZiiOwXsTSmFDtwL2w3bugB lphtM/dS9IZPYw9trhqaXFD1ZqUTurKTUSxUE3Ohoir9ucRRxWjA5iILv1rPxujO5jeC WMFBBdyu4mKwH1HOPubHt3Inb9z2b23YGXfWLLhojErK+fSMR9hBkoqzPG1cWxMuWF6x ym9naiUfgdiVAULlzYYxCHoSbP4gHEr0fGHhFvHlcpj/oazvXuyJrEuPcS2XyGg7oiUz 1IQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785255317; x=1785860117; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=ZvQY85JSs1DQ7oy04X11i3pK8UnfzkNAg8LAaOu6/1E=; b=Z4nMOf8YFR7ZIACLuXLU1npBrGd6ogkOvdqAjlY1OU4ot4ot72ZAkx11ZMQXRqZxTm +pCf/EbGXbwdrg1rSmDhgax7V39I0tiZjQRO1q5ttVj4uCVL1upvPL18VuqOGxu2P109 GrHjnGGKElemedTMuHheK1OIvLexqdaBfZwtn2RCZVDT0dAwXrV5vbZNHCbB6FHPe1S6 Wy2EYJc4bEiErQijN5pj7lBxAM8YJAx336fpAENkEiOa5cV0a4u5aeeGrflkgm/RPNut RLYGSdwMp4WWYVWHDj3GdphIz+qaCCzh+qYrvuDNxcyChAiYR7WHTAQp7YjY1UttSsf7 oJug== X-Forwarded-Encrypted: i=1; AHgh+RqltjIK7rI6qll0Lu40wgwT7usJisaq6Yymk4AL+K2FpkzBfHok83FxJTj65NJsN5SSPZM288shQcIoIw==@lists.infradead.org X-Gm-Message-State: AOJu0YxQSZPWXPHWvZsSldrEjyz/LUIKaUYA3CE8CxyrZiSanBnQPgcD s85X18GT1B/driqf2VY3CzoGhl5lCSh0LfkGVQCbCc86skWKe5Xho1dy X-Gm-Gg: AR+sD115mfKO8x7GrFHcpW88HFgb4cTn3Z+0F25VtE1HKBzwRAgcOSsE/kiGsKz8BYj ABc49oYcrZz9g4D9zRcaD2d8qqYiiMMWZqMCBIe8sXr4EANAj6kXM7nOaadrZuTqM5rNaltvsDi vWUQq9NJmHHOAsG3kyur+RGm9g7hjKjQmcifZ32bAKrgxY7Zgi9K9AwfG1ibGXXeJPStL7CaUow RZWcOidBx2segaBWMy2q1IZdz9MjrRZw5JXaVcqmp0uunIOEdaGcpmp9ysipoCp6QgxUugJ5nDi P8VpHlvQ6p5kWra25z3QZKa+gekFxc4PXtL3uNQGG6DixPtGpgB86o+zDuB+raVuU0E0Yz5Ic3W /UOO88n6NaKUtOJvXriHstq1Y6/yhn2rVVb1880dvxQ9LVkauYdWw2gLnN5P85YzaaHN3IZ0= X-Received: by 2002:a17:90b:3c8a:b0:38e:9ca8:e99 with SMTP id 98e67ed59e1d1-38f6a24719fmr2890912a91.5.1785255316861; Tue, 28 Jul 2026 09:15:16 -0700 (PDT) Received: from wud.. ([218.194.32.52]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38f7f292b06sm161141a91.10.2026.07.28.09.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2026 09:15:16 -0700 (PDT) From: "Dylan.Wu" To: paul.walmsley@sifive.com, pjw@kernel.org Cc: palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, anup@brainfault.org, atish.patra@linux.dev, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, "Dylan.Wu" Subject: [PATCH v3 0/3] RISC-V KVM gstage page table dumper Date: Tue, 28 Jul 2026 12:14:46 -0400 Message-Id: <20260728161449.190058-1-fredwudi0305@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <3bb2f519-c70b-6c35-c404-6fbfe8adbeb1@kernel.org> References: <3bb2f519-c70b-6c35-c404-6fbfe8adbeb1@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260728_091518_747221_FD56AEF8 X-CRM114-Status: GOOD ( 10.19 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This series adds support for dumping RISC-V KVM gstage (second-stage) page tables via debugfs, allowing inspection of the guest physical address translation setup. Changes since v2: - Split the first patch into two as requested by Paul Walmsley: Patch 1 now only creates ptdump.h and moves declarations there with no functional changes (structures moved verbatim). Patch 2 handles the structure renames and per-level attribute bit parsing logic. Patch 1: Create ptdump.h and move declarations Patch 2: Use per-level attribute bits for parsing Patch 3: Register gstage ptdump with debugfs on guest creation Dylan.Wu (3): riscv: ptdump: Create ptdump.h and move declarations riscv: ptdump: Use per-level attribute bits for parsing KVM: riscv: Register ptdump with debugfs on guest creation arch/riscv/include/asm/ptdump.h | 43 ++++++++ arch/riscv/kvm/Kconfig | 12 +++ arch/riscv/kvm/Makefile | 1 + arch/riscv/kvm/ptdump.c | 177 ++++++++++++++++++++++++++++++++ arch/riscv/mm/ptdump.c | 106 ++++++++----------- 5 files changed, 275 insertions(+), 64 deletions(-) create mode 100644 arch/riscv/include/asm/ptdump.h create mode 100644 arch/riscv/kvm/ptdump.c -- 2.34.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj2-f1.google.com (mail-pj2-f1.google.com [74.125.227.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 780D83603C0 for ; Tue, 28 Jul 2026 16:15:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.227.129 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785255327; cv=none; b=L5wdTr50vjB+mCPq0fOjE+BeCmxtZ3xWjm5SrfKDZBqWQswDRL/Zj4ts7Wehaxa26kz1CFi8dQizyXOGB/lzN/ZBdqRHWwwgAWPQm/mUqbvnNB2vp1YwaN/y+9q4k9PPi2+r/XDRMdfe7nVzdNNOl3TAyWqxW/BBuEFv1/vKQWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785255327; c=relaxed/simple; bh=VzkbFNmui1o1RkyT7pZxd3/cCpCVHwlzyk663pgzHr0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gOtXyOskrDREh5dSsQgBxolIlK155xO4s7jS2+c7h0cPzPLYAwFRWOhkMdEM9McWvc1soMToqLPTz9Ht2mMk0Sk5CWXfgKvSOB6KFztqLEZSwYlAZ4TRO2u6bvTfdYiCsiFU7DFDNffOqlgpTD0aQ+6z+HEjPfJHrkdkM43Imvo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fsvAXoLD; arc=none smtp.client-ip=74.125.227.129 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fsvAXoLD" Received: by mail-pj2-f1.google.com with SMTP id 98e67ed59e1d1-383390e7584so1931a91.0 for ; Tue, 28 Jul 2026 09:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785255317; x=1785860117; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ZvQY85JSs1DQ7oy04X11i3pK8UnfzkNAg8LAaOu6/1E=; b=fsvAXoLDjCtXlkghHm1WLn82WtZlpdckexMI3qpIVsClOQHi3VnCbrZmFJ+m5TMdeX 9QlaMb8DTfGjl4f5r8cjyIbqQfyKaY4OOzcAmq57pl9KDd94fkefGJclzi0ki77WkigR L/QGMOXXIsD7qyQ3ohhhJQmr7NHFVTGnCLj/GwJCaeSgilg4JCyTnPwuoBMLMLDNO5Ye kDZyl9zeICjOCQj03R4FXRMDUrQC0gPKY8BsLAMs/gg9yj/cCFl3Kf8Wv2rfGmx2AV6A 8bSl73UogeETC4rij7OLVFNv93kXwxpRA1amgursE7TzZ/F82jmt0aB1CmItUD14i6e5 R6GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785255317; x=1785860117; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=ZvQY85JSs1DQ7oy04X11i3pK8UnfzkNAg8LAaOu6/1E=; b=b7EbxFQLDvbrcklCDSh/pw20VOHdMxZRqE/YrG8ueFrieyadUeIRgfyrrY3xS8v4KV tJGhawOvvKRmrH42iPJcOE4Y8bOECQ+vfd7yMWnt8aIzw425t4pu7FoLBXGrUUCRhvZG YNyGTAAPFCdFlPN5VLHD8KbM2XNTeeFUPaPjR46FaeP8oj99UCEgsOaMUPTfmgyFmrin no2xk/o8OBV1hkG1ac7rI4EGkD7+Lr5PHlLPfazOs5pxjTa9ZzGaXqROOgiz5chDOXbR Qa2VnA3xhnej77DQtiDsA2u6aqfVUKo5K+0A4M8jtQ7k1u5brruu5ah2RZdlon9DhNAY QCsg== X-Forwarded-Encrypted: i=1; AHgh+RrjuSDA6LM4OEemBjuX0A6541J19mDCAY7NkDjAuanyWis13QdOY24CZL77rEDfIdyTm4E=@vger.kernel.org X-Gm-Message-State: AOJu0Yyv4GmMfjB+sJw93WZtlNJBAfktUzJHw9w1i4DogJP7nCvLtggk A7afPFErYtE7Cywq9PQYAQXmB0ParY/h2uPsHjcVPlYcKc8/vriwHI8aHJR9gQ+EBHAS2A== X-Gm-Gg: AR+sD12wdw3nHE1y4PyvN8Glh6HJ0QsHVauWUlLYm2FDOD0l6wY7rE1+dEuLBPKUahU 1qNB9tgVC7QZbMwiBxMOunGFutS5eS3IJzrkoLT3+Qctj1J/GV9k4SvfvcrIcVLPFUt5jVB0JR4 Hls1U9s3nMmpLNU4Wwp52h6Y9ctclsP4PZsvGnWLcqBVGk9JjzqVXlAjG3C8KC/Gl8id6DX7vp5 ZfXb2H3e49jOE8erzzregQF06OG/G8K7bfLji8aqZzH0IZyd0UbEx8hvcyVjXJBhIW1DhqJ0olY CacXe9IAVPGStz4friUYfqIGdcG6Hl0/zHQbV643lmMaTlDTM/1AI/ojKGAH1IMEEkzpDPLG+1T PGd/igdigIt5hpgvQxgEa1qXcqO4C39+QzqfnnHfIUWRBXTyhk9p4NyJ+Jn7AaTylBKcqH1E= X-Received: by 2002:a17:90b:3c8a:b0:38e:9ca8:e99 with SMTP id 98e67ed59e1d1-38f6a24719fmr2890912a91.5.1785255316861; Tue, 28 Jul 2026 09:15:16 -0700 (PDT) Received: from wud.. ([218.194.32.52]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38f7f292b06sm161141a91.10.2026.07.28.09.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2026 09:15:16 -0700 (PDT) From: "Dylan.Wu" To: paul.walmsley@sifive.com, pjw@kernel.org Cc: palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, anup@brainfault.org, atish.patra@linux.dev, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, "Dylan.Wu" Subject: [PATCH v3 0/3] RISC-V KVM gstage page table dumper Date: Tue, 28 Jul 2026 12:14:46 -0400 Message-Id: <20260728161449.190058-1-fredwudi0305@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <3bb2f519-c70b-6c35-c404-6fbfe8adbeb1@kernel.org> References: <3bb2f519-c70b-6c35-c404-6fbfe8adbeb1@kernel.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series adds support for dumping RISC-V KVM gstage (second-stage) page tables via debugfs, allowing inspection of the guest physical address translation setup. Changes since v2: - Split the first patch into two as requested by Paul Walmsley: Patch 1 now only creates ptdump.h and moves declarations there with no functional changes (structures moved verbatim). Patch 2 handles the structure renames and per-level attribute bit parsing logic. Patch 1: Create ptdump.h and move declarations Patch 2: Use per-level attribute bits for parsing Patch 3: Register gstage ptdump with debugfs on guest creation Dylan.Wu (3): riscv: ptdump: Create ptdump.h and move declarations riscv: ptdump: Use per-level attribute bits for parsing KVM: riscv: Register ptdump with debugfs on guest creation arch/riscv/include/asm/ptdump.h | 43 ++++++++ arch/riscv/kvm/Kconfig | 12 +++ arch/riscv/kvm/Makefile | 1 + arch/riscv/kvm/ptdump.c | 177 ++++++++++++++++++++++++++++++++ arch/riscv/mm/ptdump.c | 106 ++++++++----------- 5 files changed, 275 insertions(+), 64 deletions(-) create mode 100644 arch/riscv/include/asm/ptdump.h create mode 100644 arch/riscv/kvm/ptdump.c -- 2.34.1