Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
KVM, x86/tdp_mmu: optimize remote tlb flush
Implement batched TLB shootdown for optimization. The current
implementation to zap multiple the EPT entries,
Loop on GFNs
1) Zap the EPT entry. Zero the EPT entry. PFN is saved on stack.
2) TDX SEAMCALL TDH.MEM.RANGE.BLOCK with GFN.
This corresponds to clearing the present bit.
3) TDH.MEM.TRACK. This corresponds to local tlb flush.
4) Send IPI to remote vcpus. This corresponds to remote tlb flush.
5) When destructing VM, TDH.MEM.REMOVE with PFN.
There is no corresponding to the VMX EPT operation.
At the last of zapping
6) kvm_flush_remote_tlbs_with_address(). This flushes shared EPT pointer.
No operations on Secure EPT.
The new implementation looks like. The number of TLB shootdown is reduced
from the number of the EPT entries to zap to one.
Loop on GFNs
1) Zap the EPT entry.
Clear present/dirty/access bits
Keep PFN
Set SPTE_PRIVATE_ZAPPED to indicate valid PFN to unlink from Secure
EPT.
2) TDX SEAMCALL TDH.MEM.RANGE.BLOCK with GFN
This corresponds to clearing the present bit.
3) TDH.MEM.TRACK. corresponds to local tlb flush
4) Send IPI to remote vcpus. This corresponds to remote tlb flush.
5) kvm_flush_remote_tlbs_with_address(). This flushes shared EPT
pointer. No operations on Secure EPT. When destructing VM, Check if
SPTE_PRIVATE_ZAPPED and issue TDH.MEM.REMOVE with PFNs.
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>- Loading branch information
Showing
6 changed files
with
234 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.