Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp241829pxm; Wed, 2 Mar 2022 14:23:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqz+nbAL8eNITZyVG5AtKjLL2CxwCltjC+kcRz19D2xD3yWTXSqSI7RAvkrtHCeDt7JCNV X-Received: by 2002:a17:90b:3d02:b0:1bc:85fa:e24 with SMTP id pt2-20020a17090b3d0200b001bc85fa0e24mr1953563pjb.239.1646259779723; Wed, 02 Mar 2022 14:22:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646259779; cv=none; d=google.com; s=arc-20160816; b=lZkXSXKt8NSCLpGF1Ty3IrbaMMDWzSQ5TUsCVi4esk8BX0qS6uJUVvGci+YwnBzMqT xjJnc5lWuplcFfv60F4kSU2+kXG3WnQ3FACkhy4kJammtgiCTKiRXITPSD6Zyin0QfkA 6Jl0WZ0YiIauBCsccBiInoVDfj2a8ju2RaVthmmxeC4HzTqRdLl0UhwBYsEZ7SSrt5a8 kkNoVlSLVaXPYxSmKtTsmBzD0fohhCdVR9u606GLSIvE9oYusctB7TFa3ZSJf1OWngiv lB4CYjcLXFTTPOxrnyFM1ue8LXLz/x9Rgv2Upk6oH9PZvFhZgD2x/xWJzBJjY2GUt0PO c8iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=O+z7hfIz3tju9l3ISOjUkJ5y2WlvKCbxrD0GfgR9pWQ=; b=vG8YSpmg8BCTXQ8iWPouVN+0dZJBKdgSEFZfCbvuo2zEl3iNSpu3/KZ5AtQk8R2wcq vMRxHlu9BAYDVzFPldN4l3zDD2EBxK+FBMKoJclaTJUEt05JG1uFfzO4NlvGv7tHXota CFXJkKh73PMAvBlRDMOnwPj2UxfzH68oE+sPuirbvDwJhLWbreiEp2eaIkfjQlmPhN78 +k8YK4z2eYeMwvvxyizklJ9f4CtBuq3TPKJdyqDJEA8fvTlfdnOmnVXY5smPBSrNKqm4 pYVL4Q70e+HGE69rxjqqgig3vKPOL46QwTv519Uu1M8OoFVqJC5nTM/VBX6eCvVZVWns wd6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GSvK5Psz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l136-20020a633e8e000000b003745324eef2si289018pga.533.2022.03.02.14.22.42; Wed, 02 Mar 2022 14:22:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GSvK5Psz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236376AbiCBShC (ORCPT + 99 others); Wed, 2 Mar 2022 13:37:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231497AbiCBSg6 (ORCPT ); Wed, 2 Mar 2022 13:36:58 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 95964CA310 for ; Wed, 2 Mar 2022 10:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646246174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O+z7hfIz3tju9l3ISOjUkJ5y2WlvKCbxrD0GfgR9pWQ=; b=GSvK5PszDoMKB2ap90qPNyg2DMpqo8YN8ptenpRVVh64RHQyedjE0t+nDFbMWJxjX02q02 BGxgtvrsWf2BaNUR6I0rcMx7bP+MHJ8f2teFQKNMafmy6Bj3fCcNzRrIECPTCS+/uHdsfr SIDb4eoMBQ1cCZBOfJIptR/T7pmhYYE= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-622-meHCMPrdM9O2dWf988efgQ-1; Wed, 02 Mar 2022 13:36:10 -0500 X-MC-Unique: meHCMPrdM9O2dWf988efgQ-1 Received: by mail-wr1-f69.google.com with SMTP id b7-20020a05600003c700b001efac398af7so946911wrg.22 for ; Wed, 02 Mar 2022 10:36:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=O+z7hfIz3tju9l3ISOjUkJ5y2WlvKCbxrD0GfgR9pWQ=; b=aZ2WWrjwuZz/EKsCddOQiraBEM/dCYnitV8PfqDiAVVV1+Rfbty27768aaQfl3aCrq fvy4kcfu9cvIpgTyNPh8x+91rgBuK3/SWVfkQlnPNHQieeQtCSb8r7zG9MCwGJ8+1sy2 VE7bcNNEYi0R7Cu9Lb8XB+tY7sjxfDmsLpkOMKhDJbX9OV0ErOxALbgByy64CMAV1NNS SIwM0KrywUJEREJ8RKbovT7X7/Vcv6iXzqV0ETFHlFGa8ywUpONfB+ZH7p+/CueHLHLL sYMtivZDMzNYOGGTCofBBlYy0rbxM0QDX8kXxMHKfJ15qorV9tgxoBOo6OSwKQs45JyZ epPA== X-Gm-Message-State: AOAM533By/OeXCc/JQY0RDn/P6aCMQk831QGKyzDBJpLAdjaRFqnZ41z ur0UpgfCLZRM1+3+tPv4LBBPukkUwu8noNV9pSDSRJI/gFMQyWAxiMihT6i8/9hXPoSTRoFAGIB ZIpayB3eNHBr4u9AJX0H7b1e7 X-Received: by 2002:a1c:ed18:0:b0:37e:7a1d:a507 with SMTP id l24-20020a1ced18000000b0037e7a1da507mr891231wmh.187.1646246168641; Wed, 02 Mar 2022 10:36:08 -0800 (PST) X-Received: by 2002:a1c:ed18:0:b0:37e:7a1d:a507 with SMTP id l24-20020a1ced18000000b0037e7a1da507mr891205wmh.187.1646246168412; Wed, 02 Mar 2022 10:36:08 -0800 (PST) Received: from ?IPV6:2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e? ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.googlemail.com with ESMTPSA id f16-20020adff590000000b001f0122f63e1sm5754207wro.85.2022.03.02.10.36.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Mar 2022 10:36:07 -0800 (PST) Message-ID: <43809107-cd8a-21f5-c45b-2f39c1bd037e@redhat.com> Date: Wed, 2 Mar 2022 19:36:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 22/28] KVM: x86/mmu: Zap defunct roots via asynchronous worker Content-Language: en-US To: David Matlack , Sean Christopherson Cc: Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , David Hildenbrand , kvm list , LKML , Ben Gardon , Mingwei Zhang References: <20220226001546.360188-1-seanjc@google.com> <20220226001546.360188-23-seanjc@google.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/2/22 19:33, David Matlack wrote: > On Wed, Mar 2, 2022 at 9:35 AM Sean Christopherson wrote: >> >> On Wed, Mar 02, 2022, Paolo Bonzini wrote: >>> However, I think we now need a module_get/module_put when creating/destroying >>> a VM; the workers can outlive kvm_vm_release and therefore any reference >>> automatically taken by VFS's fops_get/fops_put. >> >> Haven't read the rest of the patch, but this caught my eye. We _already_ need >> to handle this scenario. As you noted, any worker, i.e. anything that takes a >> reference via kvm_get_kvm() without any additional guarantee that the module can't >> be unloaded is suspect. x86 is mostly fine, though kvm_setup_async_pf() is likely >> affected, and other architectures seem to have bugs. >> >> Google has an internal patch that addresses this. I believe David is going to post >> the fix... David? > > This was towards the back of my queue but I can bump it to the front. > I'll have the patches out this week. Thanks! Paolo