Commit 11e58b7a authored by Jason Zeng's avatar Jason Zeng
Browse files

kabi: IOMMU reservations

Intel inclusion
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I9193N
CVE: NA

--------------------------------

In the first version of kabi symbol list:
        https://gitee.com/src-openeuler/kernel/blob/master/Module.kabi_x86_64
        https://gitee.com/src-openeuler/kernel/blob/master/Module.kabi_aarch64



There are following IOMMU symbols:

        iommu_dev_disable_feature
        iommu_dev_enable_feature
        iommu_get_domain_for_dev
        iommu_get_group_resv_regions
        iommu_iova_to_phys
        iommu_present

Reserve fields in relevant data structures.

Signed-off-by: default avatarJason Zeng <jason.zeng@intel.com>
parent 046758dd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -60,6 +60,11 @@ struct iommu_group {
	struct list_head entry;
	unsigned int owner_cnt;
	void *owner;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};

struct group_device {
+81 −0
Original line number Diff line number Diff line
@@ -77,6 +77,10 @@ struct iommu_fault_page_request {
	u32	perm;
	u64	addr;
	u64	private_data[2];

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
};

/**
@@ -87,6 +91,10 @@ struct iommu_fault_page_request {
struct iommu_fault {
	u32 type;
	struct iommu_fault_page_request prm;
	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};

/**
@@ -114,12 +122,20 @@ struct iommu_page_response {
	u32	pasid;
	u32	grpid;
	u32	code;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

struct iopf_fault {
	struct iommu_fault fault;
	/* node for pending lists */
	struct list_head list;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};

struct iopf_group {
@@ -131,6 +147,11 @@ struct iopf_group {
	struct iommu_domain *domain;
	/* The device's fault data parameter. */
	struct iommu_fault_param *fault_param;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};

/**
@@ -143,6 +164,11 @@ struct iopf_queue {
	struct workqueue_struct *wq;
	struct list_head devices;
	struct mutex lock;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};

/* iommu fault flags */
@@ -156,6 +182,11 @@ struct iommu_domain_geometry {
	dma_addr_t aperture_start; /* First address that can be mapped    */
	dma_addr_t aperture_end;   /* Last address that can be mapped     */
	bool force_aperture;       /* DMA only allowed in mappable range? */

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};

/* Domain feature flags */
@@ -228,6 +259,15 @@ struct iommu_domain {
		};
	};
	struct mutex switch_log_lock;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
	KABI_RESERVE(5)
	KABI_RESERVE(6)
	KABI_RESERVE(7)
	KABI_RESERVE(8)
};

static inline bool iommu_is_dma_domain(struct iommu_domain *domain)
@@ -343,6 +383,8 @@ struct iommu_iotlb_gather {
	size_t			pgsize;
	struct list_head	freelist;
	bool			queued;

	KABI_RESERVE(1)
};

/**
@@ -353,6 +395,8 @@ struct iommu_iotlb_gather {
struct iommu_dirty_bitmap {
	struct iova_bitmap *bitmap;
	struct iommu_iotlb_gather *gather;
	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

/* Read but do not clear any dirty bits */
@@ -372,6 +416,8 @@ struct iommu_dirty_ops {
				    unsigned long iova, size_t size,
				    unsigned long flags,
				    struct iommu_dirty_bitmap *dirty);
	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

/**
@@ -588,6 +634,15 @@ struct iommu_ops {
	struct iommu_domain *identity_domain;
	struct iommu_domain *blocked_domain;
	struct iommu_domain *default_domain;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
	KABI_RESERVE(5)
	KABI_RESERVE(6)
	KABI_RESERVE(7)
	KABI_RESERVE(8)
};

/**
@@ -676,6 +731,15 @@ struct iommu_domain_ops {
			       unsigned long *bitmap, unsigned long base_iova,
			       unsigned long bitmap_pgshift);
	void (*free)(struct iommu_domain *domain);

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
	KABI_RESERVE(5)
	KABI_RESERVE(6)
	KABI_RESERVE(7)
	KABI_RESERVE(8)
};

/**
@@ -694,6 +758,11 @@ struct iommu_device {
	struct device *dev;
	struct iommu_group *singleton_group;
	u32 max_pasids;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};

/**
@@ -719,6 +788,11 @@ struct iommu_fault_param {

	struct list_head partial;
	struct list_head faults;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};

/**
@@ -748,6 +822,9 @@ struct dev_iommu {
	u32				pci_32bit_workaround:1;
	u32				require_direct:1;
	u32				shadow_on_flush:1;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

int iommu_device_register(struct iommu_device *iommu,
@@ -996,6 +1073,10 @@ extern struct iommu_group *generic_single_device_group(struct device *dev);
struct iommu_fwspec {
	const struct iommu_ops	*ops;
	struct fwnode_handle	*iommu_fwnode;

	KABI_RESERVE(1)
	KABI_RESERVE(2)

	u32			flags;
	unsigned int		num_ids;
	u32			ids[];