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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59C03C433EF for ; Tue, 4 Jan 2022 01:58:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232107AbiADB6Z (ORCPT ); Mon, 3 Jan 2022 20:58:25 -0500 Received: from mga18.intel.com ([134.134.136.126]:25773 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232091AbiADB6W (ORCPT ); Mon, 3 Jan 2022 20:58:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641261502; x=1672797502; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=u2axiupT5cFi8yGZ7MA25zz/IgKwQEY9ZFFr/KlSioY=; b=PJyyLdvElz0VA7O2FO8LwVq33RgZxdNjzC/rEVrRxSSfOWNIeuZ9unk6 NWVlvEBh03VJYhIdUCl+5BT0IWVFkJspGVKq9kJJEXkCzu9KfGARDFYTV ms1AAhx8he6UmFnKcKHnlVbM3c8eDdVpnoDjaRk2nm1JIJFa5hfqpc/3f 9bVibDykLAW5o3UmQ2TGVz+PglMHi//yhQ127OwOuudU/6VUrkyhBc5ST ufGIWysAfEPSlciIVJsISuOrwrheamDRpi9YCasL4cGvG7YssFZLONaGD GQ9sb6BHlULvBOHbRi6tR/gkh648XPjVGPINdjtYdxwxaSgawIP64kxZm A==; X-IronPort-AV: E=McAfee;i="6200,9189,10216"; a="228961544" X-IronPort-AV: E=Sophos;i="5.88,258,1635231600"; d="scan'208";a="228961544" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2022 17:58:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,258,1635231600"; d="scan'208";a="667573290" Received: from allen-box.sh.intel.com ([10.239.159.118]) by fmsmga001.fm.intel.com with ESMTP; 03 Jan 2022 17:58:15 -0800 From: Lu Baolu To: Greg Kroah-Hartman , Joerg Roedel , Alex Williamson , Bjorn Helgaas , Jason Gunthorpe , Christoph Hellwig , Kevin Tian , Ashok Raj Cc: Will Deacon , Robin Murphy , Dan Williams , rafael@kernel.org, Diana Craciun , Cornelia Huck , Eric Auger , Liu Yi L , Jacob jun Pan , Chaitanya Kulkarni , Stuart Yoder , Laurentiu Tudor , Thierry Reding , David Airlie , Daniel Vetter , Jonathan Hunter , Li Yang , Dmitry Osipenko , iommu@lists.linux-foundation.org, linux-pci@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v5 08/14] PCI: pci_stub: Suppress kernel DMA ownership auto-claiming Date: Tue, 4 Jan 2022 09:56:38 +0800 Message-Id: <20220104015644.2294354-9-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220104015644.2294354-1-baolu.lu@linux.intel.com> References: <20220104015644.2294354-1-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The pci_dma_configure() marks the iommu_group as containing only devices with kernel drivers that manage DMA. Avoid this default behavior for the pci_stub because it does not program any DMA itself. This allows the pci_stub still able to be used by the admin to block driver binding after applying the DMA ownership to vfio. Signed-off-by: Lu Baolu --- drivers/pci/pci-stub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/pci-stub.c b/drivers/pci/pci-stub.c index e408099fea52..1f4c0a58b819 100644 --- a/drivers/pci/pci-stub.c +++ b/drivers/pci/pci-stub.c @@ -36,6 +36,7 @@ static struct pci_driver stub_driver = { .name = "pci-stub", .id_table = NULL, /* only dynamic id's */ .probe = pci_stub_probe, + .no_kernel_api_dma = true, }; static int __init pci_stub_init(void) -- 2.25.1