qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Don Porter <porter@cs.unc.edu>
To: qemu-devel@nongnu.org
Cc: dave@treblig.org, peter.maydell@linaro.org, nadav.amit@gmail.com,
	richard.henderson@linaro.org, Don Porter <porter@cs.unc.edu>
Subject: [PATCH v2 0/6] Rework x86 page table walks
Date: Fri, 24 May 2024 13:07:42 -0400	[thread overview]
Message-ID: <20240524170748.1842030-1-porter@cs.unc.edu> (raw)
In-Reply-To: <ZiKkWCjreGOMFX5p@gallifrey>

This version of the 'info pg' command adopts Peter Maydell's request
to write some 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).

I appreciate Nadav's suggestion about other ways to pursue the same
goal: I ended up deciding I would like to try my hand at consolidating
the x86 page table code.

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                 |  26 +
 include/monitor/hmp-target.h         |   1 +
 target/i386/arch_memory_mapping.c    | 735 +++++++++++++++-------
 target/i386/cpu.h                    |  66 ++
 target/i386/helper.c                 | 518 ++++++++++++----
 target/i386/monitor.c                | 883 +++++++++++++--------------
 target/i386/tcg/sysemu/excp_helper.c | 555 +----------------
 7 files changed, 1439 insertions(+), 1345 deletions(-)

--
2.34.1


  reply	other threads:[~2024-05-24 17:09 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             ` Don Porter [this message]
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é
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=20240524170748.1842030-1-porter@cs.unc.edu \
    --to=porter@cs.unc.edu \
    --cc=dave@treblig.org \
    --cc=nadav.amit@gmail.com \
    --cc=peter.maydell@linaro.org \
    --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).