Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp4512250lfc; Mon, 6 Jun 2022 11:05:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzl21Z1nDrAOvWU/oWm8TNwq4+Zk+PXmHqAagen88+0AaIFcmuqPh5I9DpLMWRpThuK1F2d X-Received: by 2002:a05:6a02:117:b0:3fa:de2:357a with SMTP id bg23-20020a056a02011700b003fa0de2357amr22079577pgb.169.1654538714218; Mon, 06 Jun 2022 11:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654538714; cv=none; d=google.com; s=arc-20160816; b=dGwRDWt6cjnMYC+h1FT/d77ExJP9h3L7StYNamPCUlmYyu+LfmOwlLvaCfGE1/xH8d IzzqpYd76ulbrGNFJ8sH6FBnT4HWU08UxHufHiXYWdxxKyz+bo5eKnDrmYhF5tlhYK17 zcle40/Q2gDSLc1L3PC7Ulzb/A+2M2DuoYWqZWu93AbK0XmCsdObFe2ImGWTEcSd9Ovl 5p2xJtpT5F2XJpdIa9BQLQknB/HuIGcxo/BiBj3ah7kuL1bVIlN0Lr6HCmCmuGS0HIX7 vD4Xzo/umG9AbRTG8qG/CTVwGP232RsKZvc2Y2DSL91nUyQzwsWGsPbbhnXYvjrAtuso YbHw== 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 :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=sA5FRYdjW46yogT585AFPa7Uprs64JJvNY0R0SXT104=; b=jaG7uBMB/XkSvss2VazaOe+xVranh/vLzTvFUU5Hwdajtz/UWJP4a9PacTwZM25qHK oNwC3Wck1zZivKalrIVeGy5V9e3I1utk5Dqb3j8dxrmMM2KmcrmCFNSHPfiHHGa7pIKt gWAobueJfPdFQfqIWZDMP8qudCCoK7cv9Zp7Yy9Z7GmJ23fSxKnpqRviANbxCYMX/g71 40s0cyQku085O1K9G00gO6X+IeiNxaIToWkEvpZon6EZPWRQSRQgJuu7ZnO+rFccHKNA wsy4zZy+US61MNslI0uoZfHkLXmcg7XGX9mEdblhTl8996eAPU7gvI61d/+qR4VeM2dV Lriw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R1Z8PtTo; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f9-20020a17090274c900b00163e2b5e3fbsi18560807plt.145.2022.06.06.11.05.00; Mon, 06 Jun 2022 11:05:14 -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=@redhat.com header.s=mimecast20190719 header.b=R1Z8PtTo; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230246AbiFFRxj (ORCPT + 99 others); Mon, 6 Jun 2022 13:53:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbiFFRxg (ORCPT ); Mon, 6 Jun 2022 13:53:36 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E25811451F4 for ; Mon, 6 Jun 2022 10:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654538015; 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; bh=sA5FRYdjW46yogT585AFPa7Uprs64JJvNY0R0SXT104=; b=R1Z8PtTo5pPkPXpkBysdBoyq95bU3BPDyGsRlXijZ+XWoAxDgfeMz7HJoFwAQt3YK3bnNf 4DV920MoCG2wLLyz3cWs5ebe5uOOHLFCSfhjFeuvN6hjEDgULC4hRCFGotFdJ9Dw7V/v9O 0C0ZaWaCjWyAh1Jj8RfZPoAt8w5C4H4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-94-wX3yXpk8OOSRpbxGlbph8g-1; Mon, 06 Jun 2022 13:53:18 -0400 X-MC-Unique: wX3yXpk8OOSRpbxGlbph8g-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7799E3C60524; Mon, 6 Jun 2022 17:53:17 +0000 (UTC) Received: from [172.30.41.16] (unknown [10.22.35.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F4F7492C3B; Mon, 6 Jun 2022 17:53:16 +0000 (UTC) Subject: [PATCH 0/2] Improve vfio-pci primary GPU assignment behavior From: Alex Williamson To: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@linux.ie, daniel@ffwll.ch Cc: Laszlo Ersek , Gerd Hoffmann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Date: Mon, 06 Jun 2022 11:53:15 -0600 Message-ID: <165453797543.3592816.6381793341352595461.stgit@omen> User-Agent: StGit/1.5.dev2+g9ce680a52bd9 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Users attempting to enable vfio PCI device assignment with a GPU will often block the default PCI driver from the device to avoid conflicts with the device initialization or release path. This means that vfio-pci is sometimes the first PCI driver to bind to the device. In the case of assigning the primary graphics device, low-level console drivers may still generate resource conflicts. Users often employ kernel command line arguments to disable conflicting drivers or perform unbinding in userspace to avoid this, but the actual solution is often distribution/kernel config specific based on the included drivers. We can instead allow vfio-pci to copy the behavior of drm_aperture_remove_conflicting_pci_framebuffers() in order to remove these low-level drivers with conflicting resources. vfio-pci is not however a DRM driver, nor does vfio-pci depend on DRM config options, thus we split out and export the necessary DRM apterture support and mirror the framebuffer and VGA support. I'd be happy to pull this series in through the vfio branch if approved by the DRM maintainers. Thanks, Alex --- Alex Williamson (2): drm/aperture: Split conflicting platform driver removal vfio/pci: Remove console drivers drivers/gpu/drm/drm_aperture.c | 33 +++++++++++++++++++++++--------- drivers/vfio/pci/vfio_pci_core.c | 17 ++++++++++++++++ include/drm/drm_aperture.h | 2 ++ 3 files changed, 43 insertions(+), 9 deletions(-)