All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Sebastian Ene <sebastianene@google.com>
Cc: akpm@linux-foundation.org, alexghiti@rivosinc.com,
	ankita@nvidia.com, ardb@kernel.org, catalin.marinas@arm.com,
	christophe.leroy@csgroup.eu, james.morse@arm.com,
	vdonnefort@google.com, mark.rutland@arm.com,
	oliver.upton@linux.dev, rananta@google.com, ryan.roberts@arm.com,
	shahuang@redhat.com, suzuki.poulose@arm.com, will@kernel.org,
	yuzenghui@huawei.com, kvmarm@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel-team@android.com
Subject: Re: [PATCH v9 0/5] arm64: ptdump: View the second stage page-tables
Date: Fri, 30 Aug 2024 16:00:11 +0100	[thread overview]
Message-ID: <8634mmvyx0.wl-maz@kernel.org> (raw)
In-Reply-To: <864j72vzmw.wl-maz@kernel.org>

On Fri, 30 Aug 2024 15:44:39 +0100,
Marc Zyngier <maz@kernel.org> wrote:
> 
> Hi Seb,

[...]

> I've been giving this a go on my test systems with 16k pages, and it
> doesn't really work as advertised:
> 
> root@babette:/sys/kernel/debug/kvm# cat 2573-13/stage2_*
> 2
> ---[ Guest IPA ]---
> 0x0000000000000000-0x0000000008000000         128M 
> 0x0000000008000000-0x00000000090a0000       17024K 3
> 0x00000000090a0000-0x00000000090a4000          16K 3   R W X AF    
> 0x00000000090a4000-0x000000000a000000       15728K 3
> 
> Only 16kB mapped? This is a full Linux guest running the Debian
> installer, and just the kernel is about 20MB (the VM has 4GB of RAM,
> and is using QEMU as the VMM)
> 
> So clearly something isn't playing as expected. Also, this '128M'
> without a level being displayed makes me wonder. It is probably the
> QEMU flash, but then the rest of the addresses don't make much sense
> (RAM on QEMU is at 1GB, not at 128MB.
> 
> On another system with kvmtool, I get something similar:
> 
> root@duodenum:/home/maz# cat /sys/kernel/debug/kvm/*/stage2_*
> 2
> ---[ Guest IPA ]---
> 0x0000000000000000-0x0000000001020000       16512K 3
> 0x0000000001020000-0x0000000001024000          16K 3   R W X AF    
> 0x0000000001024000-0x0000000002000000       16240K 3
> 
> and kvmtool places the RAM at 2GB. Clearly not what we're seeing here.
> 
> Could you please verify this?

For the record, on a 4kB host, I get much more plausible results:

root@big-leg-emma:/home/maz# cat /sys/kernel/debug/kvm/632-12/stage2_*
3
---[ Guest IPA ]---
0x0000000000000000-0x0000000000200000           2M 2   R     AF BLK
0x0000000000200000-0x0000000040000000        1022M 2
0x0000000040000000-0x0000000040200000           2M 2   R W X AF BLK
0x0000000040200000-0x0000000044000000          62M 2
0x0000000044000000-0x0000000044200000           2M 2   R W X AF BLK
0x0000000044200000-0x0000000047600000          52M 2
0x0000000047600000-0x0000000047800000           2M 2   R W   AF BLK
0x0000000047800000-0x0000000047e00000           6M 2   R W X AF BLK
0x0000000047e00000-0x0000000048000000           2M 2   R W   AF BLK
0x0000000048000000-0x00000000b9c00000        1820M 2
0x00000000b9c00000-0x00000000b9e00000           2M 2   R W X AF BLK
0x00000000b9e00000-0x00000000bb800000          26M 2
0x00000000bb800000-0x00000000bba00000           2M 2   R W X AF BLK
0x00000000bba00000-0x00000000bbe00000           4M 2   R W   AF BLK
0x00000000bbe00000-0x00000000bc200000           4M 2   R W X AF BLK
0x00000000bc200000-0x00000000bc800000           6M 2   R W   AF BLK
0x00000000bc800000-0x00000000be400000          28M 2
0x00000000be400000-0x00000000bf800000          20M 2   R W X AF BLK
0x00000000bf800000-0x00000000bfe00000           6M 2   R W   AF BLK
0x00000000bfe00000-0x00000000c0000000           2M 2   R W X AF BLK

So 16kB is the one that needs investigating, and I strongly suspect
that 64kB is in the same boat...

Thanks,

	M. (signing off for the day)

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2024-08-30 15:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27  8:45 [PATCH v9 0/5] arm64: ptdump: View the second stage page-tables Sebastian Ene
2024-08-27  8:45 ` [PATCH v9 1/5] KVM: arm64: Move pagetable definitions to common header Sebastian Ene
2024-08-27  8:45 ` [PATCH v9 2/5] arm64: ptdump: Expose the attribute parsing functionality Sebastian Ene
2024-08-30 12:28   ` Marc Zyngier
2024-09-02  5:36     ` Sebastian Ene
2024-08-27  8:45 ` [PATCH v9 3/5] arm64: ptdump: Use the ptdump description from a local context Sebastian Ene
2024-08-27  8:45 ` [PATCH v9 4/5] KVM: arm64: Register ptdump with debugfs on guest creation Sebastian Ene
2024-08-30 10:24   ` Vincent Donnefort
2024-08-30 14:11     ` Marc Zyngier
2024-09-02  5:27       ` Sebastian Ene
2024-09-02 11:13       ` Vincent Donnefort
2024-09-02 13:45         ` Sebastian Ene
2024-09-02  5:31     ` Sebastian Ene
2024-08-27  8:45 ` [PATCH v9 5/5] KVM: arm64: Introduce the PTDUMP_STAGE2_DEBUGFS config Sebastian Ene
2024-08-30 10:26   ` Vincent Donnefort
2024-08-30 14:44 ` [PATCH v9 0/5] arm64: ptdump: View the second stage page-tables Marc Zyngier
2024-08-30 15:00   ` Marc Zyngier [this message]
2024-09-02  6:11     ` Sebastian Ene
2024-09-02  7:08       ` Sebastian Ene
2024-09-02  8:22         ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8634mmvyx0.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexghiti@rivosinc.com \
    --cc=ankita@nvidia.com \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=james.morse@arm.com \
    --cc=kernel-team@android.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=oliver.upton@linux.dev \
    --cc=rananta@google.com \
    --cc=ryan.roberts@arm.com \
    --cc=sebastianene@google.com \
    --cc=shahuang@redhat.com \
    --cc=suzuki.poulose@arm.com \
    --cc=vdonnefort@google.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.