From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5757BC46CA1 for ; Mon, 18 Sep 2023 15:30:43 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=HSE4bAtJ; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Rq7zP6fG7z3c8V for ; Tue, 19 Sep 2023 01:30:41 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=HSE4bAtJ; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ziepe.ca (client-ip=2607:f8b0:4864:20::72e; helo=mail-qk1-x72e.google.com; envelope-from=jgg@ziepe.ca; receiver=lists.ozlabs.org) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (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 lists.ozlabs.org (Postfix) with ESMTPS id 4Rq7yS0Stlz2yTx for ; Tue, 19 Sep 2023 01:29:50 +1000 (AEST) Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-773ac11de71so231971785a.2 for ; Mon, 18 Sep 2023 08:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1695050988; x=1695655788; darn=lists.ozlabs.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nmpxNm78kWfejPgZcglZLNttpcA+aOzIbjCglm6BlEY=; b=HSE4bAtJvUayXTCNy/Onix81pjGv/fAdn3FpXKQZPPdPAzGaL+hETeQcymONB0ip/7 9L7wwZKFle4OgW0SgCxxig3STFuh0w5YHTgtKdQfrbCP6jR3oX/sSFGgERkjkCO7qQ+i tVXDMG76pdc4MbSrNdgry9Rl9OXZQtmuMGZguI8jVACtVKT901bVsBy6fH7PWm0bcb1e 3EfubQ3zP5rEJbmV/wB5HPGYxmLIHfB+z1uJ/mY87KM1NAhpxIyoDdcY1TJoB4Gj3AFo 8TU/2Fn8XzEksQIbXwD5hH6JCi4rb3VH4MEROiVpM4Qb7FpY4ApREpemweYp/bL8BG8Q gjdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695050988; x=1695655788; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nmpxNm78kWfejPgZcglZLNttpcA+aOzIbjCglm6BlEY=; b=iR6iL66PaoLCXHMVEXER9bFkhphkP4Z3i682Wlc2QdkWsPOq3qS7GI7vdscXWJCe5v KD67v+fjQtjlZISeF2zPme1zYTE7UVgnys5Z0VeiGLJ+Q0eQ3H3GghHCp3MViWk2IT5T FEZils4/k9HwhnMsjm5IKnAQYPCuL90eSPVthtA1A6lowJws7/PTk6UYG0KXDDj0vlH7 ZhMCSR1HtCWPq9PwdetBBC/NLLFAgD3gi7mmCnK7QXxioS2wSMcaz4cBJN/RykbjhTxo W3iLgq4x9Mj4RGVcdhi4LwZQF/4IZKm1QS26g+h56sDiMcv6yd7S0DsErYn/RHDKlFpo FV6w== X-Gm-Message-State: AOJu0Yz9JeWsTfF0imyxH9JgtRM5Yggcx4meQ2SrXC8hHnGJ9ac7dhbN 1ErJxCiW3hKTf/A1l7QdNrxvwA== X-Google-Smtp-Source: AGHT+IE5R1x821mq0T9l2iChMZP/v62/zLl2heVXzUEZigk+bm+oq/r6FG+m4/T/InbSxJxTjGr9mw== X-Received: by 2002:a05:620a:2887:b0:76d:aa93:2e3c with SMTP id j7-20020a05620a288700b0076daa932e3cmr11157815qkp.24.1695050987781; Mon, 18 Sep 2023 08:29:47 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-26-201.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.26.201]) by smtp.gmail.com with ESMTPSA id s4-20020a05620a16a400b0076d0312b8basm3183843qkj.131.2023.09.18.08.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 08:29:47 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1qiGC2-0005S2-Ku; Mon, 18 Sep 2023 12:29:46 -0300 Date: Mon, 18 Sep 2023 12:29:46 -0300 From: Jason Gunthorpe To: Sean Christopherson Subject: Re: [PATCH 06/26] KVM: Drop CONFIG_KVM_VFIO and just look at KVM+VFIO Message-ID: <20230918152946.GJ13795@ziepe.ca> References: <20230916003118.2540661-1-seanjc@google.com> <20230916003118.2540661-7-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230916003118.2540661-7-seanjc@google.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: x86@kernel.org, kvm@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Dave Hansen , linux-kernel@vger.kernel.org, Alexander Gordeev , Claudio Imbrenda , Will Deacon , linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, Janosch Frank , Harald Freudenberger , Marc Zyngier , Huacai Chen , Halil Pasic , Andrew Thornton , Ingo Molnar , Christian Borntraeger , Jason Herne , Albert Ou , Vasily Gorbik , Venkatesh Srinivas , Heiko Carstens , Arnaldo Carvalho de Melo , Alex Williamson , Borislav Petkov , And y Lutomirski , Paul Walmsley , kvmarm@lists.linux.dev, Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Tony Krowiak , Anish Ghulati , linux-mips@vger.kernel.org, Oliver Upton , linux-perf-users@vger.kernel.org, Palmer Dabbelt , kvm-riscv@lists.infradead.org, Anup Patel , Paolo Bonzini , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Sep 15, 2023 at 05:30:58PM -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. Hmm, I recall that all the S390 drivers need it as well. static int vfio_ap_mdev_open_device(struct vfio_device *vdev) { struct ap_matrix_mdev *matrix_mdev = container_of(vdev, struct ap_matrix_mdev, vdev); if (!vdev->kvm) return -EINVAL; return vfio_ap_mdev_set_kvm(matrix_mdev, vdev->kvm); I wonder if we should be making the VFIO drivers that need the kvm to ask for it? 'select CONFIG_NEED_VFIO_KVM' or something? Regardless, I fully agree with getting rid of the arch flag. Reviewed-by: Jason Gunthorpe > --- 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 I wonder if kvm-m magically works in kbuild so you don't need the ifdef? Jason