Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1282008rwn; Thu, 8 Sep 2022 16:59:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR5O/eXT4KM11R3nnGjk4/wAn+Tb8fZXg01bWhzDWNdzmJZwEZcOCMccVf0sdtZWnxGELrl/ X-Received: by 2002:a05:651c:54b:b0:268:a2ad:b8e3 with SMTP id q11-20020a05651c054b00b00268a2adb8e3mr3180454ljp.281.1662681580753; Thu, 08 Sep 2022 16:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662681580; cv=none; d=google.com; s=arc-20160816; b=fD8wC71AIdQVZgKR3VoifvkcsCysMg6tlVAe8dxu31JwiUG5NLTZaeV4JLiw5ZB+jW liZeq22bC/Tynn1dw/NOgk2m7/Jc0phAMLeRgJGWSRPkFJ/xyKxZekvQnH8IXeJvnmWs qpTdUO10cujuD28v87R+h5AFsShApbpy2VxUAWFw4E312XQhAW3cyNo6yjsboYNwmC2U 6sifB0c81UHfh/pn9ZVPOe35rl0OLmTeH/MthNBEnzlXkKOjMfO32/WS2eCSZYIK26mC l05V56k4xXpw9/QeeyL55Wjw1xFdjAh8sqp/g2VBD727yCTBCtVNPN2DXDtH3q5vNpyB xBJw== 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=NZgm4j3vVivtqplWUPxwduB558eV5fyRplQPpKnedsk=; b=VQwJtofqj+2q4i3XbRxSMXWgkQTrm2199JrP4iPYnfcKqKTyvMkin80vAj9XF+WngN IpX1vEzNJip++hYtD1z0daxiiL/No3lN1Ns20SMbF6uPl1yRJ4j2lkEDVzJhW7x8mDh/ rs4GBji8IFIOtNN9tt6v6iYqwAa0CCKXwPAEqjdfXgJaaKGioWAyVTjMSTeOpZzcXaD7 uEzNs7XyKWlHGobdV32YW77nM/abzaKovBnArN1Q5ojf7xgH5x9+8378GP98b6YfFiWd qcx9QhuYqR3g2+qWzW1I98q0s2HSOLOWp/W4css/+q9Cmg2KDVaZEizYMfAuHVExVfWz Iifw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=keujRBCi; 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 f19-20020a056512229300b0049483739c8csi133500lfu.296.2022.09.08.16.59.12; Thu, 08 Sep 2022 16:59:40 -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=keujRBCi; 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 S230236AbiIHX1S (ORCPT + 99 others); Thu, 8 Sep 2022 19:27:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229869AbiIHX0a (ORCPT ); Thu, 8 Sep 2022 19:26:30 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F23B108700; Thu, 8 Sep 2022 16:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662679573; x=1694215573; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SfxQxRIB04avwvu2iwgntHu0fjCQdA4+XwdzGmceViY=; b=keujRBCiVgyBYgCDYowImaC9YlsPnyLcqimz8uJ0RTJulNtAc/hpbNoo ghsrGgdYX4p9w81U9cmVOr/BMO3l3lZQwluW4EBnsqZ3pJP1BuM1lH2T0 nfaYzWfhu9vKIuLyEnuJ367kU20kKaWPuprJzryITivKfr2SVR68Ve8fu +6+pMrhTm+sOqInSEdamX+FFLkFNZj2SgZ9ke1aQNqqdxsNREw9Bt6Zgl 8zRK5Ad2FcoAywDjJzWx7DLtQWTwl94K/KcOClVWvX98gC0/MMZHmf4aG tF5m/zDSwSycCHHwIAgn1+oZ5ai0GRulApDHF/J9aGingEuO+9XHJHsXM A==; X-IronPort-AV: E=McAfee;i="6500,9779,10464"; a="298687014" X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="298687014" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 16:26:11 -0700 X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="610863237" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 16:26:10 -0700 From: isaku.yamahata@intel.com To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Marc Zyngier , Will Deacon , Yuan Yao Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Kai Huang , Chao Gao , Atish Patra , Shaokun Zhang , Qi Liu , John Garry , Daniel Lezcano , Huang Ying , Huacai Chen Subject: [PATCH v4 15/26] KVM: kvm_arch.c: Remove _nolock post fix Date: Thu, 8 Sep 2022 16:25:31 -0700 Message-Id: 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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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 From: Isaku Yamahata Now all related callbacks are called under kvm_lock, no point for _nolock post fix. Remove _nolock post fix for readability with shorter function names. Signed-off-by: Isaku Yamahata --- virt/kvm/kvm_arch.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/virt/kvm/kvm_arch.c b/virt/kvm/kvm_arch.c index 32befdbf7d6e..4fe16e8ef2e5 100644 --- a/virt/kvm/kvm_arch.c +++ b/virt/kvm/kvm_arch.c @@ -20,7 +20,7 @@ __weak int kvm_arch_post_init_vm(struct kvm *kvm) return 0; } -static void hardware_enable_nolock(void *caller_name) +static void hardware_enable(void *caller_name) { int cpu = raw_smp_processor_id(); int r; @@ -42,7 +42,7 @@ static void hardware_enable_nolock(void *caller_name) } } -static void hardware_disable_nolock(void *junk) +static void hardware_disable(void *junk) { int cpu = raw_smp_processor_id(); @@ -56,7 +56,7 @@ static void hardware_disable_nolock(void *junk) __weak void kvm_arch_pre_hardware_unsetup(void) { - on_each_cpu(hardware_disable_nolock, NULL, 1); + on_each_cpu(hardware_disable, NULL, 1); } /* @@ -71,7 +71,7 @@ __weak int kvm_arch_add_vm(struct kvm *kvm, int usage_count) return 0; atomic_set(&hardware_enable_failed, 0); - on_each_cpu(hardware_enable_nolock, (void *)__func__, 1); + on_each_cpu(hardware_enable, (void *)__func__, 1); if (atomic_read(&hardware_enable_failed)) { r = -EBUSY; @@ -81,7 +81,7 @@ __weak int kvm_arch_add_vm(struct kvm *kvm, int usage_count) r = kvm_arch_post_init_vm(kvm); err: if (r) - on_each_cpu(hardware_disable_nolock, NULL, 1); + on_each_cpu(hardware_disable, NULL, 1); return r; } @@ -90,7 +90,7 @@ __weak int kvm_arch_del_vm(int usage_count) if (usage_count) return 0; - on_each_cpu(hardware_disable_nolock, NULL, 1); + on_each_cpu(hardware_disable, NULL, 1); return 0; } @@ -116,7 +116,7 @@ __weak int kvm_arch_online_cpu(unsigned int cpu, int usage_count) * preemption until all arch callbacks are fixed. */ preempt_disable(); - hardware_enable_nolock((void *)__func__); + hardware_enable((void *)__func__); preempt_enable(); if (atomic_read(&hardware_enable_failed)) { atomic_set(&hardware_enable_failed, 0); @@ -135,7 +135,7 @@ __weak int kvm_arch_offline_cpu(unsigned int cpu, int usage_count) * preemption until all arch callbacks are fixed. */ preempt_disable(); - hardware_disable_nolock(NULL); + hardware_disable(NULL); preempt_enable(); } return 0; @@ -143,7 +143,7 @@ __weak int kvm_arch_offline_cpu(unsigned int cpu, int usage_count) __weak int kvm_arch_reboot(int val) { - on_each_cpu(hardware_disable_nolock, NULL, 1); + on_each_cpu(hardware_disable, NULL, 1); return NOTIFY_OK; } @@ -151,7 +151,7 @@ __weak int kvm_arch_suspend(int usage_count) { if (usage_count) { preempt_disable(); - hardware_disable_nolock(NULL); + hardware_disable(NULL); preempt_enable(); } return 0; @@ -168,7 +168,7 @@ __weak void kvm_arch_resume(int usage_count) if (usage_count) { preempt_disable(); - hardware_enable_nolock((void *)__func__); + hardware_enable((void *)__func__); preempt_enable(); } } -- 2.25.1