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 370A2C433EF for ; Mon, 22 Nov 2021 19:48:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240178AbhKVTvx (ORCPT ); Mon, 22 Nov 2021 14:51:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235503AbhKVTvv (ORCPT ); Mon, 22 Nov 2021 14:51:51 -0500 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B372CC061714 for ; Mon, 22 Nov 2021 11:48:44 -0800 (PST) Received: by mail-io1-xd2d.google.com with SMTP id c3so24974661iob.6 for ; Mon, 22 Nov 2021 11:48:44 -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=a7b8ONzI4O1Cf/Wv2mQ+ZJBesgO4gEQA4zliRNKUs7A=; b=ZA8vvZhM/dx5Z79tuvrByHtEj+m9vebq95Cl6xjd4BBf6XzkwJK3CfO0ftQVWllsam Z0c6PNnkPj26Dm4l3bKah13gMadP1VRi/Gg6VFdglxYNZ3sFK87S9uz4IApbcYKZr8CG VocPq9MCmXsc1HbBDnFwfcPMgflawmPIdK1Tiupfz+PmVM0BmHZrJP6uNbaTG2l0THsg wmjx+dCTAbRnzLni0AXizp1tp3b5m2tAFqU4ByZLE4/G1HIbP04EYd0NTKLJvmqvT5uJ xZ3FGgE49OvY6iVRlWfoRvsj0P5lGr7sUV7/MxRNL8yFhyRYAYUo24QGpEeaV9Ke0cHX EnlQ== 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=a7b8ONzI4O1Cf/Wv2mQ+ZJBesgO4gEQA4zliRNKUs7A=; b=66Big41AXiekZipCzhlHhH5UuPjVEZzAwY4VQyU7nuPHVqI5Sq/5+XLaz3z7SRjZjy GuT3Y1nZeKFoO+rjCzgU1meBNjHqEP/PRpEZWcPkIAOAmPsz8avA/Qc3HWN9LBVMlz8Q AbG8LglcPEcZ/YtuO9d10q2bGTrIlxOASDLbC4otb4sCsBslqRlx9ynLk7zvDpeeg3m/ T0mfiQalg+oagBYYDtergVo7MP8eq6ylVcR1VeHdyefrfU16unpAt75ozOCt9TS0QuAA Poo4ZYP+mNU3Jg3561WpQow5P7GmyVbHVzk51fubi0R0tPTQLAenkfp1RiuAiCwvoGfv KNbw== X-Gm-Message-State: AOAM531SgiEJmKaHl4T1KamhF6p5UP3UDjkI3D81SLHy3ep2HMw/GNiB 25qpTcUr5zbLb/liCtYVM0xaJAr+G6brmT3L/HqdjA== X-Google-Smtp-Source: ABdhPJzEXIZWMRTl2+TlMEQiNVQw6LVHIdMgpG2rxLA+qxqYEr0Kt4kk7MyAG/gclsqOODk5xSIKHV+bJzLIm62PLuk= X-Received: by 2002:a5d:8049:: with SMTP id b9mr25075552ior.41.1637610523811; Mon, 22 Nov 2021 11:48:43 -0800 (PST) MIME-Version: 1.0 References: <20211120045046.3940942-1-seanjc@google.com> <20211120045046.3940942-2-seanjc@google.com> In-Reply-To: <20211120045046.3940942-2-seanjc@google.com> From: Ben Gardon Date: Mon, 22 Nov 2021 11:48:33 -0800 Message-ID: Subject: Re: [PATCH 01/28] KVM: x86/mmu: Use yield-safe TDP MMU root iter in MMU notifier unmapping 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:50 PM Sean Christopherson wrote: > > Use the yield-safe variant of the TDP MMU iterator when handling an > unmapping event from the MMU notifier, as most occurences of the event > allow yielding. > > Fixes: e1eed5847b09 ("KVM: x86/mmu: Allow yielding during MMU notifier unmap/zap, if possible") > Cc: stable@vger.kernel.org > Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon > --- > arch/x86/kvm/mmu/tdp_mmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c > index 377a96718a2e..a29ebff1cfa0 100644 > --- a/arch/x86/kvm/mmu/tdp_mmu.c > +++ b/arch/x86/kvm/mmu/tdp_mmu.c > @@ -1031,7 +1031,7 @@ bool kvm_tdp_mmu_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range, > { > struct kvm_mmu_page *root; > > - for_each_tdp_mmu_root(kvm, root, range->slot->as_id) > + 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); > > -- > 2.34.0.rc2.393.gf8c9666880-goog >