Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7949137rdb; Thu, 4 Jan 2024 13:01:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXrNf+oF9KXGpMWkHSpnz7RqxOGq0yDob9+rFGOCSXxJHw8Tz2cPP1XurIJkCxnlKtKhE9 X-Received: by 2002:a17:907:2cec:b0:a28:1061:3f26 with SMTP id hz12-20020a1709072cec00b00a2810613f26mr993304ejc.25.1704402071415; Thu, 04 Jan 2024 13:01:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704402071; cv=none; d=google.com; s=arc-20160816; b=Danay8Cfc1t8AhCHhjjtUaUB/3i+Q4eAqZpFLrhBy9Ly0zJGM8E2dQxjtQvT/oPi5J cEnVA2pjik1auuuH9U4LhwhQKvGyr83+eJC/26gfppfUdywZ3nJoSg5CuKUbvMMrAwJA Rwze9c+OA65y8g5pcfAinb6XnJEig1I8YvdGpxyxMYxvathbxKIaoOLdYI8uwDE6CNEH wEPUus0GA409scswujPC8H/6pS+jXi3Hq134I3yf9sdT+zPIdvBcrSNBsel5PDVMTuVv Uz0J4UfSigX2WQZtxd3rZr3uBfnX7yvWkicT6dNhcnzETPYsFndGa7n8a9UnCJ6ZxhzO HXMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=v9dVx1CFWN6pbrkgANRFGwDcyMCsqocFrWeybbXojmg=; fh=AiqZMo5ILO8GxBYVhQQwa0nqmkNnaawgcVBB3G6wi34=; b=zS6Gd8ct0Gkg/6YBdap1EIb5QRfX1FYVdr8/PH0KhScjcf+Ih3Lzv5SYukPwmIDRKc Kh8ftHUL5+VXInKcrY4Hfn7W4y4fDkCYNgki5TNFxJzUjtuhGZXMbxS07bYVsCkDqxRq 7YNRd3Q9wF5WoM7QAQuB1+wUizRrpyuMV7aSpR9AVB/5AiX5Jt5BOQ5+dt7BVTlVIbg9 LJu1Mg7qCf1EGDK4YQdplFo72wBv0ZJJZlElP3oqQxj0QfIqTqpg5AkKE9vo3j4/Rlok INopVXAPzkT3m66Zvw344EePXtcNPMgKg37ADonmTiLhvSpMy5ucSJJ0bOTWIvQkF1/u jCYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CxW0ua9F; spf=pass (google.com: domain of linux-kernel+bounces-17215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17215-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id kt11-20020a170906aacb00b00a2825fc959esi48672ejb.770.2024.01.04.13.01.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 13:01:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CxW0ua9F; spf=pass (google.com: domain of linux-kernel+bounces-17215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17215-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3866B1F2169D for ; Thu, 4 Jan 2024 21:01:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 307E42D029; Thu, 4 Jan 2024 21:00:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CxW0ua9F" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEAA12C6AD for ; Thu, 4 Jan 2024 21:00:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704402004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v9dVx1CFWN6pbrkgANRFGwDcyMCsqocFrWeybbXojmg=; b=CxW0ua9FVMdOjXdEiOoshlUs3b0PM/VKvnjC+iCkJvIO+oK1Tycayx9nDDcXtPlb37tXj2 6vQvptiBa3UgciDTdy3X3O68Qrn4hQEtOpKvGSOBlLY4WX0T+nKLKjJ0DMKqvyHAvguBqf w7QeKwDA0eae9eBq4yJrqEqmpzI6sWI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-EQHRe4WKN7qeYrD0uLNRUw-1; Thu, 04 Jan 2024 16:00:00 -0500 X-MC-Unique: EQHRe4WKN7qeYrD0uLNRUw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3DB3A1C0515D; Thu, 4 Jan 2024 21:00:00 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21C641121312; Thu, 4 Jan 2024 21:00:00 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: ajones@ventanamicro.com Subject: [PATCH 1/4] KVM: introduce CONFIG_KVM_COMMON Date: Thu, 4 Jan 2024 15:59:56 -0500 Message-Id: <20240104205959.4128825-2-pbonzini@redhat.com> In-Reply-To: <20240104205959.4128825-1-pbonzini@redhat.com> References: <20240104205959.4128825-1-pbonzini@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 CONFIG_HAVE_KVM is currently used by some architectures to either enabled the KVM config proper, or to enable host-side code that is not part of the KVM module. However, the "select" statement in virt/kvm/Kconfig corresponds to a third meaning, namely to enable common Kconfigs required by all architectures that support KVM. These three meanings can be replaced respectively by an architecture-specific Kconfig, by IS_ENABLED(CONFIG_KVM), or by a new Kconfig symbol that is in turn selected by the architecture-specific "config KVM". Start by introducing such a new Kconfig symbol, CONFIG_KVM_COMMON. Unlike CONFIG_HAVE_KVM, it is selected by CONFIG_KVM, not by architecture code. Fixes: 8132d887a702 ("KVM: remove CONFIG_HAVE_KVM_EVENTFD", 2023-12-08) Cc: Andrew Jones Signed-off-by: Paolo Bonzini --- arch/arm64/kvm/Kconfig | 1 + arch/loongarch/kvm/Kconfig | 1 + arch/mips/kvm/Kconfig | 1 + arch/powerpc/kvm/Kconfig | 1 + arch/riscv/kvm/Kconfig | 1 + arch/s390/kvm/Kconfig | 1 + arch/x86/kvm/Kconfig | 1 + virt/kvm/Kconfig | 3 +++ 8 files changed, 10 insertions(+) diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig index b07c60c9737d..ad5ce0454f17 100644 --- a/arch/arm64/kvm/Kconfig +++ b/arch/arm64/kvm/Kconfig @@ -21,6 +21,7 @@ if VIRTUALIZATION menuconfig KVM bool "Kernel-based Virtual Machine (KVM) support" depends on HAVE_KVM + select KVM_COMMON select KVM_GENERIC_HARDWARE_ENABLING select KVM_GENERIC_MMU_NOTIFIER select PREEMPT_NOTIFIERS diff --git a/arch/loongarch/kvm/Kconfig b/arch/loongarch/kvm/Kconfig index daba4cd5e87d..3b284b7e63ad 100644 --- a/arch/loongarch/kvm/Kconfig +++ b/arch/loongarch/kvm/Kconfig @@ -23,6 +23,7 @@ config KVM depends on HAVE_KVM select HAVE_KVM_DIRTY_RING_ACQ_REL select HAVE_KVM_VCPU_ASYNC_IOCTL + select KVM_COMMON select KVM_GENERIC_DIRTYLOG_READ_PROTECT select KVM_GENERIC_HARDWARE_ENABLING select KVM_GENERIC_MMU_NOTIFIER diff --git a/arch/mips/kvm/Kconfig b/arch/mips/kvm/Kconfig index 428141b0b48f..2eb119e78b6e 100644 --- a/arch/mips/kvm/Kconfig +++ b/arch/mips/kvm/Kconfig @@ -21,6 +21,7 @@ config KVM depends on MIPS_FP_SUPPORT select EXPORT_UASM select PREEMPT_NOTIFIERS + select KVM_COMMON select KVM_GENERIC_DIRTYLOG_READ_PROTECT select HAVE_KVM_VCPU_ASYNC_IOCTL select KVM_MMIO diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig index b47196085a42..5da535e20b6a 100644 --- a/arch/powerpc/kvm/Kconfig +++ b/arch/powerpc/kvm/Kconfig @@ -20,6 +20,7 @@ if VIRTUALIZATION config KVM bool select PREEMPT_NOTIFIERS + select KVM_COMMON select HAVE_KVM_VCPU_ASYNC_IOCTL select KVM_VFIO select IRQ_BYPASS_MANAGER diff --git a/arch/riscv/kvm/Kconfig b/arch/riscv/kvm/Kconfig index 1fd76aee3b71..55f81377d260 100644 --- a/arch/riscv/kvm/Kconfig +++ b/arch/riscv/kvm/Kconfig @@ -24,6 +24,7 @@ config KVM select HAVE_KVM_IRQ_ROUTING select HAVE_KVM_MSI select HAVE_KVM_VCPU_ASYNC_IOCTL + select KVM_COMMON select KVM_GENERIC_DIRTYLOG_READ_PROTECT select KVM_GENERIC_HARDWARE_ENABLING select KVM_MMIO diff --git a/arch/s390/kvm/Kconfig b/arch/s390/kvm/Kconfig index bb6d90351119..f89bedbe63bd 100644 --- a/arch/s390/kvm/Kconfig +++ b/arch/s390/kvm/Kconfig @@ -25,6 +25,7 @@ config KVM select HAVE_KVM_VCPU_ASYNC_IOCTL select KVM_ASYNC_PF select KVM_ASYNC_PF_SYNC + select KVM_COMMON select HAVE_KVM_IRQCHIP select HAVE_KVM_IRQ_ROUTING select HAVE_KVM_INVALID_WAKEUPS diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index b07247b0b958..c8e62a371d24 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -24,6 +24,7 @@ config KVM depends on HIGH_RES_TIMERS depends on X86_LOCAL_APIC select PREEMPT_NOTIFIERS + select KVM_COMMON select KVM_GENERIC_MMU_NOTIFIER select HAVE_KVM_IRQCHIP select HAVE_KVM_PFNCACHE diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig index 6793211a0b64..cce5c03ecc92 100644 --- a/virt/kvm/Kconfig +++ b/virt/kvm/Kconfig @@ -3,6 +3,9 @@ config HAVE_KVM bool + +config KVM_COMMON + bool select EVENTFD config HAVE_KVM_PFNCACHE -- 2.39.1