[Crash-utility] ptov command

Dave Anderson anderson at redhat.com
Thu Jul 5 13:47:57 UTC 2012



----- Original Message -----
> 
> Hi Dave
> 
> I have a question about the ptov command. Ptov only handles kernel
> virtual addresses and their corresponding physical addresses.
> However if you give ptov a physical address that does not correspond
> to a kernel virtual address it still answers with an address. Users
> might get confused and do not know when to trust ptov, especially as
> the inverse command vtop always works.
> 
> So I would like to restrict ptov to give a result only when it is
> valid. The idea I have is that if ptov returns a valid virtual
> address then vtop on that address should give the same physical
> address back again. True??
> 
> cmd_ptov() in memory.c
> 
> ....
> 
> vaddr = PTOV(paddr);
> kvtop(0, vaddr, &paddr_tst, 0);
> if (paddr != paddr_tst) ... invalid vaddr, do not print it ...
> 
> Any comments?
> 
> Jan

Sounds reasonable, at least for the 32-bit arches.  I don't think it's
necessary for any 64-bit arch.  And you'd also need to account for kvtop()
failing outright (and returning FALSE).

Dave




More information about the Crash-utility mailing list