Re: [PATCH v4 3/7] Add an "info pg" command that prints the current page tables

2024-07-26 Thread Don Porter
Hi Richard, Thank you for the feedback. On 7/23/24 11:33 PM, Richard Henderson wrote: On 7/23/24 11:05, Don Porter wrote: +    if (env->hflags & HF_GUEST_MASK) { + +    /* Extract the EPTP value from vmcs12 structure, store in arch state */ +    if (env->nested_sta

[PATCH v4 5/7] Convert 'info mem' to use generic iterator

2024-07-22 Thread Don Porter
-f000 e000 -xwr 000b8000-000b9000 1000 -xwr 0010-00108000 8000 -xwr 0020-007c6000 005c6000 -xwr Signed-off-by: Don Porter --- include/hw/core/sysemu-cpu-ops.h | 6 + target/i386/cpu.c

[PATCH v4 6/7] Convert x86_cpu_get_memory_mapping() to use generic iterators

2024-07-22 Thread Don Porter
Signed-off-by: Don Porter --- target/i386/arch_memory_mapping.c | 305 ++ 1 file changed, 19 insertions(+), 286 deletions(-) diff --git a/target/i386/arch_memory_mapping.c b/target/i386/arch_memory_mapping.c index ef29e4b42f..bb97443f0f 100644 --- a/target/i386

[PATCH v4 2/7] Import vmcs12 definition from Linux/KVM

2024-07-22 Thread Don Porter
Signed-off-by: Don Porter --- target/i386/kvm/vmcs12.h | 213 +++ 1 file changed, 213 insertions(+) create mode 100644 target/i386/kvm/vmcs12.h diff --git a/target/i386/kvm/vmcs12.h b/target/i386/kvm/vmcs12.h new file mode 100644 index 00..c7b139f4db

[PATCH v4 4/7] Convert 'info tlb' to use generic iterator.

2024-07-22 Thread Don Porter
, (guest physical to host physical): 1000: 01b2 XWR 2000: 01b21000 XWR 3000: 01b22000 XWR 4000: 01b23000 XWR 5000: 01b24000 XWR [...] Signed-off-by: Don Porter --- include/hw

[PATCH v4 3/7] Add an "info pg" command that prints the current page tables

2024-07-22 Thread Don Porter
e that are necessary to implement nested page table walks, but are not standardized across acclerator back-ends. Because I cannot test on all of these accelerators, the goal of this patch set is to detect if the accelerator and page table format can be walked, and fail gracefully if not. Signed-off-by:

[PATCH v4 7/7] Convert x86_mmu_translate() to use common code.

2024-07-22 Thread Don Porter
Signed-off-by: Don Porter --- target/i386/tcg/helper-tcg.h | 2 +- target/i386/tcg/sysemu/excp_helper.c | 417 ++- 2 files changed, 30 insertions(+), 389 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index 1cbeab9161

[PATCH v4 1/7] Code motion: expose some TCG definitions for page table walk consolidation.

2024-07-22 Thread Don Porter
Signed-off-by: Don Porter --- include/hw/core/sysemu-cpu-ops.h | 6 + target/i386/cpu.h| 5 ++-- target/i386/helper.c | 36 +++ target/i386/tcg/helper-tcg.h | 32 target/i386/tcg/seg_helper.c

[PATCH v4 0/7] Rework x86 page table walks

2024-07-22 Thread Don Porter
this definition is not in the standard Linux headers. Thank you, Don Don Porter (7): Code motion: expose some TCG definitions for page table walk consolidation. Import vmcs12 definition from Linux/KVM Add an "info pg" command that prints the current page tables Convert 'info t

Re: [PATCH v3 5/6] Move tcg implementation of x86 get_physical_address into common helper code.

2024-06-15 Thread Don Porter
On 6/7/24 1:03 PM, Richard Henderson wrote: On 6/6/24 07:02, Don Porter wrote: Signed-off-by: Don Porter ---   target/i386/cpu.h    |  42 ++   target/i386/helper.c | 515 +   target/i386/tcg/sysemu/excp_helper.c | 555

Re: [PATCH v3 1/6] Add an "info pg" command that prints the current page tables

2024-06-14 Thread Don Porter
On 6/7/24 1:43 PM, Richard Henderson wrote: On 6/6/24 07:02, Don Porter wrote: +/** + * get_pte - Copy the contents of the page table entry at node[i] into pt_entry. + *   Optionally, add the relevant bits to the virtual address in + *   vaddr_pte. + * + * @cs - CPU state

Re: [PATCH v3 1/6] Add an "info pg" command that prints the current page tables

2024-06-14 Thread Don Porter
Hi Richard, Thank you for all of the helpful comments!  v4 will be much cleaner as a result. A few follow-ups inline. On 6/7/24 12:57 PM, Richard Henderson wrote: On 6/6/24 07:02, Don Porter wrote: + +    /** + * @mon_init_page_table_iterator: Callback to configure a page table

Re: [PATCH v3 1/6] Add an "info pg" command that prints the current page tables

2024-06-11 Thread Don Porter
On 6/7/24 3:16 AM, Daniel P. Berrangé wrote: On Thu, Jun 06, 2024 at 10:02:48AM -0400, Don Porter wrote: Please don't add new HMP commands that don't have a QMP equivalent. This should be adding an 'x-query-pg' QMP command, which returns HumanReadableText, and then call that from the HMP

[PATCH v3 5/6] Move tcg implementation of x86 get_physical_address into common helper code.

2024-06-06 Thread Don Porter
Signed-off-by: Don Porter --- target/i386/cpu.h| 42 ++ target/i386/helper.c | 515 + target/i386/tcg/sysemu/excp_helper.c | 555 +-- 3 files changed, 562 insertions(+), 550 deletions(-) diff --git a/target

[PATCH v3 6/6] Convert x86_mmu_translate() to use common code.

2024-06-06 Thread Don Porter
Signed-off-by: Don Porter --- target/i386/arch_memory_mapping.c| 44 +++- target/i386/cpu.h| 5 +- target/i386/helper.c | 374 +++ target/i386/tcg/sysemu/excp_helper.c | 2 +- 4 files changed, 129 insertions(+), 296 deletions

[PATCH v3 3/6] Convert 'info mem' to use generic iterator

2024-06-06 Thread Don Porter
Signed-off-by: Don Porter --- include/hw/core/sysemu-cpu-ops.h | 6 + include/monitor/monitor.h| 4 + monitor/hmp-cmds-target.c| 5 +- target/i386/cpu.c| 1 + target/i386/cpu.h| 1 + target/i386/monitor.c| 354

[PATCH v3 2/6] Convert 'info tlb' to use generic iterator

2024-06-06 Thread Don Porter
Signed-off-by: Don Porter --- include/hw/core/sysemu-cpu-ops.h | 7 + monitor/hmp-cmds-target.c| 1 + target/i386/cpu.h| 2 + target/i386/monitor.c| 217 ++- 4 files changed, 53 insertions(+), 174 deletions(-) diff --git

[PATCH v3 4/6] Convert x86_cpu_get_memory_mapping() to use generic iterators

2024-06-06 Thread Don Porter
Signed-off-by: Don Porter --- target/i386/arch_memory_mapping.c | 320 -- 1 file changed, 43 insertions(+), 277 deletions(-) diff --git a/target/i386/arch_memory_mapping.c b/target/i386/arch_memory_mapping.c index 562a00b5a7..b52e98133c 100644 --- a/target/i386

[PATCH v3 0/6] Rework x86 page table walks

2024-06-06 Thread Don Porter
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

[PATCH v3 1/6] Add an "info pg" command that prints the current page tables

2024-06-06 Thread Don Porter
G-DA--U-P 001467 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 --- hmp-commands-info.hx | 13 ++

Re: [PATCH v2 2/6] Convert 'info tlb' to use generic iterator

2024-06-05 Thread Don Porter
On 6/5/24 14:44, Richard Henderson wrote: On 6/5/24 13:35, Don Porter wrote: On 5/31/24 10:18, Dr. David Alan Gilbert wrote: * Don Porter (por...@cs.unc.edu) wrote: Signed-off-by: Don Porter If this changes the output of 'info tlb' could you add a before/after to the commit message please

Re: [PATCH v2 2/6] Convert 'info tlb' to use generic iterator

2024-06-05 Thread Don Porter
On 5/31/24 10:18, Dr. David Alan Gilbert wrote: * Don Porter (por...@cs.unc.edu) wrote: Signed-off-by: Don Porter If this changes the output of 'info tlb' could you add a before/after to the commit message please. Thanks for the advice.  It should not change the output of info tlb. Also

Re: [PATCH v2 1/6] Add an "info pg" command that prints the current page tables

2024-06-03 Thread Don Porter
On 6/3/24 4:46 AM, Philippe Mathieu-Daudé wrote: On 31/5/24 16:11, Dr. David Alan Gilbert wrote: * Don Porter (por...@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 pa

Re: [PATCH v2 1/6] Add an "info pg" command that prints the current page tables

2024-06-03 Thread Don Porter
On 5/31/24 10:11 AM, Dr. David Alan Gilbert wrote: * Don Porter (por...@cs.unc.edu) wrote: + +SRST | + ``info pg`` | +Show the active page

[PATCH v2 5/6] Move tcg implementation of x86 get_physical_address into common helper code.

2024-05-24 Thread Don Porter
Signed-off-by: Don Porter --- target/i386/cpu.h| 41 ++ target/i386/helper.c | 515 + target/i386/tcg/sysemu/excp_helper.c | 555 +-- 3 files changed, 561 insertions(+), 550 deletions(-) diff --git a/target

[PATCH v2 2/6] Convert 'info tlb' to use generic iterator

2024-05-24 Thread Don Porter
Signed-off-by: Don Porter --- target/i386/monitor.c | 203 ++ 1 file changed, 28 insertions(+), 175 deletions(-) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index d7aae99c73..adf95edfb4 100644 --- a/target/i386/monitor.c +++ b/target/i386

[PATCH v2 6/6] Convert x86_mmu_translate() to use common code.

2024-05-24 Thread Don Porter
Signed-off-by: Don Porter --- target/i386/arch_memory_mapping.c| 37 ++- target/i386/cpu.h| 11 +- target/i386/helper.c | 371 ++- target/i386/tcg/sysemu/excp_helper.c | 2 +- 4 files changed, 128 insertions(+), 293 deletions

[PATCH v2 1/6] Add an "info pg" command that prints the current page tables

2024-05-24 Thread Don Porter
G-DA--U-P 001467 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 --- hmp-commands-info.hx | 26 ++ include/

[PATCH v2 4/6] Convert x86_cpu_get_memory_mapping() to use generic iterators

2024-05-24 Thread Don Porter
Signed-off-by: Don Porter --- target/i386/arch_memory_mapping.c | 318 -- 1 file changed, 40 insertions(+), 278 deletions(-) diff --git a/target/i386/arch_memory_mapping.c b/target/i386/arch_memory_mapping.c index 00bf2a2116..040464dd34 100644 --- a/target/i386

[PATCH v2 0/6] Rework x86 page table walks

2024-05-24 Thread Don Porter
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 m

[PATCH v2 3/6] Convert 'info mem' to use generic iterator

2024-05-24 Thread Don Porter
Signed-off-by: Don Porter --- target/i386/monitor.c | 344 +- 1 file changed, 35 insertions(+), 309 deletions(-) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index adf95edfb4..147743392d 100644 --- a/target/i386/monitor.c +++ b/target/i386

Re: Add 'info pg' command to monitor

2024-04-16 Thread Don Porter
On 4/16/24 13:03, Peter Maydell wrote: On Tue, 16 Apr 2024 at 17:53, Don Porter wrote: There is still a lot I am learning about the code base, but it seems that qemu_get_guest_memory_mapping() does most of what one would need. It currently only returns the "leaves" of the page

Re: Add 'info pg' command to monitor

2024-04-16 Thread Don Porter
On 4/15/24 12:37, Peter Maydell wrote: On Mon, 15 Apr 2024 at 17:09, Don Porter wrote: This patch set adds an 'info pg' command to the monitor, which prints a nicer view of the page tables. A project in my graduate OS course involves implementing x86 page table support, and my students have

[PATCH 1/2] monitor: Implement a generic x86 page table iterator

2024-04-15 Thread Don Porter
com: Rebased on top of 2.9.0] Signed-off-by: Geoffrey Thomas Signed-off-by: Don Porter --- target/i386/monitor.c | 149 ++ 1 file changed, 149 insertions(+) diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 3a281dab02..7924de6520 100644 --- a

Add 'info pg' command to monitor

2024-04-15 Thread Don Porter
tables. A project in my graduate OS course involves implementing x86 page table support, and my students have found this helpful for debugging. Thank you in advance for your time, Don Porter

[PATCH 2/2] monitor: Add an "info pg" command that prints the current page tables

2024-04-15 Thread Don Porter
PTE[000] -G-DA--U-P 001467 Signed-off-by: Austin Clements [geo...@ldpreload.com: Rebased on top of 2.9.0] Signed-off-by: Geoffrey Thomas Signed-off-by: Don Porter --- hmp-commands-info.hx | 15 +++ include/monitor/hmp-target.h | 2 + target/i386/mo

[PATCH v3] e1000: Convert debug macros into tracepoints.

2024-04-08 Thread Don Porter
The E1000 debug messages are very useful for developing drivers. Make these available to users without recompiling QEMU. Signed-off-by: Austin Clements [geo...@ldpreload.com: Rebased on top of 2.9.0] Signed-off-by: Geoffrey Thomas Signed-off-by: Don Porter Reviewed-by: Richard Henderson

Re: [PATCH v2] e1000: Convert debug macros into tracepoints.

2024-04-08 Thread Don Porter
On 4/3/24 2:44 PM, Austin Clements wrote: At this point there's not much of my original code left. :D Don, you're welcome to take the credit in the commit. Thanks Austin.  I'll send v3 with this change :) BTW, my attempt to include the appropriate maintainer from scripts/get_maintainer.pl

[PATCH v2] e1000: Convert debug macros into tracepoints.

2024-04-03 Thread Don Porter
From: Austin Clements The E1000 debug messages are very useful for developing drivers. Make these available to users without recompiling QEMU. Signed-off-by: Austin Clements [geo...@ldpreload.com: Rebased on top of 2.9.0] Signed-off-by: Geoffrey Thomas Signed-off-by: Don Porter --- hw/net

[PATCH 0/1] Upstreaming Course Debugging Changes

2024-03-29 Thread Don Porter
says, it enables e1000 debugging without recompilation. One project in the course is to write an e1000 driver, and these logs are quite helpful to students. Thank you in advance for your time, Don Porter Austin Clements (1): e1000: Get debug flags from an environment variable hw/net/e1000.c | 65

[PATCH 1/1] e1000: Get debug flags from an environment variable

2024-03-29 Thread Don Porter
-by: Geoffrey Thomas Signed-off-by: Don Porter --- hw/net/e1000.c | 65 +- 1 file changed, 59 insertions(+), 6 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 43f3a4a701..8d46225944 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c