<div dir="ltr">The osi plugins tend to retrieve the value that the kernel has stored for the ASID in the process data structure. On Linux, that&#39;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.<div><br></div><div>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...</div><div><br></div><div>-Brendan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 20, 2017 at 7:58 PM,  <span dir="ltr">&lt;<a href="mailto:aicardi@eurecom.fr" target="_blank">aicardi@eurecom.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello everyone,<br>
<br>
I am trying to analyze some linux-x86 replays. I would like to trace<br>
every new process and every time a context switch occurs (by<br>
registering the callback PANDA_CB_ASID_CHANGED).<br>
The thing is that there is a discrepancy between two different ways of<br>
retrieving the current asid. One way is to access the &#39;new_asid&#39;<br>
argument of the function registered for the event<br>
PANDA_CB_ASID_CHANGED, the other is to call get_current_process(cpu)<br>
and access the &#39;asid&#39; field of the OsiProc struct.<br>
The problem is that if I try to use the two methods at the same time I<br>
get different asids: if &#39;new_asid&#39; is e.g. 0xaaaabbbb then the value<br>
returned from get_current_process(cpu) is typically the same one but<br>
ORed with 0xf0000000 (i.e. 0xfaaabbbb).<br>
Does anybody know why this happens?<br>
<br>
I also noticed that sometimes the arguments of the function registered<br>
for PANDA_CB_ASID_CHANGED (&#39;old_asid&#39; and &#39;new_asid&#39;) have the same<br>
value. Is it normal? I thought they should be different since there<br>
has been a context switch.<br>
<br>
<br>
Thank you in advance!<br>
samaicardi<br>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>-------------------<br>
This message was sent using EURECOM Webmail: <a href="http://webmail.eurecom.fr" rel="noreferrer" target="_blank">http://webmail.eurecom.fr</a><br>
<br>
<br>
______________________________<wbr>_________________<br>
panda-users mailing list<br>
<a href="mailto:panda-users@mit.edu">panda-users@mit.edu</a><br>
<a href="http://mailman.mit.edu/mailman/listinfo/panda-users" rel="noreferrer" target="_blank">http://mailman.mit.edu/<wbr>mailman/listinfo/panda-users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Brendan Dolan-Gavitt<br>Assistant Professor, Department of Computer Science and Engineering<br>NYU Tandon School of Engineering</div>
</div>