qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yuan Yao <yuan.yao@intel.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Yang Zhong" <yang.zhong@intel.com>,
	"Connor Kuehl" <ckuehl@redhat.com>
Cc: qemu-devel@nongnu.org, Yuan Yao <yuan.yao@intel.com>,
	Yamahata Isaku <isaku.yamahata@intel.com>
Subject: [PATCH 1/1] i386/monitor: Fix page table walking issue for LA57 enabled guest
Date: Thu,  9 Jun 2022 16:34:56 +0800	[thread overview]
Message-ID: <20220609083456.77946-1-yuan.yao@intel.com> (raw)

Don't skip next leve page table for pdpe/pde when the
PG_PRESENT_MASK 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.yao@intel.com>
---
 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



             reply	other threads:[~2022-06-09  8:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09  8:34 Yuan Yao [this message]
2022-06-24  2:04 ` [PATCH 1/1] i386/monitor: Fix page table walking issue for LA57 enabled guest Zhang, Chen
2022-06-24  6:22   ` Yao, Yuan
2022-06-24  5:35 ` Markus Armbruster
2022-06-24  6:21   ` Yao, Yuan

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=20220609083456.77946-1-yuan.yao@intel.com \
    --to=yuan.yao@intel.com \
    --cc=ckuehl@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=isaku.yamahata@intel.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yang.zhong@intel.com \
    /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).