linux/arch/x86/kvm/mmu
Sean Christopherson b1a429fb18 KVM: x86/mmu: Verify shadow walk doesn't terminate early in page faults
WARN and bail if the shadow walk for faulting in a SPTE terminates early,
i.e. doesn't reach the expected level because the walk encountered a
terminal SPTE.  The shadow walks for page faults are subtle in that they
install non-leaf SPTEs (zapping leaf SPTEs if necessary!) in the loop
body, and consume the newly created non-leaf SPTE in the loop control,
e.g. __shadow_walk_next().  In other words, the walks guarantee that the
walk will stop if and only if the target level is reached by installing
non-leaf SPTEs to guarantee the walk remains valid.

Opportunistically use fault->goal-level instead of it.level in
FNAME(fetch) to further clarify that KVM always installs the leaf SPTE at
the target level.

Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Message-Id: <20210906122547.263316-1-jiangshanlai@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-10-01 03:44:52 -04:00
..
mmu_audit.c KVM: x86/mmu: Rename __gfn_to_rmap to gfn_to_rmap 2021-08-06 07:52:58 -04:00
mmu_internal.h KVM: MMU: change disallowed_hugepage_adjust() arguments to kvm_page_fault 2021-10-01 03:44:51 -04:00
mmu.c KVM: x86/mmu: Verify shadow walk doesn't terminate early in page faults 2021-10-01 03:44:52 -04:00
mmutrace.h KVM: MMU: change tracepoints arguments to kvm_page_fault 2021-10-01 03:44:52 -04:00
page_track.c KVM: x86: Handle SRCU initialization failure during page track init 2021-09-22 10:33:09 -04:00
paging_tmpl.h KVM: x86/mmu: Verify shadow walk doesn't terminate early in page faults 2021-10-01 03:44:52 -04:00
paging.h KVM: x86/mmu: Do not apply HPA (memory encryption) mask to GPAs 2021-07-14 12:17:56 -04:00
spte.c KVM: X86: Don't check unsync if the original spte is writible 2021-09-30 04:27:10 -04:00
spte.h KVM: x86/mmu: Do not apply HPA (memory encryption) mask to GPAs 2021-07-14 12:17:56 -04:00
tdp_iter.c KVM: x86/mmu: Store the address space ID in the TDP iterator 2021-03-16 14:16:34 -04:00
tdp_iter.h KVM: x86/mmu: Store the address space ID in the TDP iterator 2021-03-16 14:16:34 -04:00
tdp_mmu.c KVM: MMU: change tracepoints arguments to kvm_page_fault 2021-10-01 03:44:52 -04:00
tdp_mmu.h KVM: MMU: change kvm_tdp_mmu_map() arguments to kvm_page_fault 2021-10-01 03:44:50 -04:00