Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1217362rwb; Thu, 22 Sep 2022 11:43:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5PbjfKblC6188wJlLMNkrQKi8S8zPTjiNuEhVnpIbgKH5z0sMmsuGOSpgKuzm76L28EHT9 X-Received: by 2002:a05:6402:1cc1:b0:453:1517:94e4 with SMTP id ds1-20020a0564021cc100b00453151794e4mr4742390edb.399.1663872225286; Thu, 22 Sep 2022 11:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663872225; cv=none; d=google.com; s=arc-20160816; b=x50m+kfPKLtxbvf1anYWGG9C6MapfZUjxCWdmvbYyAiZYriJYQQvRClUonhWa17fpU 5BrYN4aJ6ehmuWFzUnU81brGiDDOcb6vqnEGedavuS+EdizgPIjDonCAzdWMN8b4QCPm 1HkH6m6t8+6x5nW3Fhah5ausfByPJ6/lxVXI3WdMNjEv0mA7hBTLpPmjCYaElC5DGVi0 T4MS6x0W0bD9bMH3U3aaAzea+myiHAyEt+C+yyhPr1Os+bd2LcXp+aMUSDK0jMsfp/oF UXI/b97WAOfg5ybv/md6GeM11ngEGJqSSYQ3CFw2d1+BYQlhjCfCSl9kyvZ6DRYl0ZD8 xlTA== 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=EUdCxqNc+4dnO2PeAkQ5e4+A6s7VfzMCDVN6giCmGIk=; b=ykHZiD8ddrp3GWPm9Of40+yjb279nU/3l64CkN+QstfWunJICfDRRgAwy2mRCdXfR9 RU98t6dUO7n1ypeH2wimSQZvsJmUTCXS6Qt1OqQ7Qk+8zMM1br/z/0FIz6fp+yE2ltOe d9KppfFsiyZu+jSqnp9y7L07YrOolnKWjY6BrxIEOmsO8Xr14qdu+I6g3KZXSodg9NBA 0nbJm/7GIpQHfiddkk0Ij9KSbTLZUkbtWXLqu/8HsCDwxwwZ9gJPWnKZzS3wt2r2+hyJ wkJ01lrgorEbIepvQ5XKIFVdMJfiGtCm4pQabtkiwGfuSLxeaaDRtGalGdpRMXB4oT/h fZAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LOkl5siZ; 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 gb24-20020a170907961800b0078266dc4b97si1549346ejc.735.2022.09.22.11.43.20; Thu, 22 Sep 2022 11:43:45 -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=LOkl5siZ; 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 S232564AbiIVSXS (ORCPT + 99 others); Thu, 22 Sep 2022 14:23:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232557AbiIVSWn (ORCPT ); Thu, 22 Sep 2022 14:22:43 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E54B10B5AB; Thu, 22 Sep 2022 11:21:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663870917; x=1695406917; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=L8+RR+UhC+idmPkn74NT4bHxkU564YnpQS2qQj/GxDE=; b=LOkl5siZfVR9UJpxPiSSPgnqEbyFtWEv3T+irwy9q/BfXbyNYMTNz+s8 2dg7KjbA0WbmYBcSu2ikU5+CmaZUtxM1znIjOLOh2Bwa+9ceFVZtKTu68 6pkaQUn/3WJ5JBywl2A6WFFsxYww4EK9Znb9iVUpS1xlz27CVy9dXQNN4 xG2l4YDxli1NNcTF/emxIGep8lnEaKkzopeyFlwI3ylRyYmIidpZIR+dd n1tyz38K7YPgB5bU8TzJE6Wt86+suZaRCYZVr+A2ZljlSP3xDRHOCA2cv Mp4ugpy0+Pwy64rjGQ7jUeEnAj7ZCjaZj4h7leq4zMOW34rEYYt4mGUsg Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="326712900" X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="326712900" 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:23 -0700 X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="653086775" 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:22 -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 18/30] KVM: kvm_arch.c: Remove _nolock post fix Date: Thu, 22 Sep 2022 11:20:47 -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=-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 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 Reviewed-by: Chao Gao --- virt/kvm/kvm_arch.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/virt/kvm/kvm_arch.c b/virt/kvm/kvm_arch.c index bcf8b74144e3..e6bf9de18cba 100644 --- a/virt/kvm/kvm_arch.c +++ b/virt/kvm/kvm_arch.c @@ -24,7 +24,7 @@ int __weak kvm_arch_post_init_vm(struct kvm *kvm) return 0; } -static void hardware_enable_nolock(void *junk) +static void hardware_enable(void *junk) { int cpu = raw_smp_processor_id(); int r; @@ -46,7 +46,7 @@ static void hardware_enable_nolock(void *junk) } } -static void hardware_disable_nolock(void *junk) +static void hardware_disable(void *junk) { int cpu = raw_smp_processor_id(); @@ -70,7 +70,7 @@ int __weak kvm_arch_add_vm(struct kvm *kvm, int usage_count) return 0; atomic_set(&hardware_enable_failed, 0); - on_each_cpu(hardware_enable_nolock, NULL, 1); + on_each_cpu(hardware_enable, NULL, 1); if (atomic_read(&hardware_enable_failed)) { r = -EBUSY; @@ -80,7 +80,7 @@ int __weak 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; } @@ -89,7 +89,7 @@ int __weak 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; } @@ -115,7 +115,7 @@ int __weak kvm_arch_online_cpu(unsigned int cpu, int usage_count) * preemption until all arch callbacks are fixed. */ preempt_disable(); - hardware_enable_nolock(NULL); + hardware_enable(NULL); preempt_enable(); if (atomic_read(&hardware_enable_failed)) { atomic_set(&hardware_enable_failed, 0); @@ -134,7 +134,7 @@ int __weak 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; @@ -142,7 +142,7 @@ int __weak kvm_arch_offline_cpu(unsigned int cpu, int usage_count) int __weak kvm_arch_reboot(int val) { - on_each_cpu(hardware_disable_nolock, NULL, 1); + on_each_cpu(hardware_disable, NULL, 1); return NOTIFY_OK; } @@ -153,12 +153,12 @@ int __weak kvm_arch_suspend(int usage_count) * Because kvm_suspend() is called with interrupt disabled, no * need to disable preemption. */ - hardware_disable_nolock(NULL); + hardware_disable(NULL); return 0; } void __weak kvm_arch_resume(int usage_count) { if (usage_count) - hardware_enable_nolock(NULL); + hardware_enable(NULL); } -- 2.25.1