> -----Original Message-----
> From: Qemu-devel <qemu-devel-
> bounces+chen.zhang=intel....@nongnu.org> On Behalf Of Yuan Yao
> Sent: Thursday, June 9, 2022 4:35 PM
> To: Paolo Bonzini <pbonz...@redhat.com>; Philippe Mathieu-Daudé
> <f4...@amsat.org>; Dr. David Alan Gilbert <dgilb...@redhat.com>; Zhong,
> Yang <yang.zh...@intel.com>; Connor Kuehl <cku...@redhat.com>
> Cc: qemu-devel@nongnu.org; Yao, Yuan <yuan....@intel.com>; Yamahata,
> Isaku <isaku.yamah...@intel.com>
> Subject: [PATCH 1/1] i386/monitor: Fix page table walking issue for LA57
> enabled guest
>
> Don't skip next leve page table for pdpe/pde when the PG_PRESENT_MASK
S/leve/level
> is set.
>
> This fixs the issue that no mapping information was collected from "info
> mem" for guest with LA57 enabled.
>
> Signed-off-by: Yuan Yao <yuan....@intel.com>
LGTM.
It should same with the excp_helper.c/mmu_translate() la57 implementation.
Reviewed-by: Zhang Chen <chen.zh...@intel.com>
Add Eric and Markus for double check.
Thanks
Chen
> ---
> target/i386/monitor.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/i386/monitor.c b/target/i386/monitor.c index
> 8e4b4d600c..3339550bbe 100644
> --- a/target/i386/monitor.c
> +++ b/target/i386/monitor.c
> @@ -489,7 +489,7 @@ static void mem_info_la57(Monitor *mon,
> CPUArchState *env)
> cpu_physical_memory_read(pdp_addr + l2 * 8, &pdpe, 8);
> pdpe = le64_to_cpu(pdpe);
> end = (l0 << 48) + (l1 << 39) + (l2 << 30);
> - if (pdpe & PG_PRESENT_MASK) {
> + if (!(pdpe & PG_PRESENT_MASK)) {
> prot = 0;
> mem_print(mon, env, &start, &last_prot, end, prot);
> continue;
> @@ -508,7 +508,7 @@ static void mem_info_la57(Monitor *mon,
> CPUArchState *env)
> cpu_physical_memory_read(pd_addr + l3 * 8, &pde, 8);
> pde = le64_to_cpu(pde);
> end = (l0 << 48) + (l1 << 39) + (l2 << 30) + (l3 << 21);
> - if (pde & PG_PRESENT_MASK) {
> + if (!(pde & PG_PRESENT_MASK)) {
> prot = 0;
> mem_print(mon, env, &start, &last_prot, end, prot);
> continue;
>
> base-commit: 6d940eff4734bcb40b1a25f62d7cec5a396f994a
> --
> 2.27.0
>