Abdel Hegazi
Abdel Hegazi

Reputation: 398

What Virtual TLB?

Does anybody knows what does it mean by Virtual TLB, and what is the difference between this VTLB and the normal TLB .. I can't find a clear answer on Google?

Upvotes: 0

Views: 1975

Answers (3)

user2760616
user2760616

Reputation: 11

The vTLBs are managed by VMM(Virtual Machine Manager).

A guest operating system may attempt to write to CR3. Any write to CR3 implies a TLB flush and a possible page table change. The following steps are performed:

  1. The VMM notes the new CR3 value (used later to walk guest page tables) and emulates the write.
  2. The VMM allocates a new PD page, with all invalid entries.
  3. The VMM sets actual processor CR3 register to point to the new PD page. The VMM may, at this point, speculatively fill in VTLB mappings for performance reasons.

Upvotes: 1

corny
corny

Reputation: 7852

Are you looking at kvm code?

A Translation Lookaside Buffer (TLB) caches mappings from virtual to physical addresses. A virtual TLB does this in software. It is useful for example, if the calculation of the physical address is very complicated.

Consider a guestVM running on a Host. If guestVM accesses virtual memory address A, this must be translated into the guest physical address B, then this B must be translated into the host virtual address C (the guestVM is kind of a process on the host). Then this is translated into the real/host physical address D.

Upvotes: 0

Muddu Patil
Muddu Patil

Reputation: 721

When emulating a CPU that has an MMU, it is vital that the logical-to-physical address translation be speedy. To do this, we follow the hardware's example and emulate a TLB in software. One option is to explicitly mimic the behaviors of the particular CPU architecture's TLB. Unfortunately, the details of TLB operation are often not fully disclosed, and even if they are, they are not quite as efficient to emulate in software. This may help you

Upvotes: 0

Related Questions