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 X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C094FC433DB for ; Tue, 5 Jan 2021 07:37:04 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 38E822256F for ; Tue, 5 Jan 2021 07:37:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38E822256F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A6BE18671F; Tue, 5 Jan 2021 07:37:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v+BwYA5wkz9U; Tue, 5 Jan 2021 07:37:02 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id C8A0E86720; Tue, 5 Jan 2021 07:37:02 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A419BC0891; Tue, 5 Jan 2021 07:37:02 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id CE303C013A for ; Tue, 5 Jan 2021 07:37:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id AA4DC20112 for ; Tue, 5 Jan 2021 07:37:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mxu2aeyIzvTB for ; Tue, 5 Jan 2021 07:36:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from m43-15.mailgun.net (m43-15.mailgun.net [69.72.43.15]) by silver.osuosl.org (Postfix) with ESMTPS id B4B6720028 for ; Tue, 5 Jan 2021 07:36:58 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1609832219; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=N8vblr7WLA9MBowjRomnjKEqPtQ1SL9FvyoDvOUsoR4=; b=A+Pj2CQLVChPLS8NvYZJP5Pnr7UYn8SUFumxuNUm/xtKacmPBwSSuC9CYubE4kl8n/gYcFmz dUDANg9GzN9u4OQGewpNZJuXvAiRcd5sB45LdBRDFRsLNG+xvRjxxydU9cY1RjxdxI0k7XxY nxdaK7eH/bm37MwhxkgAK/EfHZs= X-Mailgun-Sending-Ip: 69.72.43.15 X-Mailgun-Sid: WyI3NDkwMCIsICJpb21tdUBsaXN0cy5saW51eC1mb3VuZGF0aW9uLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-west-2.postgun.com with SMTP id 5ff417173d8496911438326a (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 05 Jan 2021 07:36:55 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 09A88C433CA; Tue, 5 Jan 2021 07:36:55 +0000 (UTC) Received: from isaacm-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: isaacm) by smtp.codeaurora.org (Postfix) with ESMTPSA id 136C9C433CA; Tue, 5 Jan 2021 07:36:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 136C9C433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=isaacm@codeaurora.org From: "Isaac J. Manjarres" To: will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, steven.price@arm.com, alyssa.rosenzweig@collabora.com, robh@kernel.org, tomeu.vizoso@collabora.com Subject: [PATCH RESEND 0/7] iommu: Permit modular builds of io-pgtable drivers Date: Mon, 4 Jan 2021 23:36:38 -0800 Message-Id: <1609832205-10055-1-git-send-email-isaacm@codeaurora.org> X-Mailer: git-send-email 2.7.4 Cc: "Isaac J. Manjarres" , freedreno@lists.freedesktop.org, pdaly@codeaurora.org, pratikp@codeaurora.org, dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org, kernel-team@android.com, linux-arm-kernel@lists.infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" The goal of the Generic Kernel Image (GKI) effort is to have a common kernel image that works across multiple Android devices. This involves generating a kernel image that has core features integrated into it, while SoC specific functionality can be added to the kernel for the device as a module. Along with modularizing IOMMU drivers, this also means building the io-pgtable code as modules, which allows for SoC vendors to only include the io-pgtable implementations that they use. For example, GKI for arm64 must include support for both the IOMMU ARM LPAE/V7S formats at the moment. Having the code for both formats as modules allows SoC vendors to only provide the page table format that they use, along with their IOMMU driver. The patches are split into 4 parts: 1) Modularizing io-pgtable-arm[-v7s].c, while leaving the io-pgtable.c code as part of the core kernel, requires removing the references to the ARM LPAE and ARM V7S io-pgtable init functions, and using a dynamic method for formats to register their io-pgtable init functions. 2) Taking references to the io-pgtable format drivers to ensure that they cannot be unloaded while in use. 3) Adding pre MODULE_SOFTDEP() dependencies to drivers in the kernel that are tristate, and invoke [alloc/free]_io_pgtable_ops(). This makes it so that the io-pgtable format drivers are loaded before the driver that needs them. 4) Changing the Kconfig options for the ARM LPAE nad ARM V7S to tristate and allowing the io-pgtable code to be enabled without having to select either page table format. The reason for doing this is so that a kernel can be built, such that it only provides the interface for io-pgtable formats to be registered as modules, as would be the case for the GKI. Thanks, Isaac Isaac J. Manjarres (7): iommu/io-pgtable: Introduce dynamic io-pgtable format registration iommu/io-pgtable: Add refcounting for io-pgtable format modules iommu/arm-smmu: Add dependency on io-pgtable format modules iommu/arm-smmu-v3: Add dependency on io-pgtable-arm format module drm/msm: Add dependency on io-pgtable-arm format module drm/panfrost: Add dependency on io-pgtable-arm format module iommu/io-pgtable-arm: Allow building modular io-pgtable formats drivers/gpu/drm/msm/msm_drv.c | 1 + drivers/gpu/drm/panfrost/panfrost_drv.c | 1 + drivers/iommu/Kconfig | 11 +-- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 + drivers/iommu/arm/arm-smmu/arm-smmu.c | 1 + drivers/iommu/io-pgtable-arm-v7s.c | 36 +++++++++- drivers/iommu/io-pgtable-arm.c | 104 +++++++++++++++++++++------- drivers/iommu/io-pgtable.c | 54 ++++++++++----- include/linux/io-pgtable.h | 52 +++++++++----- 9 files changed, 196 insertions(+), 65 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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 X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDCD3C433DB for ; Tue, 5 Jan 2021 08:21:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC55622240 for ; Tue, 5 Jan 2021 08:21:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC55622240 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A9FB6E095; Tue, 5 Jan 2021 08:21:14 +0000 (UTC) Received: from m43-15.mailgun.net (m43-15.mailgun.net [69.72.43.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B5EF89F73 for ; Tue, 5 Jan 2021 07:37:00 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1609832222; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=N8vblr7WLA9MBowjRomnjKEqPtQ1SL9FvyoDvOUsoR4=; b=O1kH2uAEku4xg3AyeiUo1baSCarMi81HKzFjCbIzmNtnXxCTi13u41U6iR5rFkoEQlGQfKJ5 lf/1WzFN8OwWkbnJ++A5P/ixubQQCBOzSjXYq3y2GF36v5pmBOp7o2AC+UR4k16Cc2Ss3iCg q7WaKmKDdZK92GvAgKyy58MZ9+U= X-Mailgun-Sending-Ip: 69.72.43.15 X-Mailgun-Sid: WyJkOTU5ZSIsICJkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-east-1.postgun.com with SMTP id 5ff41717b4d9fe55c1226f37 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 05 Jan 2021 07:36:55 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 048BFC43464; Tue, 5 Jan 2021 07:36:54 +0000 (UTC) Received: from isaacm-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: isaacm) by smtp.codeaurora.org (Postfix) with ESMTPSA id 136C9C433CA; Tue, 5 Jan 2021 07:36:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 136C9C433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=isaacm@codeaurora.org From: "Isaac J. Manjarres" To: will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, steven.price@arm.com, alyssa.rosenzweig@collabora.com, robh@kernel.org, tomeu.vizoso@collabora.com Subject: [PATCH RESEND 0/7] iommu: Permit modular builds of io-pgtable drivers Date: Mon, 4 Jan 2021 23:36:38 -0800 Message-Id: <1609832205-10055-1-git-send-email-isaacm@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-Mailman-Approved-At: Tue, 05 Jan 2021 08:21:09 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Isaac J. Manjarres" , freedreno@lists.freedesktop.org, pdaly@codeaurora.org, pratikp@codeaurora.org, dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org, kernel-team@android.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The goal of the Generic Kernel Image (GKI) effort is to have a common kernel image that works across multiple Android devices. This involves generating a kernel image that has core features integrated into it, while SoC specific functionality can be added to the kernel for the device as a module. Along with modularizing IOMMU drivers, this also means building the io-pgtable code as modules, which allows for SoC vendors to only include the io-pgtable implementations that they use. For example, GKI for arm64 must include support for both the IOMMU ARM LPAE/V7S formats at the moment. Having the code for both formats as modules allows SoC vendors to only provide the page table format that they use, along with their IOMMU driver. The patches are split into 4 parts: 1) Modularizing io-pgtable-arm[-v7s].c, while leaving the io-pgtable.c code as part of the core kernel, requires removing the references to the ARM LPAE and ARM V7S io-pgtable init functions, and using a dynamic method for formats to register their io-pgtable init functions. 2) Taking references to the io-pgtable format drivers to ensure that they cannot be unloaded while in use. 3) Adding pre MODULE_SOFTDEP() dependencies to drivers in the kernel that are tristate, and invoke [alloc/free]_io_pgtable_ops(). This makes it so that the io-pgtable format drivers are loaded before the driver that needs them. 4) Changing the Kconfig options for the ARM LPAE nad ARM V7S to tristate and allowing the io-pgtable code to be enabled without having to select either page table format. The reason for doing this is so that a kernel can be built, such that it only provides the interface for io-pgtable formats to be registered as modules, as would be the case for the GKI. Thanks, Isaac Isaac J. Manjarres (7): iommu/io-pgtable: Introduce dynamic io-pgtable format registration iommu/io-pgtable: Add refcounting for io-pgtable format modules iommu/arm-smmu: Add dependency on io-pgtable format modules iommu/arm-smmu-v3: Add dependency on io-pgtable-arm format module drm/msm: Add dependency on io-pgtable-arm format module drm/panfrost: Add dependency on io-pgtable-arm format module iommu/io-pgtable-arm: Allow building modular io-pgtable formats drivers/gpu/drm/msm/msm_drv.c | 1 + drivers/gpu/drm/panfrost/panfrost_drv.c | 1 + drivers/iommu/Kconfig | 11 +-- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 + drivers/iommu/arm/arm-smmu/arm-smmu.c | 1 + drivers/iommu/io-pgtable-arm-v7s.c | 36 +++++++++- drivers/iommu/io-pgtable-arm.c | 104 +++++++++++++++++++++------- drivers/iommu/io-pgtable.c | 54 ++++++++++----- include/linux/io-pgtable.h | 52 +++++++++----- 9 files changed, 196 insertions(+), 65 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel