Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6318EC433F5 for ; Mon, 22 Nov 2021 22:49:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231977AbhKVWwq (ORCPT ); Mon, 22 Nov 2021 17:52:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230452AbhKVWwo (ORCPT ); Mon, 22 Nov 2021 17:52:44 -0500 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B419C061574 for ; Mon, 22 Nov 2021 14:49:37 -0800 (PST) Received: by mail-il1-x135.google.com with SMTP id k1so19738650ilo.7 for ; Mon, 22 Nov 2021 14:49:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=q8VwkMHpFNnFdzRNWiCp6tnpWpX9qcaoYvQPMyder14=; b=sRTD4QJQBQ1UG5qfHLvRYQMWeMIJeLpzw+oSGs8Z0kj6bI8dunoJHkoMBg3Iwk2LXJ yZpzzUsanlPC9+TRlPpSOxAGCMvAWfknoms7fS0FxNI1nNic5Cj0nIgrsWYpvDJYyVL1 SA1Bve0QbKEPEUj5YYwIYGxZcCh2LE24kSCCrXyqNo72DahiqGJau7s7/k2PDmKplS3T 0CmbAODlbdLN5c7ef6s/q4B9cnX1L3MbBVjFt4IbWlfVcaFpN7qDGdQisEEtB/AD7gdY qhNM2jz2f5TkFcFFVPCH5H34v6yJb4djbYZIpb9V5BsBmZOHfhmLsg1QoHBWPBnrLz+b g2ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=q8VwkMHpFNnFdzRNWiCp6tnpWpX9qcaoYvQPMyder14=; b=bRGau9jreelrxb4BsDB02vHyyd0dN8bHc9YEEn0I/yHc8Az2gFOMTPSXwXMhYcYS8V SSMN95Atado2SDVjCybVyeFvHQ2uBWYyqf2HKocm73MHRo5M9wYEmw+uPt2szeMI4dlp roWGTI5NLrfcqzO9wPwsSnp3xsahvXwQQptBELoiCD8vMk/V2dKiSsnN8MZuraD8pSVa rD6LBgUXtkmOgC0VIZxYocOJah4vHuWZ78rpCf0tnJa8Mt0qTBBOk/NX7zt+TK1OIwHV B9LxofjGLlMtF4JVK/xtA1DzoTjosLAoooMIYKZ+gupP5RCIDMbrD3COzlnNDSyxeIWI SoMw== X-Gm-Message-State: AOAM5306/YxBWZ9JDuqZmMDhPcPkQGfweeX8hvhysH990PQzGI2Ht0AK oQUz1hnnmceiPMT5QfqKHqmdh/DLADnC+2tZmR8tdA== X-Google-Smtp-Source: ABdhPJxYT4J2t4C6ULQlvRTl1gS6hjflGyeDEV1HOwqBN9omtqd+llYfd9eBFtfw8ecMl0UaDwLlzxJe3n9sVI+T0Zo= X-Received: by 2002:a05:6e02:52d:: with SMTP id h13mr521603ils.274.1637621376511; Mon, 22 Nov 2021 14:49:36 -0800 (PST) MIME-Version: 1.0 References: <20211120045046.3940942-1-seanjc@google.com> <20211120045046.3940942-21-seanjc@google.com> In-Reply-To: <20211120045046.3940942-21-seanjc@google.com> From: Ben Gardon Date: Mon, 22 Nov 2021 14:49:25 -0800 Message-ID: Subject: Re: [PATCH 20/28] KVM: x86/mmu: Use common TDP MMU zap helper for MMU notifier unmap hook To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Hou Wenlong Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 19, 2021 at 8:51 PM Sean Christopherson wrote: > > Use the common TDP MMU zap helper when hanlding an MMU notifier unmap > event, the two flows are semantically identical. > > No functional change intended. > > Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon > --- > arch/x86/kvm/mmu/tdp_mmu.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c > index ea6651e735c2..9449cb5baf0b 100644 > --- a/arch/x86/kvm/mmu/tdp_mmu.c > +++ b/arch/x86/kvm/mmu/tdp_mmu.c > @@ -1112,13 +1112,8 @@ int kvm_tdp_mmu_map(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault) > bool kvm_tdp_mmu_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range, > bool flush) > { > - struct kvm_mmu_page *root; > - > - for_each_tdp_mmu_root_yield_safe(kvm, root, range->slot->as_id, false) > - flush = zap_gfn_range(kvm, root, range->start, range->end, > - range->may_block, flush, false); > - > - return flush; > + return __kvm_tdp_mmu_zap_gfn_range(kvm, range->slot->as_id, range->start, > + range->end, range->may_block, flush); > } > > typedef bool (*tdp_handler_t)(struct kvm *kvm, struct tdp_iter *iter, > -- > 2.34.0.rc2.393.gf8c9666880-goog >