All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] CR3 difference by virsh and c program in Guest(update)
@ 2017-07-17 10:01 yu cui
  2017-07-17 19:17 ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 2+ messages in thread
From: yu cui @ 2017-07-17 10:01 UTC (permalink / raw)
  To: qemu-devel

I tried virsh command, it seems CR3 value returns by qemu and dmesg by a c
program in Guest is not same ?
The command is :
virsh -c qemu:///system qemu-monitor-command instance-0000009d '{"execute":
"human-monitor-command", "arguments": {"command-line": "info registers"}}'

When Guest is 4GB,  CR3 in guest is like "cr3 = 0x39a54000", while qemu
returns "cr3 = 0x0000000139a54000", with a gap of 4GB(0x0000000100000000).
When Guest is 8GB,  CR3 in guest is like "cr3 = 0x39a54000", while qemu
returns "cr3 = 0x0000000239a54000", with a gap of 8GB(0x0000000200000000).

So, it seems that CR3qemu = PysicalMem + CR3guest. Is it a bug?

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

* Re: [Qemu-devel] CR3 difference by virsh and c program in Guest(update)
  2017-07-17 10:01 [Qemu-devel] CR3 difference by virsh and c program in Guest(update) yu cui
@ 2017-07-17 19:17 ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 2+ messages in thread
From: Dr. David Alan Gilbert @ 2017-07-17 19:17 UTC (permalink / raw)
  To: yu cui; +Cc: qemu-devel

* yu cui (cuiyudaniu@gmail.com) wrote:
> I tried virsh command, it seems CR3 value returns by qemu and dmesg by a c
> program in Guest is not same ?
> The command is :
> virsh -c qemu:///system qemu-monitor-command instance-0000009d '{"execute":
> "human-monitor-command", "arguments": {"command-line": "info registers"}}'
> 
> When Guest is 4GB,  CR3 in guest is like "cr3 = 0x39a54000", while qemu
> returns "cr3 = 0x0000000139a54000", with a gap of 4GB(0x0000000100000000).
> When Guest is 8GB,  CR3 in guest is like "cr3 = 0x39a54000", while qemu
> returns "cr3 = 0x0000000239a54000", with a gap of 8GB(0x0000000200000000).
> 
> So, it seems that CR3qemu = PysicalMem + CR3guest. Is it a bug?

Is your C program reading the full 64 bits of CR3 or just the bottom 32
bits?

Dave

--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

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

end of thread, other threads:[~2017-07-17 19:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-17 10:01 [Qemu-devel] CR3 difference by virsh and c program in Guest(update) yu cui
2017-07-17 19:17 ` Dr. David Alan Gilbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.