Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp3440341rwn; Sat, 10 Sep 2022 11:44:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR750bcxgYXtZnrAg/jkCfHlkGjyOmkh7EUG/v38dNWEuORiKEkKVaX++pqUlh9MiH35cmFF X-Received: by 2002:a17:902:ba8f:b0:175:42c1:61ce with SMTP id k15-20020a170902ba8f00b0017542c161cemr20056159pls.130.1662835460496; Sat, 10 Sep 2022 11:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662835460; cv=none; d=google.com; s=arc-20160816; b=tgzu7lG+q6kg/wr0yn5goEFn2lKtKS8D3PhuSFerOJP1L1a2h6TGvK/8P42KVK0+49 uY5QznmVVTpT3vkrqYRR66bDg2EOM+c1o4R25dvmx9lYjc4oAvL1w+YgMx8PFVJsek7w gcR9fDlrxBmLiSqlsGrv8C9rc2kNUI61kkBU2A9ucODUoPBah4mjHxwRtm0Yt2DWwJlS OLN3Yabuc/ICxpnOcCsMANeoew9QF/DJNj5dhOaM0Sa6nuKgvIFddjtmQtw7mTOSPKQ6 sWMJt19KO67t+Kw7OhxaKv/5nnDYTyA6dqNG9BykdcdbM+sust6fbK591Givjy8zWYyg LrAw== 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=pAWZMQ4OebAxACXO2jGPq2qtXaPGJKbsWZHu2snLesU=; b=QJor8EXBR3fiOA3V1MCM81SnmnDVt5VS8fYWC6ZJvSv6zM+Bx/yAtEXzsdBHGa4Gor Xww1w9P4U5B6LJhUgWEBbXYm4mteysITwtcKyLx9MbF6EvzGRfB6fA7Q9YSdI+ZnbwYD dyJvcfegqNd9bC7L5LJkANVhX3rLMTshBhdXiqHUsws256foAbdhDePtVHg+0YWxbNOK 7aIzbFPJbXgTnhb21j6sUPOts02OYCODz13I1lX9qJpulT+AyIO+W7SG81vvsNI55PGG FVagdvfFL6DSeAz6df9QQG4z9PK4asFKFsXEPACoNrZf6cbNfjqLDGnjpE2oRTvk0+1r HCJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="FSy5hLs/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k69-20020a638448000000b004308011fd84si4038693pgd.426.2022.09.10.11.44.08; Sat, 10 Sep 2022 11:44:20 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b="FSy5hLs/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229624AbiIJSLs (ORCPT + 99 others); Sat, 10 Sep 2022 14:11:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbiIJSLq (ORCPT ); Sat, 10 Sep 2022 14:11:46 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 760A04B0D4; Sat, 10 Sep 2022 11:11:45 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id fs14so4318126pjb.5; Sat, 10 Sep 2022 11:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=pAWZMQ4OebAxACXO2jGPq2qtXaPGJKbsWZHu2snLesU=; b=FSy5hLs/8uHSnX2eCqR/NPTOot9ONoHZuJBzGA+4ya5og1h23dEPAvZJpqsd0HzFVw s05EJvefDSk4Y+lxe2qG5foA+80l4gEDw5FonWsYSzhF32TNLtCoiouych0K3VdALK+8 ikwTHJmcqmNY0vPhXNUhkhs+QdB7705DRzciphKZvzH18vqmcTdOxoui0o0EWb5ArYS/ YLV+C4eE/zH5Ux4vXJoBWfTR/s7MR3MFgUpAIPjAoftrlcHkvwOrnv3wfTUYaJcu3exQ Lb2x0QxZUiOOB70dwBHlkuHejpf26QQ7e0kCfdDxfIcfpuUDLN7kQjTS4ee9FjUZSPmM udWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=pAWZMQ4OebAxACXO2jGPq2qtXaPGJKbsWZHu2snLesU=; b=e/Kddm22lRSRENjC7l2OBqMlRzgyrB2Je34rBofjHMFFgwPyU93UISPgYy+AUvwCeH tqbK4V5ahFFFSMGRWreY9SBXwiggy88aC+aVbKCJysh+8zJaAF2nPnlAU3098EiWWSGr Rcf7Qam+Sn48IPSpgm+gmjNpEaP/0R6m4RBj94BWtMa5at3MJFQim66UvpZPiJm/bzog 67GSObKz5UHkLFLk2FNNjleVvDijVY7XOFjBfNcQRPwsVEJjEcLOyZqsoxSFeoVWFXTO MVvKjsoPJlAcVHlXViR59w0p98FZfSjdbW13Y6bb0YJqarxqcOLKPrayy+K3u8oPJx1x XHvA== X-Gm-Message-State: ACgBeo1LHxB9qDMq4WlbHFnFJZjW5iIwANOmCq9V7cjAf+7YNlHUQRuT Dbhy/BfrXru4MjreZHlwBkQ= X-Received: by 2002:a17:90b:4ac3:b0:1fd:ded0:ea80 with SMTP id mh3-20020a17090b4ac300b001fdded0ea80mr15410157pjb.142.1662833504838; Sat, 10 Sep 2022 11:11:44 -0700 (PDT) Received: from localhost ([192.55.55.56]) by smtp.gmail.com with ESMTPSA id u4-20020a170902e5c400b00172fad607b3sm2565372plf.207.2022.09.10.11.11.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Sep 2022 11:11:44 -0700 (PDT) Date: Sat, 10 Sep 2022 11:11:43 -0700 From: Isaku Yamahata To: Chao Gao Cc: isaku.yamahata@intel.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Marc Zyngier , Will Deacon , Yuan Yao , isaku.yamahata@gmail.com, Kai Huang , Atish Patra , Shaokun Zhang , Qi Liu , John Garry , Daniel Lezcano , Huang Ying , Huacai Chen Subject: Re: [PATCH v4 10/26] KVM: Drop kvm_count_lock and instead protect kvm_usage_count with kvm_lock Message-ID: <20220910181143.GC699006@ls.amr.corp.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Fri, Sep 09, 2022 at 11:05:34AM +0800, Chao Gao wrote: > >+ * cpu_hotplug_disable() and other CPUs are offlined. No need for > >+ * locking. > >+ */ > >+ lockdep_assert_not_held(&kvm_lock); > >+ > >+ if (kvm_usage_count) { > >+ preempt_disable(); > > hardware_disable_nolock(NULL); > >+ preempt_enable(); > > kvm_suspend() is called with interrupt disabled. So, no need to disable > preemption. > > /** > * syscore_suspend - Execute all the registered system core suspend callbacks. > * > * This function is executed with one CPU on-line and disabled interrupts. > */ > int syscore_suspend(void) Thanks, I'll fix it with a comment. -- Isaku Yamahata