Re: [PATCH 19/22] kvm: mmu: Support write protection for nesting in tdp MMU

From: Sean Christopherson
Date: Wed Sep 30 2020 - 14:07:06 EST


On Fri, Sep 25, 2020 at 02:22:59PM -0700, Ben Gardon wrote:
> diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
> index 12892fc4f146d..e6f5093ba8f6f 100644
> --- a/arch/x86/kvm/mmu/mmu.c
> +++ b/arch/x86/kvm/mmu/mmu.c
> @@ -1667,6 +1667,11 @@ bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm,
> write_protected |= __rmap_write_protect(kvm, rmap_head, true);
> }
>
> + if (kvm->arch.tdp_mmu_enabled)
> + write_protected =
> + kvm_tdp_mmu_write_protect_gfn(kvm, slot, gfn) ||
> + write_protected;

Similar to other comments, this can use |=.

> +
> return write_protected;
> }