Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp248629pxm; Wed, 2 Mar 2022 14:33:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJygf/CjxJQ1Y1WfnanH9FKN6DRPgDttmm2PunVZmzGG9hEB0oIPN66G7/vthVhy3Ub+zqfP X-Received: by 2002:a17:90b:1d09:b0:1be:f949:4103 with SMTP id on9-20020a17090b1d0900b001bef9494103mr2047164pjb.150.1646260390153; Wed, 02 Mar 2022 14:33:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646260390; cv=none; d=google.com; s=arc-20160816; b=Nrf8RC/fPsNSn8WTABpd/o3DyKQZxxJQU1G2RIv60dFovY88e9iL0zevBeEknEUQGQ m4wm41uWZ27ayumVyj0eFhRarluCRoJIoyJdCReigz3gLZ4PK++aPdIQowUBoU4TsKsa hGtVLXiCdzQkMMUsOHrhmaqNgwy+rZv2hwYRS5/vzTooxhn+do+AKkaNbFeBUKwsWzf4 DCR9/gCkG8P/H0gKObt5pbzayaREewA+DM6Jgrko2xdGpzF2VF34bgXv07pedbT0TXbR w487oJ2STfsL+7Fm7kbV7fEkbQ3VO9M5TxFZn4AldhYx5gxh8zgY578XFo0JkR0wH9rX xwsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=g31Q1biXQsUkqLM6OlMOKrciBnbcEHw187r7e5y/1nE=; b=t+R8sGMS7bm+xmWmMWZwYIuOx7eW4P7YRRxmPnW+65SgMcBENRHUPCrhYQ32vbobYw krXsP5ptFNSBNIYGIEU/Ep5QSQMopFlPQAVpq4zxj+cyPfb3LFQBMbRi6w/1cpx1mZbM Md+IatqbR25U7q/YuKTWEB/UFCcE+E9dESG8EEdPqAFuKt8P73aMD+uDefqLlcfSeEHO Y0+XWIyHsx7P6jEYgWmUjlMM6gQ0S7HzKGeUvjoRtv6nTx3AQmYlVxLGoqvCdYrMv5wt 9CB5q1TW54QGWSdHwKoObNkFhJUxl9FUwKmpPuKOJnc56ag0bIf3+UsWFRNizYcg5UVC I1wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=nfPeMMpr; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j84-20020a628057000000b004f3cd3d5399si322332pfd.81.2022.03.02.14.33.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 14:33:10 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=nfPeMMpr; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 70036ECB28; Wed, 2 Mar 2022 14:31:55 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244093AbiCBRgZ (ORCPT + 99 others); Wed, 2 Mar 2022 12:36:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244062AbiCBRgY (ORCPT ); Wed, 2 Mar 2022 12:36:24 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 913164BFC1 for ; Wed, 2 Mar 2022 09:35:40 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id q11so2152100pln.11 for ; Wed, 02 Mar 2022 09:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=g31Q1biXQsUkqLM6OlMOKrciBnbcEHw187r7e5y/1nE=; b=nfPeMMpreLlCLk6pctgBoE+lV6HQ28hwlJaIsDBe4v3XPZCakjX7ckna8IQeJPstiG TNS6rcflcJ26IeNA6LAh4tu8lV0Ul6TuEzVVv8MlvDdx96b+NV5i5UKvOOXNuRDGjBjN 1A+o9Hf62ogU0BZ13H0YcnbLC0+eTVoQNZ9LAsu5srYNbI4pbcOmE85pss28cZv16UUJ Eby3tXZOI3TdMJpBA8/9IjcIsz/GU+06F8ucm4MR/wJ/YUoqfOtqGJHsMoPU5xIan0u2 8QTmFxOGY/cBacGUBWArzsPGTQfbP/ntehlonC6oGAGix1jwmBSk846SX5CdcX4t40Df qaDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=g31Q1biXQsUkqLM6OlMOKrciBnbcEHw187r7e5y/1nE=; b=6wvO9QTRlw9OMUUZcrt9Gv2IOKj36+gMq3JjoPYqbw9U1AXZO003ig0GK4yMOpigXS 4SA6kJxwdGB1/4xOiLdzyiVjbZRb9EDYL12n/LYoOW3OpXAgxlXJBI+rBjL+DX4BsNvD QNy/9n7jBh6Pbuf1IPQuabkZwBWHWBIOALI895JUMD5Wf2O8PAtN3kZZQRXlYtWBGRh0 11DxxQzl+ritpGkInK9CDvYgmAwXh+jkbRnQ4+YatNYkqicugS79WWLtfTlE2yrqO4vk 5/66699PcUXzgYjUP3FqfFdHTTb7dxu+z7BMXhypPumYICkOd7YmCqeLsuEb+QYx21wI P2cQ== X-Gm-Message-State: AOAM531nh7raPZhrwyMBrexX5Rmy9bmXIV19Pfpgbzja4ZC+21DptnRn hJ3d2aoC9dUl02y9PJufyJmpCQ== X-Received: by 2002:a17:902:8f94:b0:14f:d9b3:52c2 with SMTP id z20-20020a1709028f9400b0014fd9b352c2mr31616997plo.103.1646242539911; Wed, 02 Mar 2022 09:35:39 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id n22-20020a056a0007d600b004f3ba7c23e2sm21740956pfu.37.2022.03.02.09.35.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 09:35:39 -0800 (PST) Date: Wed, 2 Mar 2022 17:35:35 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , David Hildenbrand , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , Ben Gardon , Mingwei Zhang Subject: Re: [PATCH v3 22/28] KVM: x86/mmu: Zap defunct roots via asynchronous worker Message-ID: References: <20220226001546.360188-1-seanjc@google.com> <20220226001546.360188-23-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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 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?