Hi, On Sun, Nov 13, 2011, Xin Tong wrote about "Invalidate TLB": > I have 2 questions regard TLB and PageTable in KVM. > > 1. I do not really get how the TLB gets saved and restored on when the > guest os vmexits and vmresumes. Or maybe the TLB is not saved at all ( > TLB flushes when vmexit and vmenter happen). The TLB isn't saved and restored... Because the TLB translations of the host aren't relevant in the guest (and vice versa), in the first generation of VMX (Intel's hardware virtualization), it was necessary to flush the TLB on each VMX transion (vmexit and vmenter). In the second generation, VMX added TLB tags known as "VPID" (virtual processor id). The hypervisor allocates a unique id for each guest, and itself uses id 0, and translations cached in the TLB are tagged with the VPID value. Therefore, when VPID is being used, you no longer need to flush the TLB on every entry and exit. > 2. Say i have multiple vCPUs and each of them running some guest OS > processes. suddenly one of the vCPU vmexits due to a trapping > instruction. This trapping instruction modifies the page table of a > currently running process ( running on one of the other vCPUs - vCPU X > ). how does the vCPU X gets notified ( i.e. TLB invalidated). some > kind of apic needs to be sent, right ? I didn't quite follow your example, but there is indeed a remote tlb flush IPI. -- Nadav Har'El | Sunday, Nov 13 2011, nyh@xxxxxxxxxxxxxxxxxxx |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |I would give my right arm to be http://nadav.harel.org.il |ambidextrous. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html