Unverified Commit 779c3d90 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4514 [OLK-6.6] kabi: IOMMU subsystem reservation

Merge Pull Request from: @x56Jason 
 
# Description

    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

    the following IOMMU symbols are in the list:

            iommu_dev_disable_feature
            iommu_dev_enable_feature
            iommu_get_domain_for_dev
            iommu_get_group_resv_regions
            iommu_iova_to_phys
            iommu_present

    So reserve fields in relevant data structures.

# Issue
#I9193N

# Test
- Build and boot
- Run IOMMU kernel self test (make -C tools/testing/selftests TARGETS=iommu run_tests)
    - All PASS
- Run x86 kernel self test (make -C tools/testing/selftests TARGETS=x86 run_tests)
    - All pass except LAM/Shadow-Stack cases which are not enabled and has the same result as baseline

# Known Issue
N/A

# Default Kernel Config Change
N/A 
 
Link:https://gitee.com/openeuler/kernel/pulls/4514

 

Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Reviewed-by: default avatarAichun Shi <aichun.shi@intel.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents 6e9c75a7 11e58b7a
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 {
+5 −0
Original line number Diff line number Diff line
@@ -102,6 +102,11 @@ struct bus_type {
	const struct dev_pm_ops *pm;

	bool need_parent_lock;

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

int __must_check bus_register(const struct bus_type *bus);
+5 −0
Original line number Diff line number Diff line
@@ -119,6 +119,11 @@ struct device_driver {
	void (*coredump) (struct device *dev);

	struct driver_private *p;

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


+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[];
+5 −0
Original line number Diff line number Diff line
@@ -308,6 +308,11 @@ struct dev_pm_ops {
	int (*runtime_suspend)(struct device *dev);
	int (*runtime_resume)(struct device *dev);
	int (*runtime_idle)(struct device *dev);

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

#define SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \