From 574d96933ceff60b2d13fe97602572fc7e95f7c6 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Fri, 12 Apr 2019 16:26:52 +0100 Subject: hmp: gva2gpa debug command Add a gva2gpa command purely for debug which performs address translation on the gva, the existing gpa2hva command can then also be used to find it in the qemu userspace; e.g. (qemu) info registers .... RSP=ffffffff81c03e98 .... (qemu) gva2gpa 0xffffffff81c03e98 gpa: 0x1c03e98 (qemu) gpa2hva 0x1c03e98 Host virtual address for 0x1c03e98 (pc.ram) is 0x7f0599a03e98 (qemu) x/10x 0xffffffff81c03e98 ffffffff81c03e98: 0x81c03eb8 0xffffffff 0x8101ea3f 0xffffffff ffffffff81c03ea8: 0x81d27b00 0xffffffff 0x00000000 0x00000000 ffffffff81c03eb8: 0x81c03ec8 0xffffffff gdb -p ...qemu... (gdb) x/10x 0x7f0599a03e98 0x7f0599a03e98: 0x81c03eb8 0xffffffff 0x8101ea3f 0xffffffff 0x7f0599a03ea8: 0x81d27b00 0xffffffff 0x00000000 0x00000000 0x7f0599a03eb8: 0x81c03ec8 0xffffffff Signed-off-by: Dr. David Alan Gilbert Message-Id: <20190412152652.827-1-dgilbert@redhat.com> Reviewed-by: Stefan Hajnoczi Signed-off-by: Dr. David Alan Gilbert --- hmp-commands.hx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'hmp-commands.hx') diff --git a/hmp-commands.hx b/hmp-commands.hx index 9b4035965c..a2c3ffc218 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -585,6 +585,21 @@ STEXI @findex gpa2hpa Print the host physical address at which the guest's physical address @var{addr} is mapped. +ETEXI + + { + .name = "gva2gpa", + .args_type = "addr:l", + .params = "addr", + .help = "print the guest physical address corresponding to a guest virtual address", + .cmd = hmp_gva2gpa, + }, + +STEXI +@item gva2gpa @var{addr} +@findex gva2gpa +Print the guest physical address at which the guest's virtual address @var{addr} +is mapped based on the mapping for the current CPU. ETEXI { -- cgit v1.2.3