Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1278613rwn; Thu, 8 Sep 2022 16:54:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR7/Jfn2/wC/ADPpfZYtINhBWudd6VEkG/ijHXp2fPecsJNOuz/rkgk2JizidqQqWpIy6Jmz X-Received: by 2002:a2e:9bd9:0:b0:267:5851:4676 with SMTP id w25-20020a2e9bd9000000b0026758514676mr3064746ljj.10.1662681285898; Thu, 08 Sep 2022 16:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662681285; cv=none; d=google.com; s=arc-20160816; b=Y7u/Le7I0sJrnT149k66fjK2nFKI9JLcIt5AXGSS111sM+aPcp8QBmTZD7f0FGLv2g RbXbwqHj1fLcvgnNCoqE8ZitjgJSXfw9+RnP4ezt8eRildGCYB6i7ebIjTZ2ln859fKe xIFA1muL3rM7EmB7m3sJw31EZjKDkrymc8JzD2yA7zsO1u0if6bqBD/OeFBRPzU7dbxg 2zgpW6Sy5HQyw1s8NKRgNdDkzip6Cx+Etc+ZinZrmHupihOwZ+pz2I4trt7/pbu0qYAv OOPO6D69LfKCP6Qd/V5TMtZcDhSWKqG2vaHPKrFh1jHjNTApySsuy9yqQFGNbRacFawX ro0w== 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=fyIOW6WVgZHPzAxVWIrWW+i4M4WZgW8JE2+v14IAUVQ=; b=oV9NI/e2u/OusnwYzmIU/HN9459Wy7g7QduhagrDsdOJ3B3jhSVFXxW/CTkmHESKXe XRQnV+0zkJSHti+I8Q8bqxCVoJ+blBryPhRWPd72LEr/tjicy01uHnYr7aOKn58NvViO FPKNIj7QZXIeSixyDp6rLG26ahWM7/LTVLqENjhJS7P0WD9fmYXEAeRGMSFeBcutOFd5 lE3+/vk4TShPszfw7ierxapoQO+RyVBexMyjkV1tCX7q56iAQUkryXSUSJ++AXbvGiKK lUgeJj/ZCo+qjVH7r4OYizJJz6Dy4nBiZQcim7j/zIILzj3hNeNoIn5tL8xN00GsCpT9 nXew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KEuQHnJF; 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 k26-20020a2ea27a000000b00265d1db2af4si86433ljm.601.2022.09.08.16.54.17; Thu, 08 Sep 2022 16:54: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=KEuQHnJF; 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 S230301AbiIHX1a (ORCPT + 99 others); Thu, 8 Sep 2022 19:27:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230199AbiIHX0h (ORCPT ); Thu, 8 Sep 2022 19:26:37 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14B9E10E851; Thu, 8 Sep 2022 16:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662679579; x=1694215579; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5pQ3z02clD0r79Hqc0yHbGrlWpRrN1AcMCo979U69FA=; b=KEuQHnJFa03XK7DzjYwCUHJTlpnuFnx+gmJgjEUkANnBtmxVVs7qCd98 s2TacyLvfRtt3zIl9ViNfr4w7YRU4Hqo2u22rz154NL6jz/wrtneQ1+xs bjFX69wUR5nv8fzoSXJasK5ha5KyZtq2rbZTnM0gkVnnTsA2ar0s88Tfa gtBRFCihuKW1IfW0XgTZ87WUBqDaF71bArcBspQ8NWPW6OgY8bYm7wwgZ o2PHKELLvwd1DcmAcI6aUVbWHP6OCP3V384uRef0lC0/f7K83Wbp9EhDE G3FO/h+1hLjrtEuI9Tdcqtyt78T3u/UHnoxBNUDNXaMLSX18HE5X+e0dL A==; X-IronPort-AV: E=McAfee;i="6500,9779,10464"; a="298687030" X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="298687030" 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:14 -0700 X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="610863266" 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:13 -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 20/26] KVM: Add config to not compile kvm_arch.c Date: Thu, 8 Sep 2022 16:25:36 -0700 Message-Id: <67780bc1160e6a6ff27a7d9c9374f19fc4b57a5d.1662679124.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=-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 So that kvm_arch_hardware_enable/disable() aren't required. Once the conversion of all KVM archs is done, this config and kvm_arch.c should be removed. Suggested-by: Sean Christopherson Signed-off-by: Isaku Yamahata --- arch/x86/kvm/Kconfig | 1 + include/linux/kvm_host.h | 3 +++ virt/kvm/Kconfig | 3 +++ virt/kvm/Makefile.kvm | 5 ++++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index e3cbd7706136..e2e16205425d 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -25,6 +25,7 @@ config KVM depends on X86_LOCAL_APIC select PREEMPT_NOTIFIERS select MMU_NOTIFIER + select HAVE_KVM_OVERRIDE_HARDWARE_ENABLE select HAVE_KVM_IRQCHIP select HAVE_KVM_PFNCACHE select HAVE_KVM_IRQFD diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index d0b5fdb084f4..f538fc3356a9 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1434,8 +1434,11 @@ void kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu, struct dentry *debugfs_ static inline void kvm_create_vcpu_debugfs(struct kvm_vcpu *vcpu) {} #endif +#ifndef CONFIG_HAVE_KVM_OVERRIDE_HARDWARE_ENABLE int kvm_arch_hardware_enable(void); void kvm_arch_hardware_disable(void); +#endif + int kvm_arch_hardware_setup(void *opaque); void kvm_arch_pre_hardware_unsetup(void); void kvm_arch_hardware_unsetup(void); diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig index a8c5c9f06b3c..917314a87696 100644 --- a/virt/kvm/Kconfig +++ b/virt/kvm/Kconfig @@ -72,3 +72,6 @@ config KVM_XFER_TO_GUEST_WORK config HAVE_KVM_PM_NOTIFIER bool + +config HAVE_KVM_OVERRIDE_HARDWARE_ENABLE + def_bool n diff --git a/virt/kvm/Makefile.kvm b/virt/kvm/Makefile.kvm index c4210acabd35..c0187ec4f83c 100644 --- a/virt/kvm/Makefile.kvm +++ b/virt/kvm/Makefile.kvm @@ -5,7 +5,10 @@ KVM ?= ../../../virt/kvm -kvm-y := $(KVM)/kvm_main.o $(KVM)/kvm_arch.o $(KVM)/eventfd.o $(KVM)/binary_stats.o +kvm-y := $(KVM)/kvm_main.o $(KVM)/eventfd.o $(KVM)/binary_stats.o +ifneq ($(CONFIG_HAVE_KVM_OVERRIDE_HARDWARE_ENABLE), y) +kvm-y += $(KVM)/kvm_arch.o +endif kvm-$(CONFIG_KVM_VFIO) += $(KVM)/vfio.o kvm-$(CONFIG_KVM_MMIO) += $(KVM)/coalesced_mmio.o kvm-$(CONFIG_KVM_ASYNC_PF) += $(KVM)/async_pf.o -- 2.25.1