Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp961804ybx; Wed, 30 Oct 2019 07:52:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/LOIpX6csZrf7x/DxKyXaQfW+Kk1/snADVNVkD/ChkVvOq+Q7/Lo0zFmVq0SDT0ewIIqb X-Received: by 2002:aa7:db46:: with SMTP id n6mr66227edt.46.1572447139889; Wed, 30 Oct 2019 07:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572447139; cv=none; d=google.com; s=arc-20160816; b=v9LdntfYEy+AYkQ1YUbkHGVA8ZiOu1LPh634LZPj6jeLMo1Ic+IQD9g+upcqxJkxSL sI4ebLFrIlsU+WI5gWvmqibpzkvGLRg8GvDq3CdVbyFDd7jr19UAiMz3PHDzDeJBaF38 uhxlmGrTopz0qxKjIXcjXA8pGxiKtD5oxV9DYgJJCC3+TczPphh4oUSDtXum93spz86G SJn6uimUgmCwWnE5rQnCzcqPCKssKmATkAzf3RlLFgcp29Fw3ASBqo8U+9ROI6iJ0QNT fLBWtTbiHD1fIif2db3DWZimRhlYTr1c2ekIhs2WR9nqYiocXwrzAULup8LC3P1j8jY1 7a0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ThOexR+LdeFoMaGkt/b+MbqwI16k3L5l4fpRFZMdGps=; b=sr47jWXEDkA/nI1/9h0KRLG7CRszy/palgaRnd2VBY0R9zoiSw0cMrDYD29mxVyvxb V95xRX+oQyBkiSpze5l4WMb0ZJPDcPVgXLUXNX5Spy3mx7J5jRjAbgZSlrfLnbMubdra vOc4Ojz0ho4aIf2lJ+67zprM38QuSA9bec+w3EDR8mwwJ9Q5FNrzRkn2sQUSV8Fc6PiF Z5f0DSFxTIkmDFsK7N7Porr0TcsCu77VYR9EePp4gAr2uAVyXWbkpLQI8GsyqEZi/Hzm qCJDvpoZvpoEb+Ydvc1fy+bMi14MF9BezLVmfIaq59jPTXdvnladI/R6fFrAMyhU0vd2 gyQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SiVarWNl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cw1si1376698ejb.117.2019.10.30.07.51.54; Wed, 30 Oct 2019 07:52:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SiVarWNl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726415AbfJ3OvT (ORCPT + 99 others); Wed, 30 Oct 2019 10:51:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:57558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726259AbfJ3OvT (ORCPT ); Wed, 30 Oct 2019 10:51:19 -0400 Received: from localhost.localdomain (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 64ED320856; Wed, 30 Oct 2019 14:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572447078; bh=fGY4lwQed6kXKr5Reh7oVYWsIVXScMRNH9ALNwy+qSg=; h=From:To:Cc:Subject:Date:From; b=SiVarWNl5Lv4nOXK6mU4X2uIu2qZbZcZKslAwfQCTX3dVRpk4EtEegjAXd2Z3/Jlt hVNdpEIViMEGTdmZMVV5eIbAZvOiXQ6A+g1iG0vrZ3ndOFzo/6BUTyYQLiZKJRQXIP h6nlrJJHJUJTbObV1dQdPhXT0aYnBO1cRVTrhf/c= From: Will Deacon To: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Cc: Will Deacon , Robin Murphy , Joerg Roedel , Bjorn Helgaas , Lorenzo Pieralisi Subject: [PATCH 0/7] iommu: Permit modular builds of ARM SMMU[v3] drivers Date: Wed, 30 Oct 2019 14:51:05 +0000 Message-Id: <20191030145112.19738-1-will@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, As part of the work to enable a "Generic Kernel Image" across multiple Android devices, there is a need to seperate shared, core kernel code from modular driver code that may not be needed by all SoCs. This means building IOMMU drivers as modules. It turns out that most of the groundwork has already been done to enable the ARM SMMU drivers to be 'tristate' options in drivers/iommu/Kconfig; with a few symbols exported from the IOMMU/PCI core, everything builds nicely out of the box. The one exception is support for the legacy SMMU DT binding, which is not in widespread use and has never worked with modules, so we can simply remove that when building as a module rather than try to paper over it with even more hacks. Obviously you need to be careful about using IOMMU drivers as modules, since late loading of the driver for an IOMMU serving active DMA masters is going to end badly in many cases. On Android, we're using device links to ensure that the IOMMU probes first. Comments welcome, Will Cc: Robin Murphy Cc: Joerg Roedel Cc: Bjorn Helgaas Cc: Lorenzo Pieralisi --->8 Will Deacon (7): drivers/iommu: Export core IOMMU API symbols to permit modular drivers iommu/of: Request ACS from the PCI core when configuring IOMMU linkage PCI: Export pci_ats_disabled() as a GPL symbol to modules Revert "iommu/arm-smmu: Make arm-smmu-v3 explicitly non-modular" iommu/arm-smmu-v3: Allow building as a module Revert "iommu/arm-smmu: Make arm-smmu explicitly non-modular" iommu/arm-smmu: Allow building as a module drivers/iommu/Kconfig | 16 ++++++- drivers/iommu/arm-smmu-impl.c | 6 +++ drivers/iommu/arm-smmu-v3.c | 26 +++++++---- drivers/iommu/arm-smmu.c | 86 +++++++++++++++++++++-------------- drivers/iommu/iommu-sysfs.c | 5 ++ drivers/iommu/iommu.c | 8 ++++ drivers/iommu/of_iommu.c | 1 + drivers/pci/pci.c | 1 + 8 files changed, 102 insertions(+), 47 deletions(-) -- 2.24.0.rc0.303.g954a862665-goog