linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
To: <linux-arm-kernel@lists.infradead.org>,
	<linux-acpi@vger.kernel.org>, <iommu@lists.linux-foundation.org>
Cc: <linuxarm@huawei.com>, <lorenzo.pieralisi@arm.com>,
	<joro@8bytes.org>, <robin.murphy@arm.com>, <will@kernel.org>,
	<wanghuiqiang@huawei.com>, <guohanjun@huawei.com>,
	<steven.price@arm.com>, <Sami.Mujawar@arm.com>,
	<jon@solid-run.com>, <eric.auger@redhat.com>,
	<laurentiu.tudor@nxp.com>, <hch@infradead.org>
Subject: [PATCH v10 1/9] iommu: Introduce a union to struct iommu_resv_region
Date: Wed, 20 Apr 2022 17:48:28 +0100	[thread overview]
Message-ID: <20220420164836.1181-2-shameerali.kolothum.thodi@huawei.com> (raw)
In-Reply-To: <20220420164836.1181-1-shameerali.kolothum.thodi@huawei.com>

A union is introduced to struct iommu_resv_region to hold
any firmware specific data. Also, provided a callback to
free up any firmware specific memory allocations. This is
in preparation to add support for IORT RMR reserve regions
and the union now holds the RMR specific information.

Tested-by: Steven Price <steven.price@arm.com>
Tested-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
---
 include/linux/iommu.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 9208eca4b0d1..38f1e043dfaa 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -127,6 +127,11 @@ enum iommu_resv_type {
 	IOMMU_RESV_SW_MSI,
 };
 
+struct iommu_iort_rmr_data {
+	const u32 *sids;	/* Stream IDs associated with IORT RMR entry */
+	u32 num_sids;
+};
+
 /**
  * struct iommu_resv_region - descriptor for a reserved memory region
  * @list: Linked list pointers
@@ -134,6 +139,9 @@ enum iommu_resv_type {
  * @length: Length of the region in bytes
  * @prot: IOMMU Protection flags (READ/WRITE/...)
  * @type: Type of the reserved region
+ * @fw_data: Firmware-specific data
+ * @resv_region_free_fw_data: Callback to free any firmware specific
+ *                            memory allocation
  */
 struct iommu_resv_region {
 	struct list_head	list;
@@ -141,6 +149,11 @@ struct iommu_resv_region {
 	size_t			length;
 	int			prot;
 	enum iommu_resv_type	type;
+	union {
+		struct iommu_iort_rmr_data rmr;
+	} fw_data;
+	void (*resv_region_free_fw_data)(struct device *dev,
+					 struct iommu_resv_region *region);
 };
 
 /**
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-04-20 16:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 16:48 [PATCH v10 0/9] ACPI/IORT: Support for IORT RMR node Shameer Kolothum
2022-04-20 16:48 ` Shameer Kolothum [this message]
2022-04-21  6:46   ` [PATCH v10 1/9] iommu: Introduce a union to struct iommu_resv_region Christoph Hellwig
2022-04-20 16:48 ` [PATCH v10 2/9] ACPI/IORT: Make iort_iommu_msi_get_resv_regions() return void Shameer Kolothum
2022-04-21  6:44   ` Christoph Hellwig
2022-04-20 16:48 ` [PATCH v10 3/9] ACPI/IORT: Provide a generic helper to retrieve reserve regions Shameer Kolothum
2022-04-21  6:44   ` Christoph Hellwig
2022-04-20 16:48 ` [PATCH v10 4/9] ACPI/IORT: Add support to retrieve IORT RMR reserved regions Shameer Kolothum
2022-04-21  6:48   ` Christoph Hellwig
2022-04-21 14:50     ` Shameerali Kolothum Thodi
2022-04-20 16:48 ` [PATCH v10 5/9] ACPI/IORT: Add a helper to retrieve RMR info directly Shameer Kolothum
2022-04-20 16:48 ` [PATCH v10 6/9] iommu/arm-smmu-v3: Introduce strtab init helper Shameer Kolothum
2022-04-20 16:48 ` [PATCH v10 7/9] iommu/arm-smmu-v3: Refactor arm_smmu_init_bypass_stes() to force bypass Shameer Kolothum
2022-04-20 16:48 ` [PATCH v10 8/9] iommu/arm-smmu-v3: Get associated RMR info and install bypass STE Shameer Kolothum
2022-04-20 16:48 ` [PATCH v10 9/9] iommu/arm-smmu: Get associated RMR info and install bypass SMR Shameer Kolothum
2022-04-21 12:58 ` [PATCH v10 0/9] ACPI/IORT: Support for IORT RMR node Steven Price
2022-04-21 14:43   ` Shameerali Kolothum Thodi
2022-04-21 15:45     ` Robin Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220420164836.1181-2-shameerali.kolothum.thodi@huawei.com \
    --to=shameerali.kolothum.thodi@huawei.com \
    --cc=Sami.Mujawar@arm.com \
    --cc=eric.auger@redhat.com \
    --cc=guohanjun@huawei.com \
    --cc=hch@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jon@solid-run.com \
    --cc=joro@8bytes.org \
    --cc=laurentiu.tudor@nxp.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linuxarm@huawei.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=robin.murphy@arm.com \
    --cc=steven.price@arm.com \
    --cc=wanghuiqiang@huawei.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).