Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3611802rdh; Thu, 28 Sep 2023 18:09:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhTLlTKoAi1PRb9CxdrS95KIS2Cev9SBPXiOBi8eJskKZc6qPUPYrkSlaANJ0rizBTChwd X-Received: by 2002:a17:902:c24d:b0:1c5:6691:4978 with SMTP id 13-20020a170902c24d00b001c566914978mr2936313plg.37.1695949740189; Thu, 28 Sep 2023 18:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695949740; cv=none; d=google.com; s=arc-20160816; b=CnTZHRu2Np55iD5X/KnWjZpzOJdeMxFgtW0Ll2U6E4u4WOx905MCo78Dd6dOIQBMVt vBcp9mx8ks+24kZzFWkefOLqLGhR2AJzetlQbgojD3ngNDE6JdsQgrpt8GwvLR/nQc9h BJkjz8cGVXYpZp8H3itdwoLLPC+DjHforiOd4j6ktQ8f/CBmgtTPa3PPqLHSdwFiNttS SmQUMqGNtwt1Cb2sx5mVf2lj3vyAzfBlNTCRVoyXe9H8aP0+uSu6bBV7mkMIxVx4DHM8 MI3IQphBbf2oIVo0Lgn8Yc4dF7m86/4VyKbZe4erbFsGSviLkiaiNetxRkb/PhETzyWL RuNw== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=29G1BYuCds6xnt+aRDjOqp1d8b71T59JlT2+VGIavIo=; fh=brbVgFrtCTEER0oOudG8SRWryx8saMIRm6YoJHqrKx4=; b=hhwYKyKlCHBGofv2HTUZHd1GyRnb2ZVDBoyZWYDE1den3gy8t75h9QFCoWv2KCgbKh HIF1kb8DZMUJJkO76bG+nBuSHK8zOHCLN2Ict8NxP3bmkSzSBrt6CZjFitV819u6MhS+ XBxhZ1QtDoyViLmkOEnI4KvFDv2qTc65lWubINeJQKv6atYOEDcBvOXwVzg7+H0vyA89 OOzQxFbdaTNYNGPC71HU9yZewRSNXai8oSls11hzzvw/te8DyMv+uXvNrv37VX3VtWBN EuuJEkVlXdHFkC6ppcgTyJuxVYtztrFeD7DWkjz67QdI5LaYV/2jHyyorzILKXlO6KGs dEyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VtHY83YR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id u15-20020a170902e80f00b001bd949bcd75si21932585plg.575.2023.09.28.18.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 18:09:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VtHY83YR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EDF6F8104519; Thu, 28 Sep 2023 15:23:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232672AbjI1WXF (ORCPT + 99 others); Thu, 28 Sep 2023 18:23:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232579AbjI1WXC (ORCPT ); Thu, 28 Sep 2023 18:23:02 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8958B1A7 for ; Thu, 28 Sep 2023 15:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695939695; 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=29G1BYuCds6xnt+aRDjOqp1d8b71T59JlT2+VGIavIo=; b=VtHY83YRmhVYJfigUO/Yw+X1+yesbEsa0dwl24ZDIXq1DsTC1r+YwG55pkVg3DMidjRfmz D5Sp9w8xrnvNE5k3e4weDjb1IBMuLqDW8NUcD7xioX9yZZbqG6eHTbUuf1idEUG/OucnV9 xedNY8w3vacX6rbuLmvbSenXH2hfCkQ= Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-171-K98TteVbNe2gfRXtkj9Zig-1; Thu, 28 Sep 2023 18:21:34 -0400 X-MC-Unique: K98TteVbNe2gfRXtkj9Zig-1 Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-79f9edb0086so1530956439f.2 for ; Thu, 28 Sep 2023 15:21:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695939693; x=1696544493; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=29G1BYuCds6xnt+aRDjOqp1d8b71T59JlT2+VGIavIo=; b=m2VbRJ+c7m5zzOqRXLAMBPZb/DeN5JNx+Sdo0o8k7Ym+LKcPakaFEVoBAFOveB7KDC Spe6IdKuZ4ZUCzjdNEDczc8F5t2dSFXZe6uGyme0JPR6ZFZ9WxYzTtev/c0HvUiG+Fn0 +ET54caEcswLM6Mu4Q1x/VN79TnoPfJJPDbMdWjLSqgNRDergrlI5orekkwz7hFckl4r wv9ijvNoAsoyc/cwJ0WoXT/ZKOwk22ySxsh7X24qdcloJ0yBGFd17HiJBRBptpCZupQV vuZghF8Nodw8NXfxXnAe5vWuzPBGtRKtXtXnKREgHboLEo8OBvSZRz/VguX/fhxebbia M8dw== X-Gm-Message-State: AOJu0YwMuPD45wGT1iHhGc+1ugFCYEkgh7QSYGvgM8gNHcWOUROOxOmh EaVgcSFTVIZTxZk5gVshNWPe9HiGDpViRS0VZYlREtMRJsKNVxvXcOc/0rcONgSxig3/l1V/7/c q0nkJsO8URA4+W1t6o6yvBp7i X-Received: by 2002:a5e:a907:0:b0:790:ab53:ed16 with SMTP id c7-20020a5ea907000000b00790ab53ed16mr2491914iod.21.1695939693566; Thu, 28 Sep 2023 15:21:33 -0700 (PDT) X-Received: by 2002:a5e:a907:0:b0:790:ab53:ed16 with SMTP id c7-20020a5ea907000000b00790ab53ed16mr2491880iod.21.1695939693228; Thu, 28 Sep 2023 15:21:33 -0700 (PDT) Received: from redhat.com ([38.15.60.12]) by smtp.gmail.com with ESMTPSA id t23-20020a02c497000000b0042b10d42c90sm4610172jam.113.2023.09.28.15.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 15:21:31 -0700 (PDT) Date: Thu, 28 Sep 2023 16:21:11 -0600 From: Alex Williamson To: Sean Christopherson Cc: Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Peter Zijlstra , Arnaldo Carvalho de Melo , Paolo Bonzini , Tony Krowiak , Halil Pasic , Jason Herne , Harald Freudenberger , Andy Lutomirski , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, kvm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Anish Ghulati , Venkatesh Srinivas , Andrew Thornton Subject: Re: [PATCH 06/26] KVM: Drop CONFIG_KVM_VFIO and just look at KVM+VFIO Message-ID: <20230928162111.09820688.alex.williamson@redhat.com> In-Reply-To: <20230916003118.2540661-7-seanjc@google.com> References: <20230916003118.2540661-1-seanjc@google.com> <20230916003118.2540661-7-seanjc@google.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 28 Sep 2023 15:23:07 -0700 (PDT) On Fri, 15 Sep 2023 17:30:58 -0700 Sean Christopherson wrote: > Drop KVM's KVM_VFIO Kconfig, and instead compile in VFIO support if > and only if VFIO itself is enabled. Similar to the recent change to have > VFIO stop looking at HAVE_KVM, compiling in support for talking to VFIO > just because the architecture supports VFIO is nonsensical. > > This fixes a bug where RISC-V doesn't select KVM_VFIO, i.e. would silently > fail to do connect KVM and VFIO, even though RISC-V supports VFIO. The > bug is benign as the only driver in all of Linux that actually uses the > KVM reference provided by VFIO is KVM-GT, which is x86/Intel specific. > > Signed-off-by: Sean Christopherson > --- > arch/arm64/kvm/Kconfig | 1 - > arch/powerpc/kvm/Kconfig | 1 - > arch/s390/kvm/Kconfig | 1 - > arch/x86/kvm/Kconfig | 1 - > virt/kvm/Kconfig | 3 --- > virt/kvm/Makefile.kvm | 4 +++- > virt/kvm/vfio.h | 2 +- > 7 files changed, 4 insertions(+), 9 deletions(-) Reviewed-by: Alex Williamson > diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig > index 83c1e09be42e..2b5c332f157d 100644 > --- a/arch/arm64/kvm/Kconfig > +++ b/arch/arm64/kvm/Kconfig > @@ -28,7 +28,6 @@ menuconfig KVM > select KVM_MMIO > select KVM_GENERIC_DIRTYLOG_READ_PROTECT > select KVM_XFER_TO_GUEST_WORK > - select KVM_VFIO > select HAVE_KVM_EVENTFD > select HAVE_KVM_IRQFD > select HAVE_KVM_DIRTY_RING_ACQ_REL > diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig > index 902611954200..c4beb49c0eb2 100644 > --- a/arch/powerpc/kvm/Kconfig > +++ b/arch/powerpc/kvm/Kconfig > @@ -22,7 +22,6 @@ config KVM > select PREEMPT_NOTIFIERS > select HAVE_KVM_EVENTFD > select HAVE_KVM_VCPU_ASYNC_IOCTL > - select KVM_VFIO > select IRQ_BYPASS_MANAGER > select HAVE_KVM_IRQ_BYPASS > select INTERVAL_TREE > diff --git a/arch/s390/kvm/Kconfig b/arch/s390/kvm/Kconfig > index 45fdf2a9b2e3..459d536116a6 100644 > --- a/arch/s390/kvm/Kconfig > +++ b/arch/s390/kvm/Kconfig > @@ -31,7 +31,6 @@ config KVM > select HAVE_KVM_IRQ_ROUTING > select HAVE_KVM_INVALID_WAKEUPS > select HAVE_KVM_NO_POLL > - select KVM_VFIO > select INTERVAL_TREE > select MMU_NOTIFIER > help > diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig > index ed90f148140d..0f01e5600b5f 100644 > --- a/arch/x86/kvm/Kconfig > +++ b/arch/x86/kvm/Kconfig > @@ -45,7 +45,6 @@ config KVM > select HAVE_KVM_NO_POLL > select KVM_XFER_TO_GUEST_WORK > select KVM_GENERIC_DIRTYLOG_READ_PROTECT > - select KVM_VFIO > select INTERVAL_TREE > select HAVE_KVM_PM_NOTIFIER if PM > select KVM_GENERIC_HARDWARE_ENABLING > diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig > index 484d0873061c..f0be3b55cea6 100644 > --- a/virt/kvm/Kconfig > +++ b/virt/kvm/Kconfig > @@ -59,9 +59,6 @@ config HAVE_KVM_MSI > config HAVE_KVM_CPU_RELAX_INTERCEPT > bool > > -config KVM_VFIO > - bool > - > config HAVE_KVM_INVALID_WAKEUPS > bool > > diff --git a/virt/kvm/Makefile.kvm b/virt/kvm/Makefile.kvm > index 2c27d5d0c367..29373b59d89a 100644 > --- a/virt/kvm/Makefile.kvm > +++ b/virt/kvm/Makefile.kvm > @@ -6,7 +6,9 @@ > KVM ?= ../../../virt/kvm > > kvm-y := $(KVM)/kvm_main.o $(KVM)/eventfd.o $(KVM)/binary_stats.o > -kvm-$(CONFIG_KVM_VFIO) += $(KVM)/vfio.o > +ifdef CONFIG_VFIO > +kvm-y += $(KVM)/vfio.o > +endif > kvm-$(CONFIG_KVM_MMIO) += $(KVM)/coalesced_mmio.o > kvm-$(CONFIG_KVM_ASYNC_PF) += $(KVM)/async_pf.o > kvm-$(CONFIG_HAVE_KVM_IRQ_ROUTING) += $(KVM)/irqchip.o > diff --git a/virt/kvm/vfio.h b/virt/kvm/vfio.h > index e130a4a03530..af475a323965 100644 > --- a/virt/kvm/vfio.h > +++ b/virt/kvm/vfio.h > @@ -2,7 +2,7 @@ > #ifndef __KVM_VFIO_H > #define __KVM_VFIO_H > > -#ifdef CONFIG_KVM_VFIO > +#if IS_ENABLED(CONFIG_KVM) && IS_ENABLED(CONFIG_VFIO) > int kvm_vfio_ops_init(void); > void kvm_vfio_ops_exit(void); > #else