From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: "Dr. David Alan Gilbert" <dave@treblig.org>,
Don Porter <porter@cs.unc.edu>
Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org,
nadav.amit@gmail.com, richard.henderson@linaro.org
Subject: Re: [PATCH v2 1/6] Add an "info pg" command that prints the current page tables
Date: Mon, 3 Jun 2024 10:46:53 +0200 [thread overview]
Message-ID: <1bafa185-25bd-44d2-8f4b-51ca28125115@linaro.org> (raw)
In-Reply-To: <ZlnajZpUHyGDTgNx@gallifrey>
On 31/5/24 16:11, Dr. David Alan Gilbert wrote:
> * Don Porter (porter@cs.unc.edu) wrote:
>> The new "info pg" monitor command prints the current page table,
>> including virtual address ranges, flag bits, and snippets of physical
>> page numbers. Completely filled regions of the page table with
>> compatible flags are "folded", with the result that the complete
>> output for a freshly booted x86-64 Linux VM can fit in a single
>> terminal window. The output looks like this:
>>
>> VPN range Entry Flags Physical page
>> [7f0000000-7f0000000] PML4[0fe] ---DA--UWP
>> [7f28c0000-7f28fffff] PDP[0a3] ---DA--UWP
>> [7f28c4600-7f28c47ff] PDE[023] ---DA--UWP
>> [7f28c4655-7f28c4656] PTE[055-056] X--D---U-P 0000007f14-0000007f15
>> [7f28c465b-7f28c465b] PTE[05b] ----A--U-P 0000001cfc
>> ...
>> [ff8000000-ff8000000] PML4[1ff] ---DA--UWP
>> [ffff80000-ffffbffff] PDP[1fe] ---DA---WP
>> [ffff81000-ffff81dff] PDE[008-00e] -GSDA---WP 0000001000-0000001dff
>> [ffffc0000-fffffffff] PDP[1ff] ---DA--UWP
>> [ffffff400-ffffff5ff] PDE[1fa] ---DA--UWP
>> [ffffff5fb-ffffff5fc] PTE[1fb-1fc] XG-DACT-WP 00000fec00 00000fee00
>> [ffffff600-ffffff7ff] PDE[1fb] ---DA--UWP
>> [ffffff600-ffffff600] PTE[000] -G-DA--U-P 0000001467
>>
>> This draws heavy inspiration from Austin Clements' original patch.
>>
>> This also adds a generic page table walker, which other monitor
>> and execution commands will be migrated to in subsequent patches.
>>
>> Signed-off-by: Don Porter <porter@cs.unc.edu>
>> ---
>> hmp-commands-info.hx | 26 ++
>> include/monitor/hmp-target.h | 1 +
>> target/i386/arch_memory_mapping.c | 486 +++++++++++++++++++++++++++++-
>> target/i386/cpu.h | 16 +
>> target/i386/monitor.c | 380 +++++++++++++++++++++++
>> 5 files changed, 908 insertions(+), 1 deletion(-)
>>
>> diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
>> index 20a9835ea8..918b82015c 100644
>> --- a/hmp-commands-info.hx
>> +++ b/hmp-commands-info.hx
>> @@ -237,6 +237,32 @@ ERST
>> .cmd = hmp_info_mtree,
>> },
>>
>> +#if defined(TARGET_I386)
FYI in order to unify all QEMU system binaries as a single
one, we are trying to remove target-specific bits in monitor.
How 'info pg' should work in a binary supporting heterogeneous
emulation?
>> + {
>> + .name = "pg",
>> + .args_type = "",
>> + .params = "",
>> + .help = "show the page table",
>> + .cmd = hmp_info_pg,
>> + },
>> +#endif
>
> So that looks OK
next prev parent reply other threads:[~2024-06-03 8:47 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 16:08 Add 'info pg' command to monitor Don Porter
2024-04-15 16:08 ` [PATCH 1/2] monitor: Implement a generic x86 page table iterator Don Porter
2024-04-15 16:08 ` [PATCH 2/2] monitor: Add an "info pg" command that prints the current page tables Don Porter
2024-04-15 16:37 ` Add 'info pg' command to monitor Peter Maydell
2024-04-16 16:53 ` Don Porter
2024-04-16 17:03 ` Peter Maydell
2024-04-16 18:11 ` Don Porter
2024-04-17 8:30 ` Nadav Amit
2024-04-17 20:05 ` Nadav Amit
2024-04-17 21:03 ` Dr. David Alan Gilbert
2024-04-17 21:26 ` Richard Henderson
2024-04-19 14:47 ` Peter Maydell
2024-04-19 17:05 ` Dr. David Alan Gilbert
2024-05-24 17:07 ` [PATCH v2 0/6] Rework x86 page table walks Don Porter
2024-05-24 17:07 ` [PATCH v2 1/6] Add an "info pg" command that prints the current page tables Don Porter
2024-05-31 14:11 ` Dr. David Alan Gilbert
2024-06-03 8:46 ` Philippe Mathieu-Daudé [this message]
2024-06-03 9:34 ` Peter Maydell
2024-06-03 14:14 ` Don Porter
2024-06-03 14:07 ` Don Porter
2024-05-24 17:07 ` [PATCH v2 2/6] Convert 'info tlb' to use generic iterator Don Porter
2024-05-31 14:18 ` Dr. David Alan Gilbert
2024-06-05 18:35 ` Don Porter
2024-06-05 18:44 ` Richard Henderson
2024-06-05 18:53 ` Don Porter
2024-05-24 17:07 ` [PATCH v2 3/6] Convert 'info mem' " Don Porter
2024-05-24 17:07 ` [PATCH v2 4/6] Convert x86_cpu_get_memory_mapping() to use generic iterators Don Porter
2024-05-24 17:07 ` [PATCH v2 5/6] Move tcg implementation of x86 get_physical_address into common helper code Don Porter
2024-05-24 17:07 ` [PATCH v2 6/6] Convert x86_mmu_translate() to use common code Don Porter
2024-05-31 13:48 ` [PATCH v2 0/6] Rework x86 page table walks Peter Maydell
2024-05-31 14:23 ` Peter Maydell
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=1bafa185-25bd-44d2-8f4b-51ca28125115@linaro.org \
--to=philmd@linaro.org \
--cc=dave@treblig.org \
--cc=nadav.amit@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=porter@cs.unc.edu \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).