<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 30, 2014 at 2:32 AM, Dave Anderson <span dir="ltr"><<a href="mailto:anderson@redhat.com" target="_blank">anderson@redhat.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
----- Original Message -----<br>
><br>
><br>
><br>
> On Fri, May 30, 2014 at 12:36 AM, Dave Anderson < <a href="mailto:anderson@redhat.com">anderson@redhat.com</a> ><br>
> wrote:<br>
><br>
><br>
><br>
><br>
><br>
> ----- Original Message -----<br>
> > hi,<br>
> ><br>
> > i dump the whole memory of a KVM guest out using "dump-guest-memory". as a<br>
> > result, now i have a big ELF file. i want to use "crash" to analyze this<br>
> > dump file.<br>
> ><br>
> > the question is: given the RIP address of an instruction in the KVM guest -<br>
> > for example 0x12345, which is virtual address, how can "crash" tell me<br>
> > where<br>
> > in the dump is the position of 0x12345? is there such a command for this?<br>
><br>
> Is the RIP in user-space or kernel-space? If I understand your question correctly,<br>
> you can enter "vtop" of the RIP to get the physical address, but if it's a<br>
> user-space address, you must ensure that you have "set" the context to the<br>
> PID/task-address of the task whose user-space memory you want to look at.<br>
><br>
> ><br>
> > my intention is to locate the place, and analyze the assembly instruction<br>
> > around that RIP to see what is running at the time i dumped the KVM memory.<br>
><br>
> You really don't need to know where in the dumpfile the RIP is located<br>
> for disassembly. If it's kernel-space you're interested in, then you<br>
> can just do "dis -rl <RIP-address>" to see the sequence of instructions<br>
> leading up to the RIP. If it's user-space, there's no way to determine<br>
> the beginning of the user-space function that was running, so the best<br>
> you can do is to "set" your context to the task you're interested in,<br>
> and do a "dis -u <user-space-RIP> <count>" to see where it was, and where<br>
> it would be going to.<br>
><br>
><br>
> yes, the RIP is in the kernel at that time.<br>
><br>
> could you please confirm that everything you said above work with all kind of<br>
> guest OS running on x86, but not only Linux guest?<br>
<br>
</div></div>Sorry, no, the crash utility will only work with a Linux guest.<br></blockquote><div><br></div><div>oh, but i understand that for commands like "vtop", the guest OS doesnt really matter, because how OS organizes its memory doesnt really depend on OS, right?<br>

<br></div><div>this is because the way virtual memory is mapped to physical memory address is defined by x86 hardware, but not by the OS itself.<br><br></div><div>(i would understand that there are not many commands that are OS-independent like "vtop")<br>

<br></div><div>thanks,<br></div><div>Jun<br></div></div></div></div>