On Fri, Jan 20, 2012 at 08:49:56AM -0500, Xin Tong wrote: > maybe one of the reasons of having the virtual pc hash table is that > the pc does not need to be tranlated to a physical pc which is used in > the physical pc hash table.
Take context switch as an example. Before context switching, you can use process A's virtual pc to index the virtual pc hash table. After context switching, the original virtual pc hash table is no longer valid since process B has the same virtual address space. Therefore, QEMU turns to use (guest) physical pc to index the physical pc hash table. If the tb of process B is existed, QEMU refill the virtual pc hash table. Otherwise, it does the translation. Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj