Skip to content

Commit c3204c4

Browse files
mzhang3579sean-jc
authored andcommitted
KVM: Documentation: Add the missing description for mmu_valid_gen into kvm_mmu_page
Add the description for mmu_valid_gen into kvm_mmu_page description. mmu_valid_gen is used in shadow MMU for fast zapping. Update the doc to reflect that. Signed-off-by: Mingwei Zhang <[email protected]> Reviewed-by: Kai Huang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 6a71392 commit c3204c4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Documentation/virt/kvm/x86/mmu.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,16 @@ Shadow pages contain the following information:
208208
The page is not backed by a guest page table, but its first entry
209209
points to one. This is set if NPT uses 5-level page tables (host
210210
CR4.LA57=1) and is shadowing L1's 4-level NPT (L1 CR4.LA57=0).
211+
mmu_valid_gen:
212+
The MMU generation of this page, used to fast zap of all MMU pages within a
213+
VM without blocking vCPUs too long. Specifically, KVM updates the per-VM
214+
valid MMU generation which causes the mismatch of mmu_valid_gen for each mmu
215+
page. This makes all existing MMU pages obsolete. Obsolete pages can't be
216+
used. Therefore, vCPUs must load a new, valid root before re-entering the
217+
guest. The MMU generation is only ever '0' or '1'. Note, the TDP MMU doesn't
218+
use this field as non-root TDP MMU pages are reachable only from their
219+
owning root. Thus it suffices for TDP MMU to use role.invalid in root pages
220+
to invalidate all MMU pages.
211221
gfn:
212222
Either the guest page table containing the translations shadowed by this
213223
page, or the base page frame for linear translations. See role.direct.

0 commit comments

Comments
 (0)