File tree Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -5814,27 +5814,20 @@ EXPORT_SYMBOL_GPL(kvm_mmu_invlpg);
5814
5814
void kvm_mmu_invpcid_gva (struct kvm_vcpu * vcpu , gva_t gva , unsigned long pcid )
5815
5815
{
5816
5816
struct kvm_mmu * mmu = vcpu -> arch .mmu ;
5817
- bool tlb_flush = false ;
5817
+ unsigned long roots = 0 ;
5818
5818
uint i ;
5819
5819
5820
- if (pcid == kvm_get_active_pcid (vcpu )) {
5821
- if (mmu -> invlpg )
5822
- mmu -> invlpg (vcpu , gva , mmu -> root .hpa );
5823
- tlb_flush = true;
5824
- }
5820
+ if (pcid == kvm_get_active_pcid (vcpu ))
5821
+ roots |= KVM_MMU_ROOT_CURRENT ;
5825
5822
5826
5823
for (i = 0 ; i < KVM_MMU_NUM_PREV_ROOTS ; i ++ ) {
5827
5824
if (VALID_PAGE (mmu -> prev_roots [i ].hpa ) &&
5828
- pcid == kvm_get_pcid (vcpu , mmu -> prev_roots [i ].pgd )) {
5829
- if (mmu -> invlpg )
5830
- mmu -> invlpg (vcpu , gva , mmu -> prev_roots [i ].hpa );
5831
- tlb_flush = true;
5832
- }
5825
+ pcid == kvm_get_pcid (vcpu , mmu -> prev_roots [i ].pgd ))
5826
+ roots |= KVM_MMU_ROOT_PREVIOUS (i );
5833
5827
}
5834
5828
5835
- if (tlb_flush )
5836
- static_call (kvm_x86_flush_tlb_gva )(vcpu , gva );
5837
-
5829
+ if (roots )
5830
+ kvm_mmu_invalidate_addr (vcpu , mmu , gva , roots );
5838
5831
++ vcpu -> stat .invlpg ;
5839
5832
5840
5833
/*
You can’t perform that action at this time.
0 commit comments