qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] Rework x86 page table walks
@ 2024-06-06 14:02 Don Porter
  2024-06-06 14:02 ` [PATCH v3 1/6] Add an "info pg" command that prints the current page tables Don Porter
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Don Porter @ 2024-06-06 14:02 UTC (permalink / raw)
  To: qemu-devel
  Cc: dave, peter.maydell, nadav.amit, richard.henderson, philmd,
	Don Porter

This version of the 'info pg' command adopts Peter Maydell's request
to write guest-agnostic page table iterator and accessor code, along
with architecture-specific hooks.  The first patch in this series
contributes a generic page table iterator and an x86 instantiation.
As a client, we first introduce an 'info pg' monitor command, as well
as a compressing callback hook for creating succinct page table
representations.

After this, each successive patch replaces an exisitng x86 page table
walker with a use of common iterator code.

I could use advice on how to ensure this is sufficiently well tested.
I used 'make check' and 'make check-avocado', which both pass; what is
the typical standard for testing something like a page table related
change?

As far as generality, I have only attempted this on x86, but I expect
the design would work for any similar radix-tree style page table.

I am still new enough to the code base that I wasn't certain about
where to put the generic code, as well as naming conventions.

Per David Gilbert's suggestion, I was careful to ensure that monitor
calls do not perturb TLB state (see the read-only flag in some
functions).

Version 3 of this patch series moves 'info pg' into common monitor
code and implements the architecture-specific code hooks.  I did not
do this with the 'info mem' and 'info tlb' commands, since they have
implementations on other ISAs.

Don Porter (6):
  Add an "info pg" command that prints the current page tables
  Convert 'info tlb' to use generic iterator
  Convert 'info mem' to use generic iterator
  Convert x86_cpu_get_memory_mapping() to use generic iterators
  Move tcg implementation of x86 get_physical_address into common helper
    code.
  Convert x86_mmu_translate() to use common code.

 hmp-commands-info.hx                 |  13 +
 hw/core/cpu-sysemu.c                 | 140 ++++++
 include/hw/core/cpu.h                |  34 +-
 include/hw/core/sysemu-cpu-ops.h     | 169 +++++++
 include/monitor/hmp-target.h         |   1 +
 include/monitor/monitor.h            |   4 +
 monitor/hmp-cmds-target.c            | 198 ++++++++
 target/i386/arch_memory_mapping.c    | 621 ++++++++++++++---------
 target/i386/cpu.c                    |  12 +
 target/i386/cpu.h                    |  63 +++
 target/i386/helper.c                 | 523 +++++++++++++++----
 target/i386/monitor.c                | 724 +++++++++------------------
 target/i386/tcg/sysemu/excp_helper.c | 555 +-------------------
 13 files changed, 1688 insertions(+), 1369 deletions(-)

--
2.34.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2024-06-15 15:35 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-06 14:02 [PATCH v3 0/6] Rework x86 page table walks Don Porter
2024-06-06 14:02 ` [PATCH v3 1/6] Add an "info pg" command that prints the current page tables Don Porter
2024-06-07  6:09   ` Philippe Mathieu-Daudé
2024-06-07  7:16   ` Daniel P. Berrangé
2024-06-11 18:49     ` Don Porter
2024-06-07 16:57   ` Richard Henderson
2024-06-14 18:16     ` Don Porter
2024-06-07 17:43   ` Richard Henderson
2024-06-14 21:14     ` Don Porter
2024-06-15 15:34       ` Richard Henderson
2024-06-06 14:02 ` [PATCH v3 2/6] Convert 'info tlb' to use generic iterator Don Porter
2024-06-07  6:02   ` Philippe Mathieu-Daudé
2024-06-10  9:13     ` Daniel P. Berrangé
2024-06-06 14:02 ` [PATCH v3 3/6] Convert 'info mem' " Don Porter
2024-06-10  9:15   ` Daniel P. Berrangé
2024-06-06 14:02 ` [PATCH v3 4/6] Convert x86_cpu_get_memory_mapping() to use generic iterators Don Porter
2024-06-06 14:02 ` [PATCH v3 5/6] Move tcg implementation of x86 get_physical_address into common helper code Don Porter
2024-06-07  6:12   ` Philippe Mathieu-Daudé
2024-06-07 17:03   ` Richard Henderson
2024-06-15 12:49     ` Don Porter
2024-06-06 14:02 ` [PATCH v3 6/6] Convert x86_mmu_translate() to use common code Don Porter
2024-06-07 17:28   ` Richard Henderson

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).