Message ID | 20221130230934.1014142-46-seanjc@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1201060wrr; Wed, 30 Nov 2022 15:18:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf4hVUrgGj8dnVOh+iqeyIrVokxFsW9PvpIZtnTbhVUTiFj9ML2QilOYi+wqJIoz4MGvNfZj X-Received: by 2002:aa7:d486:0:b0:46b:ce11:8355 with SMTP id b6-20020aa7d486000000b0046bce118355mr2843367edr.194.1669850285414; Wed, 30 Nov 2022 15:18:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669850285; cv=none; d=google.com; s=arc-20160816; b=wmXq7pIaWq/d7856xpDjLAblgXAgucd1JGGIxHXCXwzeEQDaxHZy0SJWa8drtbokEt W9rUtCsG/3/5yT3ciOtL/KDSkoWl3TSrsH8FFzFT5EjnrEPNM51JEz+usRWWmPwuf4rk 7oNNIPXJyuSbQRU853FrkQkbM0K3zpkN6XWJT4nijK+nTQQuFPOIHC0WK4sE5gYUNuJL khuur5AnWyQ0oOkjW2nn+CFmAsRK8zvd8FNx0NfNFGPhnNb+QQygUQyoEchaIYdcJQtm GWjfRE7mBsflp4QHLVOyixsIgqjeWlt1nkf0VRe0VJHK5jyuWdcq1psVbh0iJXgyHCp7 wgKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=feUvU0TLPbMF/Oljy4/vBwowA1Kv3aShJc2OjvbIIRg=; b=CkVes0hP9w11y3igbJeerpfjoy/0ExXtWwhjSdsg/pSPencNtBOnb07EApsrnbX46i 04CJD0MOLgrFF1N+LAbrWORCNPRBuQ1m4GASgmBWDBd3xQm8MCH1q46z+2cNClqy5Dlf dY16eorXlfgiIQkQJ6uoj0LuFvaXFJmtjeYkPdk+FB29X6Wu5x+yPW0l2VOUP3mWiNzV XTUffFMVHxY0ziFGJACmatQjCbvnY7ahLCayWpcbJjeYR8Ursp6PchE99N3yv3v2ntIn XvxBRxD/ln1m9XjNGu0G0tSqyEVXGRlT2jGebCJ09gsieB3CHwesDO55m2DvMKsJcCev 9ZvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=XCz6nxyH; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020a05640242c500b00469572f4937si2728949edc.374.2022.11.30.15.17.41; Wed, 30 Nov 2022 15:18:05 -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=@google.com header.s=20210112 header.b=XCz6nxyH; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230203AbiK3XQz (ORCPT <rfc822;heyuhang3455@gmail.com> + 99 others); Wed, 30 Nov 2022 18:16:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbiK3XQL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 30 Nov 2022 18:16:11 -0500 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B7D8A322B for <linux-kernel@vger.kernel.org>; Wed, 30 Nov 2022 15:11:40 -0800 (PST) Received: by mail-pl1-x649.google.com with SMTP id m1-20020a170902db0100b00188eec2726cso19126226plx.18 for <linux-kernel@vger.kernel.org>; Wed, 30 Nov 2022 15:11:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=feUvU0TLPbMF/Oljy4/vBwowA1Kv3aShJc2OjvbIIRg=; b=XCz6nxyHGgxyXLRmcMfZAC0EtbhsJIztANoSGpUb1GyxR0U89bx0wlthHvMKMPI0ma xTY/WZ7Fnj2wVoHKg3Vrqyc1suf4XCMLsHgGlIH3pS8IMgIqbDNn8Omsv3AOuHpjB+t4 oJgjvYZQ+8fVUpIqLH/jYWFcOCZ826P4/OUhmmvNmOkV9CXcwA4ogZ7MlttInnuYA3IQ qZwoJRmoUlDf0X9EXI/DaNlV615GX7fyKck9fxTOKS6fYcbuWk1qBQZKq1fDAhiXHC8W oTikmOFUnyHawi/4Gg7a9PphvtU6rlpDzwiPDXnAHDvGYvOqtwCfNDpZ92x3xkT78SFn sWLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=feUvU0TLPbMF/Oljy4/vBwowA1Kv3aShJc2OjvbIIRg=; b=KTUQ/InLIqlqE3vwx6LmsX9lB14BaloMxW3zm1jGbT49tAUxlkuB2ye9cYDJ+/9Prh EgJBmpdxztV/SNSH/npiZay47HM7kxmFrEXZOhHgf3SFqoLUMGsuz9afRI3RDG590rQz TicKKlLHbU00LLrN/qUqL/9OrYlBd98x7ybx6vNxismVMjG58rk43aQKJJsA7u5mZjF5 rmGCiUkUSh5L1Tiz+uPXGMOapJpGrWjsdwmzohNhOwA+QSzrok53Cz5P5ewGQoC+1uSO eogFaLUnALuao/YL8fXxdv6nyTLHkdbTNqmeUwYXkCw0hOsaadaFxWoTJMT98OOPa4tW 6Lwg== X-Gm-Message-State: ANoB5pkMzwi9NwReF0CblyXbWe0+9IjMuIYWjadX2NamLIrY+jRIDmUo 81qgD9T5kjmlZLBCne2KyFwD6YV+KwE= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:903:268d:b0:189:a50d:2a23 with SMTP id jf13-20020a170903268d00b00189a50d2a23mr7180858plb.32.1669849855698; Wed, 30 Nov 2022 15:10:55 -0800 (PST) Reply-To: Sean Christopherson <seanjc@google.com> Date: Wed, 30 Nov 2022 23:09:29 +0000 In-Reply-To: <20221130230934.1014142-1-seanjc@google.com> Mime-Version: 1.0 References: <20221130230934.1014142-1-seanjc@google.com> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog Message-ID: <20221130230934.1014142-46-seanjc@google.com> Subject: [PATCH v2 45/50] KVM: Remove on_each_cpu(hardware_disable_nolock) in kvm_exit() From: Sean Christopherson <seanjc@google.com> To: Paolo Bonzini <pbonzini@redhat.com>, Marc Zyngier <maz@kernel.org>, Huacai Chen <chenhuacai@kernel.org>, Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>, Anup Patel <anup@brainfault.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Christian Borntraeger <borntraeger@linux.ibm.com>, Janosch Frank <frankja@linux.ibm.com>, Claudio Imbrenda <imbrenda@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Sean Christopherson <seanjc@google.com>, Vitaly Kuznetsov <vkuznets@redhat.com>, David Woodhouse <dwmw2@infradead.org>, Paul Durrant <paul@xen.org> Cc: James Morse <james.morse@arm.com>, Alexandru Elisei <alexandru.elisei@arm.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, Oliver Upton <oliver.upton@linux.dev>, Atish Patra <atishp@atishpatra.org>, David Hildenbrand <david@redhat.com>, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Yuan Yao <yuan.yao@intel.com>, Cornelia Huck <cohuck@redhat.com>, Isaku Yamahata <isaku.yamahata@intel.com>, " =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= " <philmd@linaro.org>, Fabiano Rosas <farosas@linux.ibm.com>, Michael Ellerman <mpe@ellerman.id.au>, Kai Huang <kai.huang@intel.com>, Chao Gao <chao.gao@intel.com>, Thomas Gleixner <tglx@linutronix.de> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750964932591582662?= X-GMAIL-MSGID: =?utf-8?q?1750964932591582662?= |
Series |
KVM: Rework kvm_init() and hardware enabling
|
|
Commit Message
Sean Christopherson
Nov. 30, 2022, 11:09 p.m. UTC
From: Isaku Yamahata <isaku.yamahata@intel.com> Drop the superfluous invocation of hardware_disable_nolock() during kvm_exit(), as it's nothing more than a glorified nop. KVM automatically disables hardware on all CPUs when the last VM is destroyed, and kvm_exit() cannot be called until the last VM goes away as the calling module is pinned by an elevated refcount of the fops associated with /dev/kvm. This holds true even on x86, where the caller of kvm_exit() is not kvm.ko, but is instead a dependent module, kvm_amd.ko or kvm_intel.ko, as kvm_chardev_ops.owner is set to the module that calls kvm_init(), not hardcoded to the base kvm.ko module. Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com> [sean: rework changelog] Signed-off-by: Sean Christopherson <seanjc@google.com> --- virt/kvm/kvm_main.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 6a8fb53b32f0..a27ded004644 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -5981,7 +5981,6 @@ void kvm_exit(void) unregister_syscore_ops(&kvm_syscore_ops); unregister_reboot_notifier(&kvm_reboot_notifier); cpuhp_remove_state_nocalls(CPUHP_AP_KVM_ONLINE); - on_each_cpu(hardware_disable_nolock, NULL, 1); kvm_irqfd_exit(); free_cpumask_var(cpus_hardware_enabled); }