[panda-users] Different values for the same ASID

Brendan Dolan-Gavitt brendandg at nyu.edu
Mon Nov 20 14:29:28 EST 2017


The osi plugins tend to retrieve the value that the kernel has stored for
the ASID in the process data structure. On Linux, that's the kernel
*virtual* address of the page directory. If you need the ASID value seen by
the CPU (the physical address), you can subtract off the kernel offset.

It is annoying that this is inconsistent with how it works for Windows
(where the ASID value the kernel stores is the physical address, and so it
matches the value stored in the QEMU virtual CPU). I think we would be
happy to change this, if you want to put together a PR...

-Brendan

On Mon, Nov 20, 2017 at 7:58 PM, <aicardi at eurecom.fr> wrote:

> Hello everyone,
>
> I am trying to analyze some linux-x86 replays. I would like to trace
> every new process and every time a context switch occurs (by
> registering the callback PANDA_CB_ASID_CHANGED).
> The thing is that there is a discrepancy between two different ways of
> retrieving the current asid. One way is to access the 'new_asid'
> argument of the function registered for the event
> PANDA_CB_ASID_CHANGED, the other is to call get_current_process(cpu)
> and access the 'asid' field of the OsiProc struct.
> The problem is that if I try to use the two methods at the same time I
> get different asids: if 'new_asid' is e.g. 0xaaaabbbb then the value
> returned from get_current_process(cpu) is typically the same one but
> ORed with 0xf0000000 (i.e. 0xfaaabbbb).
> Does anybody know why this happens?
>
> I also noticed that sometimes the arguments of the function registered
> for PANDA_CB_ASID_CHANGED ('old_asid' and 'new_asid') have the same
> value. Is it normal? I thought they should be different since there
> has been a context switch.
>
>
> Thank you in advance!
> samaicardi
>
>
> ------------------------------------------------------------
> -------------------
> This message was sent using EURECOM Webmail: http://webmail.eurecom.fr
>
>
> _______________________________________________
> panda-users mailing list
> panda-users at mit.edu
> http://mailman.mit.edu/mailman/listinfo/panda-users
>



-- 
Brendan Dolan-Gavitt
Assistant Professor, Department of Computer Science and Engineering
NYU Tandon School of Engineering
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/panda-users/attachments/20171120/5631ba6b/attachment.html


More information about the panda-users mailing list