Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1217012rwb; Thu, 22 Sep 2022 11:43:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7G7ir+vGpX5MHJN05xsT+16XjrJf2IfgkM6rFexFGsNaR3F1j2/XrNB3aBpW1h8R9Di/7C X-Received: by 2002:aa7:d054:0:b0:450:f6b9:bc2e with SMTP id n20-20020aa7d054000000b00450f6b9bc2emr4639644edo.413.1663872201382; Thu, 22 Sep 2022 11:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663872201; cv=none; d=google.com; s=arc-20160816; b=Ht2SCze8JecoxqELgiX1Zur7Nb3eQhvJHFx44hj/XA06Di0NAIpHHQourDrCERi2ZY kcPkfU39cWjuABZuOZtDhguF2RcDMMZkRw5e942h5/dKZ/Frjgeib5NjzsW3NRGMuloZ DvHV4W3ewt4so6Y/BmsqTimfbIkODNftQSiy+8RcebakjThcY2vxGvjMt7dxTGVe152u J4xgB/IX1STufRCbD4idjq/RAS/XWyCex5Chlq111VfnYdhyE9LmsL8TpBHVifgWeYdt qN7cIvmvzryJQrHNgkaRjNB9PRbfon+rZwun6OybotazUqBQdzNI1ANhyH+97CPyOP+B 0v+Q== 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=zllu0v1DANW2+lQUm66sehQ5XHuooYiLFYe0ZVuECVE=; b=ruOmPJKaAVz5ACFVayYSJXWUQ692LtoKaxByOlt/9Onn987JT2zHPqdDD5BwMYTUnU 3ngFhaFh5j1sfyGzSwtSgLSYhwrcW3TXhlQt5ER16zmNXEiTgRVuH9N2nZQPpocpY10V fVMasX1fGgIeQQNDbEAzKQUGhjJ0J4EZGcH/gPXyjh4xV5ArfAZCCP/ssV3/iOmqJOSJ HOFOE1ZUCV2fwGyTm1aYvWlMfp8yVDmPD22QR2I/kwKFmGf4jy4q1bVB5C7Rt3btDCzR BhLCwninkdHeWyE4K2PXgnIbUeI9T+7jDe6oQj2EglKP9N5vU0uO8uIGZA99QlIsyzHj E0eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="AB/8BM+m"; 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 hv22-20020a17090760d600b0078239e3f846si3528609ejc.1.2022.09.22.11.42.55; Thu, 22 Sep 2022 11:43:21 -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="AB/8BM+m"; 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 S232527AbiIVSY1 (ORCPT + 99 others); Thu, 22 Sep 2022 14:24:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232640AbiIVSXl (ORCPT ); Thu, 22 Sep 2022 14:23:41 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23BD910B580; Thu, 22 Sep 2022 11:22:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663870948; x=1695406948; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xexmELbi5aH40qDujxrSWqQj4dEkU4fMT/enlz5uNnQ=; b=AB/8BM+mTCFs9ly15QjUz3y1vPXNnekDwSW4FQoRJE+c0CYWDkDBB46D 9h2Lmus+IKCRCz/OEI+Pis4VVo21Ti6MQ4f8DosxKB6SieDmaH6P+A2T6 a1+d+t6BKUf6qKsnkL/cAllfwqgQ7VYA6GwkSeszWDO0Bs4kXSCXMZSOs l4U9b9vGPSaO0p9ucGXnJprnUdcUh61qdV7+ymMSpVtcbcN/LPuX1ogiX fqs4dx90zGx9hxaPcGY5Gu3aAo4Fssjr6TKz/X9SC+Ums4bANGE9i+kGN WG1hE9qkLH/mSUNcny62XqVyTBdWilcbfLt/NWXoi3YeCQuHgt3j010cG g==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="326712932" X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="326712932" 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:27 -0700 X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="653086875" 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:27 -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 25/30] KVM: x86: Delete kvm_arch_hardware_enable/disable() Date: Thu, 22 Sep 2022 11:20:54 -0700 Message-Id: <23e34c8aba1372d6e7c054b737242f08a614078d.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 Now they're function call and there is no point to keep them. Open code them. Suggested-by: Sean Christopherson Signed-off-by: Isaku Yamahata --- arch/x86/kvm/x86.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 01687b553915..aa6594de1fc1 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -354,7 +354,7 @@ static void kvm_on_user_return(struct user_return_notifier *urn) /* * Disabling irqs at this point since the following code could be - * interrupted and executed through kvm_arch_hardware_disable() + * interrupted and executed through hardware_disable() */ local_irq_save(flags); if (msrs->registered) { @@ -11864,11 +11864,6 @@ void kvm_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector) } EXPORT_SYMBOL_GPL(kvm_vcpu_deliver_sipi_vector); -static int kvm_arch_hardware_enable(void) -{ - return static_call(kvm_x86_hardware_enable)(); -} - static int __hardware_enable(void); void kvm_arch_resume(int usage_count) @@ -11961,12 +11956,6 @@ void kvm_arch_resume(int usage_count) } } -static void kvm_arch_hardware_disable(void) -{ - static_call(kvm_x86_hardware_disable)(); - drop_user_return_notifiers(); -} - static cpumask_t cpus_hardware_enabled = CPU_MASK_NONE; static int __hardware_enable(void) @@ -11978,7 +11967,7 @@ static int __hardware_enable(void) if (cpumask_test_cpu(cpu, &cpus_hardware_enabled)) return 0; - r = kvm_arch_hardware_enable(); + r = static_call(kvm_x86_hardware_enable)(); if (r) pr_warn("kvm: enabling virtualization on CPU%d failed during %pSb\n", cpu, __builtin_return_address(0)); @@ -12004,7 +11993,8 @@ static void hardware_disable(void *junk) if (!cpumask_test_cpu(cpu, &cpus_hardware_enabled)) return; cpumask_clear_cpu(cpu, &cpus_hardware_enabled); - kvm_arch_hardware_disable(); + static_call(kvm_x86_hardware_disable)(); + drop_user_return_notifiers(); } /* -- 2.25.1