kvm: vmx: Sync all matching EPTPs when injecting nested EPT fault
authorJunaid Shahid <junaids@google.com>
Fri, 6 Aug 2021 22:22:29 +0000 (15:22 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 13 Aug 2021 07:20:58 +0000 (03:20 -0400)
commit85aa8889b82e0eec680a21ea28dbf57c6acfe182
treeb5adfa1d6f4a9eaa46c603d971667e14c0820f92
parent375d1adebc11b99e94e85f0ba2160e866e277447
kvm: vmx: Sync all matching EPTPs when injecting nested EPT fault

When a nested EPT violation/misconfig is injected into the guest,
the shadow EPT PTEs associated with that address need to be synced.
This is done by kvm_inject_emulated_page_fault() before it calls
nested_ept_inject_page_fault(). However, that will only sync the
shadow EPT PTE associated with the current L1 EPTP. Since the ASID
is based on EP4TA rather than the full EPTP, so syncing the current
EPTP is not enough. The SPTEs associated with any other L1 EPTPs
in the prev_roots cache with the same EP4TA also need to be synced.

Signed-off-by: Junaid Shahid <junaids@google.com>
Message-Id: <20210806222229.1645356-1-junaids@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c