Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1261745rwb; Thu, 22 Sep 2022 12:23:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5NRGpJHjakBFLzyGNvpqd4y7PiEvpUOhZDM8X/wwCY6Q+84fZ+mFng89ZnUNmTaE9uRCKw X-Received: by 2002:a05:6402:440c:b0:43a:1124:e56a with SMTP id y12-20020a056402440c00b0043a1124e56amr5012727eda.134.1663874585555; Thu, 22 Sep 2022 12:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663874585; cv=none; d=google.com; s=arc-20160816; b=l9UwHZmZnMX27/MxAgc737TTzx0zvUGkPeGeGBo6a98H6gl20yHxxV5HnWjB8SpOvh sE+ZNkcOfMMfKsgLKgsdG5jXw6h7njJFotH+eGOyOEa3G7U5ElP9q6FLOnzsVSOuE4EI yNDxtTzQErRfE3z48HF8eeJKhTVLGeUCLEpuMwy9CpbiSu7pLojflCMeC+IkJJKt/lfw yBxGNVfaKapueqwVQpgaqyqzWlff5BNUF2ks6bhRM6A2JSXFKrq1H6ESWouuAmjuJgXK v71o4h/6xnF/akf2mGAtbhnIaQEzYR8FcqE97SM66i+8pLkkE4cLuj30KZvWSd4PgDLr CCXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7pIwwhJF3b/LEXKxlggcjrVEOmpTd2ObphRQ5sUj7n4=; b=mxTk7on9AMwS3CI9a21EkCAEkptXAl3qyYi0V6wuKglFyrbgAUPTnOLVigE3v/SuEG DekyrbDKRCSM9eS+ERR/B4dyiOut+y75Sl6KmbimAmm2dY26iMU9n6HCb0AKIM73G7R+ n1xUSp7V3SDpnNRVxLjZ0qEL5Mm72IegO+FkXwVLMtcUB8WA+CMo5HRgJ/q7QsxLMFUs pge/6xigN9uEM3lZm2QH2lH8zSSfpIsz6+SNrDuBe0BFqj9+nYMsyhw4hZpOrtfG9fZM JOsvewHvj58lK2qfRpuNCbG+ufGg14Clj9MThKME11EaMxkLlCak+dSGwdnAQhtLDOqH K+wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d2gYifdr; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd44-20020a17090796ac00b00782650a2738si1868684ejc.24.2022.09.22.12.22.40; Thu, 22 Sep 2022 12:23:05 -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=@intel.com header.s=Intel header.b=d2gYifdr; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232432AbiIVSWz (ORCPT + 99 others); Thu, 22 Sep 2022 14:22:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232439AbiIVSWg (ORCPT ); Thu, 22 Sep 2022 14:22:36 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57E6D5051C; Thu, 22 Sep 2022 11:21:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663870903; x=1695406903; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zLkocjxLuN7GyCmVtTNHRtyAuGH+UIMI58rO1Z93uSw=; b=d2gYifdrcDkB7Lzb/7WPNWC/uHXlfNy0MXn6q/tXa0qvQM4iImTnoDAk MwPmsqqHwCeqzgWbofsxvtp97Ub5Urrtw7t/Uf9BnKZSya8NQCH5Mxeu+ /7p7yUDbEJ1tuVEv7ErjeXEQmIYJZKE/5Pho7NU1EDsWrm7lM+dGcKlTj 7I6Co2Hydr3PzfdGxMdxDJaZCMABuxPe/m8MRRUMbGpnCJItdbftYZ66Q qL0jAUEGhfAavx2rso4nGNG/gYRCcJKUjQqRsyBsQqdQR4oHkLZq9RoAY n3sRwGgJHdjR+vx9j0/TU9JiWo62xmGlY0AXO6ovhjyjS2uX5dkVyM8Jp Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="326712889" X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="326712889" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 11:21:22 -0700 X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="653086754" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 11:21:21 -0700 From: isaku.yamahata@intel.com To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Thomas Gleixner , Marc Zyngier , Will Deacon Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Kai Huang , Chao Gao , Atish Patra , Shaokun Zhang , Daniel Lezcano , Huang Ying , Huacai Chen , Dave Hansen , Borislav Petkov Subject: [PATCH v5 16/30] KVM: Remove on_each_cpu(hardware_disable_nolock) in kvm_exit() Date: Thu, 22 Sep 2022 11:20:45 -0700 Message-Id: <54c7065fa08a65f1fcd7f47492f1a83e6f7a3746.1663869838.git.isaku.yamahata@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 From: Isaku Yamahata hardware_enable/disable_nolock() check if the hardware is already enabled/disabled and work as nop when they are called multiple times. When VM is created/destroyed, on_each_cpu(hardware_enable/disable_nolock) via kvm_arch_add/del_vm() and module_get/put() are called. It means when kvm module is removed, it's guaranteed that there is no vm and that hardware_disable_nolock() was called on each cpus. Although the module exit function, kvm_exit(), calls on_each_cpu(hardware_disable_nolock), it's essentially nop. Eliminate nop call in kvm_exit(). Signed-off-by: Isaku Yamahata --- 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 ad9b8b7d21fa..d7c3bc14691f 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -6034,7 +6034,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_arch_hardware_unsetup(); kvm_arch_exit(); kvm_irqfd_exit(); -- 2.25.1