Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp292863pxm; Wed, 2 Mar 2022 15:38:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwa6QCMNirv7gZE1yRcDclYvIM6PJFehmnLt2NDufkAu0DeHIA69kStRRT3/EjfhNmXpvMx X-Received: by 2002:a17:902:b204:b0:14f:26a7:9f61 with SMTP id t4-20020a170902b20400b0014f26a79f61mr33201420plr.97.1646264294205; Wed, 02 Mar 2022 15:38:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646264294; cv=none; d=google.com; s=arc-20160816; b=k6c6Ul0MLI4CY4Ef/ngiF7+TuqDmpe0wmi2CW4bC0zUPfU85j7N74I9Y1riVJgYI5U h3uUzSlJ1hentky+Ye8rBiloXxB1kWWd3kEcwAHKMik2f1HUTijojsX+aGsXWLxHRWwV oLmaLbu2+75Gn/6TVpYmWAb0CMKnj2ph3FJ9HL3zMhl7BNQrKOCM2RPS941hfu9jMoBx 77cORvg2aCsRcub8nrrtiv8slqRCiMte+mlL8Tw5c6oq/8DNRtUTxFtN0rYP/MASba08 zmfWXGLYBH+tQZZcmiCf2xYnqulNLUQScogfkb0ibEiYXZW8tlZQ/Hy8XpBAqIUnvktX jdPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Sd+QCgx6ejQtfJh0ZQLIdPUh9xzXsejItXGMffzQAc0=; b=pzkilSitXLKVffB2MdAYV2syKite6X3Lk18/YvwfMzN84IqD3SawrSAHzUiQrko/XV nR3V9XqZjNuKYE4q9DzmUCWHwVzpQgFom+rLNmbp40rt2PZ7RjsUAw37OaoBKPhrSKmO yPvwdKqP69eaEc9TthA/BXa8ETMUvJytIvLT8ANH2wA6OFJbTP8xL1BpbsmgUsY5Pl8P ducLgEHdicko9eYQcnSJ7989gBZsL0eglHY6e9LBsQ751KmKeAULY7LUTNTk3qnYVUOK bftAFiOqFOwX+nhCms8WOXaKBo5zETfsHQEG9vXMLaqC+C9zDo4WW/nlaLsLeTBfOqb+ SWmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=iDSC1Ase; 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 bj3-20020a056a02018300b003743afcc17dsi514096pgb.245.2022.03.02.15.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 15:38:14 -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=iDSC1Ase; 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 69FF915FCA5; Wed, 2 Mar 2022 15:05:44 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244504AbiCBSej (ORCPT + 99 others); Wed, 2 Mar 2022 13:34:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236812AbiCBSei (ORCPT ); Wed, 2 Mar 2022 13:34:38 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14484C9A3C for ; Wed, 2 Mar 2022 10:33:54 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id 5so2353267lfz.9 for ; Wed, 02 Mar 2022 10:33:53 -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=Sd+QCgx6ejQtfJh0ZQLIdPUh9xzXsejItXGMffzQAc0=; b=iDSC1AseNmMqk2BqO7yCgINbNSucW1S3mrbiOcArZvBpaghKwT9l5hvk22nxxddJU5 CVMLR9RINtqyWLOKbKAVHFgUwgywuLK4/rWM5ztyt8xGmslZfjnR4dqRSIiG1Fn2Gl3q CS9mK5K2Te6lc2kqG9LCaKpItlJRuZxE8k+zB4CJAh0caTvns3dHKn0bXI/xhruG9XSP veeOTiJl4mtTtQLfQs7kZrRjchr69XTyffiHes/ddzmbXoiYOWK7UbVIei2CjZc4x5Sw grg4R67/MKJZq2tKoKpTdubCvAwswmSciBb7SoZvjE3nRMILTxfSWCtOMZIscWIGO6nw mQug== 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=Sd+QCgx6ejQtfJh0ZQLIdPUh9xzXsejItXGMffzQAc0=; b=w4hMCJUF4wxlX1G4cha3vl4e1rKnd2b7fI2Qym2di9n7UuENJPAruZWfOjrfChBu/p W0nrE+VnALgnqYdKZw7RWWuvfyDucY3pItpA/pURWGWFEs8QW+4vM6DJ8RZRoV/7Wsc0 HfApjHd1JxDh/fMVWIvhQevsMKrcuLueB6a5cGwobCHid8furw8BQRKy2BmDrPt84Xbh E2DM/PWWqax3fG81vbOoX2RmrCKWztzQgzNoorBSmTkPlyAidk4Bjqr2bMq7FO2EORIx FCcSf0clZkl0sXbqwlU+WPMq7spCrmkHZAUfYk+6TOXpz9s43uosHDcoPcng0kub4iou Jr0g== X-Gm-Message-State: AOAM532dkA8BguQBdUBmsONBRX/swduwMlEH8W9zyezchHcoqcarHoTt toFg3l4RAk3tkut5zjoXd6JkAbSGcLtLK8hQa7j9UA== X-Received: by 2002:ac2:5a5d:0:b0:444:26e0:3d6a with SMTP id r29-20020ac25a5d000000b0044426e03d6amr18336527lfn.537.1646246028875; Wed, 02 Mar 2022 10:33:48 -0800 (PST) MIME-Version: 1.0 References: <20220226001546.360188-1-seanjc@google.com> <20220226001546.360188-23-seanjc@google.com> In-Reply-To: From: David Matlack Date: Wed, 2 Mar 2022 10:33:22 -0800 Message-ID: Subject: Re: [PATCH v3 22/28] KVM: x86/mmu: Zap defunct roots via asynchronous worker To: Sean Christopherson Cc: Paolo Bonzini , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , David Hildenbrand , kvm list , LKML , Ben Gardon , Mingwei Zhang Content-Type: text/plain; charset="UTF-8" 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 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.