Re: [PATCH v2 20/28] KVM: x86/mmu: Use atomic ops to set SPTEs in TDP MMU map

2021-04-01 Thread Sean Christopherson
On Thu, Apr 01, 2021, Paolo Bonzini wrote: > On 01/04/21 18:50, Ben Gardon wrote: > > > retry: > > > if (is_shadow_present_pte(iter.old_spte)) { > > > if (is_large_pte(iter.old_spte)) { > > > if (!tdp_mmu_zap_spte_atomic(vc

Re: [PATCH v2 20/28] KVM: x86/mmu: Use atomic ops to set SPTEs in TDP MMU map

2021-04-01 Thread Ben Gardon
On Thu, Apr 1, 2021 at 3:32 AM Paolo Bonzini wrote: > > On 02/02/21 19:57, Ben Gardon wrote: > > @@ -720,7 +790,8 @@ int kvm_tdp_mmu_map(struct kvm_vcpu *vcpu, gpa_t gpa, > > u32 error_code, > >*/ > > if (is_shadow_present_pte(iter.old_spte) && > >

Re: [PATCH v2 20/28] KVM: x86/mmu: Use atomic ops to set SPTEs in TDP MMU map

2021-04-01 Thread Paolo Bonzini
On 01/04/21 18:50, Ben Gardon wrote: retry: if (is_shadow_present_pte(iter.old_spte)) { if (is_large_pte(iter.old_spte)) { if (!tdp_mmu_zap_spte_atomic(vcpu->kvm, &iter)) break;

Re: [PATCH v2 20/28] KVM: x86/mmu: Use atomic ops to set SPTEs in TDP MMU map

2021-04-01 Thread Paolo Bonzini
On 02/02/21 19:57, Ben Gardon wrote: @@ -720,7 +790,8 @@ int kvm_tdp_mmu_map(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code, */ if (is_shadow_present_pte(iter.old_spte) && is_large_pte(iter.old_spte)) { - tdp_mmu_set_sp

Re: [PATCH v2 20/28] KVM: x86/mmu: Use atomic ops to set SPTEs in TDP MMU map

2021-02-08 Thread Paolo Bonzini
On 06/02/21 01:26, Sean Christopherson wrote: We could fudge around it via #ifdef around the xchg(). Making all of tdp_mmu.c x86-64 only would be nice to avoid future annoyance, though the number of stubs required would be painful... It's really just a handful, so it's worth it. Paolo

Re: [PATCH v2 20/28] KVM: x86/mmu: Use atomic ops to set SPTEs in TDP MMU map

2021-02-05 Thread Sean Christopherson
On Wed, Feb 03, 2021, Paolo Bonzini wrote: > On 02/02/21 19:57, Ben Gardon wrote: > > To prepare for handling page faults in parallel, change the TDP MMU > > page fault handler to use atomic operations to set SPTEs so that changes > > are not lost if multiple threads attempt to modify the same SPTE

Re: [PATCH v2 20/28] KVM: x86/mmu: Use atomic ops to set SPTEs in TDP MMU map

2021-02-03 Thread Paolo Bonzini
On 02/02/21 19:57, Ben Gardon wrote: To prepare for handling page faults in parallel, change the TDP MMU page fault handler to use atomic operations to set SPTEs so that changes are not lost if multiple threads attempt to modify the same SPTE. Reviewed-by: Peter Feiner Signed-off-by: Ben Gardon

Re: [PATCH v2 20/28] KVM: x86/mmu: Use atomic ops to set SPTEs in TDP MMU map

2021-02-02 Thread kernel test robot
Hi Ben, Thank you for the patch! Yet something to improve: [auto build test ERROR on tip/master] [also build test ERROR on linux/master linus/master v5.11-rc6 next-20210125] [cannot apply to kvm/linux-next tip/sched/core] [If your patch is applied to the wrong git tree, kindly drop us a note. And

[PATCH v2 20/28] KVM: x86/mmu: Use atomic ops to set SPTEs in TDP MMU map

2021-02-02 Thread Ben Gardon
To prepare for handling page faults in parallel, change the TDP MMU page fault handler to use atomic operations to set SPTEs so that changes are not lost if multiple threads attempt to modify the same SPTE. Reviewed-by: Peter Feiner Signed-off-by: Ben Gardon --- v1 -> v2 - Rename "atomic" arg