Reserve kabi space for some structures in elevator/libata/libnvdimm/scsi.
v2->v3: Structure aligned by cache line based on openeuler_defconfig.
Li Lingfeng (4): elevator: reserve space for structures in elevator ata: libata: reserve space for structures in libata libnvdimm: reserve space for structures in libnvdimm scsi: reserve space for structures in scsi
block/elevator.h | 15 +++++++++++++++ include/linux/libata.h | 31 +++++++++++++++++++++++++++++++ include/linux/libnvdimm.h | 7 +++++++ include/linux/nd.h | 13 +++++++++++++ include/scsi/fc/fc_ms.h | 5 +++++ include/scsi/libfc.h | 4 ++++ include/scsi/libfcoe.h | 4 ++++ include/scsi/libiscsi.h | 30 ++++++++++++++++++++++++++++++ include/scsi/scsi_cmnd.h | 4 ++++ include/scsi/scsi_device.h | 16 ++++++++++++++++ include/scsi/scsi_dh.h | 4 ++++ include/scsi/scsi_driver.h | 4 ++++ include/scsi/scsi_eh.h | 4 ++++ include/scsi/scsi_host.h | 10 ++++++++++ 14 files changed, 151 insertions(+)
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8ZUL1
--------------------------------
Reserve space for struct elevator_mq_ops/elevator_type.
Signed-off-by: Li Lingfeng lilingfeng3@huawei.com --- block/elevator.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/block/elevator.h b/block/elevator.h index 7ca3d7b6ed82..8b8099c6a75f 100644 --- a/block/elevator.h +++ b/block/elevator.h @@ -4,6 +4,7 @@
#include <linux/percpu.h> #include <linux/hashtable.h> +#include <linux/kabi.h> #include "blk-mq.h"
struct io_cq; @@ -48,6 +49,15 @@ struct elevator_mq_ops { struct request *(*next_request)(struct request_queue *, struct request *); void (*init_icq)(struct io_cq *); void (*exit_icq)(struct io_cq *); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) };
#define ELV_NAME_MAX (16) @@ -84,6 +94,11 @@ struct elevator_type /* managed by elevator core */ char icq_cache_name[ELV_NAME_MAX + 6]; /* elvname + "_io_cq" */ struct list_head list; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
static inline bool elevator_tryget(struct elevator_type *e)
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8ZUL1
--------------------------------
Reserve space for structure ata_taskfile/ata_device/ata_port/ ata_port_operations/ata_port_info.
Signed-off-by: Li Lingfeng lilingfeng3@huawei.com --- include/linux/libata.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
diff --git a/include/linux/libata.h b/include/linux/libata.h index 2a7d2af0ed80..f244e908b324 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -23,6 +23,7 @@ #include <linux/cdrom.h> #include <linux/sched.h> #include <linux/async.h> +#include <linux/kabi.h>
/* * Define if arch has non-standard setup. This is a _PCI_ standard @@ -549,6 +550,11 @@ struct ata_taskfile { u32 auxiliary; /* auxiliary field */ /* from SATA 3.1 and */ /* ATA-8 ACS-3 */ + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
#ifdef CONFIG_ATA_SFF @@ -728,6 +734,14 @@ struct ata_device { int spdn_cnt; /* ering is CLEAR_END, read comment above CLEAR_END */ struct ata_ering ering; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) };
/* Fields between ATA_DEVICE_CLEAR_BEGIN and ATA_DEVICE_CLEAR_END are @@ -877,6 +891,15 @@ struct ata_port { /* owned by EH */ u8 *ncq_sense_buf; u8 sector_buf[ATA_SECT_SIZE] ____cacheline_aligned; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) };
/* The following initializer overrides a method to NULL whether one of @@ -986,6 +1009,11 @@ struct ata_port_operations { * fields must be pointers. */ const struct ata_port_operations *inherits; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
struct ata_port_info { @@ -996,6 +1024,9 @@ struct ata_port_info { unsigned int udma_mask; struct ata_port_operations *port_ops; void *private_data; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
struct ata_timing {
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8ZUL1
--------------------------------
Reserve space for structure nd_region_desc/nvdimm_security_ops/nvdimm_pmu/ nd_device_driver/nd_namespace_pmem.
Signed-off-by: Li Lingfeng lilingfeng3@huawei.com --- include/linux/libnvdimm.h | 7 +++++++ include/linux/nd.h | 13 +++++++++++++ 2 files changed, 20 insertions(+)
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h index e772aae71843..60fcf0d85835 100644 --- a/include/linux/libnvdimm.h +++ b/include/linux/libnvdimm.h @@ -12,6 +12,7 @@ #include <linux/uuid.h> #include <linux/spinlock.h> #include <linux/bio.h> +#include <linux/kabi.h>
struct badrange_entry { u64 start; @@ -136,6 +137,9 @@ struct nd_region_desc { int memregion; struct device_node *of_node; int (*flush)(struct nd_region *nd_region, struct bio *bio); + + KABI_RESERVE(1) + KABI_RESERVE(2) };
struct device; @@ -193,6 +197,9 @@ struct nvdimm_security_ops { int (*query_overwrite)(struct nvdimm *nvdimm); int (*disable_master)(struct nvdimm *nvdimm, const struct nvdimm_key_data *key_data); + + KABI_RESERVE(1) + KABI_RESERVE(2) };
enum nvdimm_fwa_state { diff --git a/include/linux/nd.h b/include/linux/nd.h index b9771ba1ef87..6bebc7561c71 100644 --- a/include/linux/nd.h +++ b/include/linux/nd.h @@ -9,6 +9,7 @@ #include <linux/device.h> #include <linux/badblocks.h> #include <linux/perf_event.h> +#include <linux/kabi.h>
enum nvdimm_event { NVDIMM_REVALIDATE_POISON, @@ -54,6 +55,12 @@ struct nvdimm_pmu { enum cpuhp_state cpuhp_state; /* cpumask provided by arch/platform specific code */ struct cpumask arch_cpumask; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) };
struct platform_device; @@ -82,6 +89,9 @@ struct nd_device_driver { void (*remove)(struct device *dev); void (*shutdown)(struct device *dev); void (*notify)(struct device *dev, enum nvdimm_event event); + + KABI_RESERVE(1) + KABI_RESERVE(2) };
static inline struct nd_device_driver *to_nd_device_driver( @@ -142,6 +152,9 @@ struct nd_namespace_pmem { char *alt_name; uuid_t *uuid; int id; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
static inline struct nd_namespace_io *to_nd_namespace_io(const struct device *dev)
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8ZUL1
--------------------------------
Reserve space for structure fc_fdmi_attr_entry/fs_fdmi_attrs/ libfc_cmd_priv/fcoe_percpu_s/iscsi_task/iscsi_cmd/iscsi_conn/ iscsi_session/iscsi_host/scsi_cmnd/scsi_device/scsi_exec_args/ scsi_device_handler/scsi_driver/scsi_eh_save/scsi_host_template/ Scsi_Host/scsi_target.
Signed-off-by: Li Lingfeng lilingfeng3@huawei.com --- include/scsi/fc/fc_ms.h | 5 +++++ include/scsi/libfc.h | 4 ++++ include/scsi/libfcoe.h | 4 ++++ include/scsi/libiscsi.h | 30 ++++++++++++++++++++++++++++++ include/scsi/scsi_cmnd.h | 4 ++++ include/scsi/scsi_device.h | 16 ++++++++++++++++ include/scsi/scsi_dh.h | 4 ++++ include/scsi/scsi_driver.h | 4 ++++ include/scsi/scsi_eh.h | 4 ++++ include/scsi/scsi_host.h | 10 ++++++++++ 10 files changed, 85 insertions(+)
diff --git a/include/scsi/fc/fc_ms.h b/include/scsi/fc/fc_ms.h index 56a5d2b5a624..52c0be07917a 100644 --- a/include/scsi/fc/fc_ms.h +++ b/include/scsi/fc/fc_ms.h @@ -9,6 +9,7 @@ #define _FC_MS_H_
#include <linux/types.h> +#include <linux/kabi.h>
/* * Fibre Channel Services - Management Service (MS) @@ -158,6 +159,8 @@ struct fc_fdmi_port_name { struct fc_fdmi_attr_entry { __be16 type; __be16 len; + + KABI_RESERVE(1) __u8 value[]; } __attribute__((__packed__));
@@ -166,6 +169,8 @@ struct fc_fdmi_attr_entry { */ struct fs_fdmi_attrs { __be32 numattrs; + + KABI_RESERVE(1) struct fc_fdmi_attr_entry attr[]; } __attribute__((__packed__));
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index eca6fd42d7f7..c042d761d701 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h @@ -12,6 +12,7 @@ #include <linux/if.h> #include <linux/percpu.h> #include <linux/refcount.h> +#include <linux/kabi.h>
#include <scsi/scsi_transport.h> #include <scsi/scsi_transport_fc.h> @@ -358,6 +359,9 @@ struct libfc_cmd_priv { struct fc_fcp_pkt *fsp; u32 resid_len; u8 status; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
/* diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index 8300ef1a982e..b2d11acaa68d 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h @@ -16,6 +16,7 @@ #include <linux/workqueue.h> #include <linux/local_lock.h> #include <linux/random.h> +#include <linux/kabi.h> #include <scsi/fc/fc_fcoe.h> #include <scsi/libfc.h> #include <scsi/fcoe_sysfs.h> @@ -329,6 +330,9 @@ struct fcoe_percpu_s { struct page *crc_eof_page; int crc_eof_offset; local_lock_t lock; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
/** diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 7282555adfd5..179924347b95 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h @@ -17,6 +17,7 @@ #include <linux/workqueue.h> #include <linux/kfifo.h> #include <linux/refcount.h> +#include <linux/kabi.h> #include <scsi/iscsi_proto.h> #include <scsi/iscsi_if.h> #include <scsi/scsi_cmnd.h> @@ -133,6 +134,12 @@ struct iscsi_task { refcount_t refcount; struct list_head running; /* running cmd list */ void *dd_data; /* driver/transport data */ + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) };
static inline int iscsi_task_has_unsol_data(struct iscsi_task *task) @@ -156,6 +163,9 @@ static inline bool iscsi_task_is_completed(struct iscsi_task *task) struct iscsi_cmd { struct iscsi_task *task; int age; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
static inline struct iscsi_cmd *iscsi_cmd(struct scsi_cmnd *cmd) @@ -256,6 +266,13 @@ struct iscsi_conn { /* custom statistics */ uint32_t eh_abort_cnt; uint32_t fmr_unalign_cnt; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) };
struct iscsi_pool { @@ -363,6 +380,11 @@ struct iscsi_session { struct iscsi_task **cmds; /* Original Cmds arr */ struct iscsi_pool cmdpool; /* PDU's pool */ void *dd_data; /* LLD private data */ + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
enum { @@ -383,6 +405,14 @@ struct iscsi_host { int state;
struct workqueue_struct *workq; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) };
/* diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 526def14e7fb..cc7a5fe2a314 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -9,6 +9,7 @@ #include <linux/types.h> #include <linux/timer.h> #include <linux/scatterlist.h> +#include <linux/kabi.h> #include <scsi/scsi_device.h>
struct Scsi_Host; @@ -141,6 +142,9 @@ struct scsi_cmnd { * to be at an address < 16Mb). */
int result; /* Status code from lower level driver */ + + KABI_RESERVE(1) + KABI_RESERVE(2) };
/* Variant of blk_mq_rq_from_pdu() that verifies the type of its argument. */ diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 8fa1153f37cb..b91f07fd2b25 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -9,6 +9,7 @@ #include <scsi/scsi.h> #include <linux/atomic.h> #include <linux/sbitmap.h> +#include <linux/kabi.h>
struct bsg_device; struct device; @@ -284,6 +285,15 @@ struct scsi_device { struct mutex state_mutex; enum scsi_device_state sdev_state; struct task_struct *quiesced_by; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) unsigned long sdev_data[]; } __attribute__((aligned(sizeof(unsigned long))));
@@ -370,6 +380,10 @@ struct scsi_target { char scsi_level; enum scsi_target_state state; void *hostdata; /* available to low-level driver */ + + KABI_RESERVE(1) + KABI_RESERVE(2) + unsigned long starget_data[]; /* for the transport */ /* starget_data must be the last element!!!! */ } __attribute__((aligned(sizeof(unsigned long)))); @@ -498,6 +512,8 @@ struct scsi_exec_args { blk_mq_req_flags_t req_flags; /* BLK_MQ_REQ flags */ int scmd_flags; /* SCMD flags */ int *resid; /* residual length */ + + KABI_RESERVE(1) };
int scsi_execute_cmd(struct scsi_device *sdev, const unsigned char *cmd, diff --git a/include/scsi/scsi_dh.h b/include/scsi/scsi_dh.h index 4df943c1b90b..1e6bc082efd8 100644 --- a/include/scsi/scsi_dh.h +++ b/include/scsi/scsi_dh.h @@ -11,6 +11,7 @@ */
#include <scsi/scsi_device.h> +#include <linux/kabi.h>
enum { SCSI_DH_OK = 0, @@ -60,6 +61,9 @@ struct scsi_device_handler { blk_status_t (*prep_fn)(struct scsi_device *, struct request *); int (*set_params)(struct scsi_device *, const char *); void (*rescan)(struct scsi_device *); + + KABI_RESERVE(1) + KABI_RESERVE(2) };
#ifdef CONFIG_SCSI_DH diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h index 4ce1988b2ba0..7cd5cc59cfe1 100644 --- a/include/scsi/scsi_driver.h +++ b/include/scsi/scsi_driver.h @@ -4,6 +4,7 @@
#include <linux/blk_types.h> #include <linux/device.h> +#include <linux/kabi.h> #include <scsi/scsi_cmnd.h>
struct module; @@ -18,6 +19,9 @@ struct scsi_driver { int (*done)(struct scsi_cmnd *); int (*eh_action)(struct scsi_cmnd *, int); void (*eh_reset)(struct scsi_cmnd *); + + KABI_RESERVE(1) + KABI_RESERVE(2) }; #define to_scsi_driver(drv) \ container_of((drv), struct scsi_driver, gendrv) diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h index 1ae08e81339f..1f3b333f43b0 100644 --- a/include/scsi/scsi_eh.h +++ b/include/scsi/scsi_eh.h @@ -3,6 +3,7 @@ #define _SCSI_SCSI_EH_H
#include <linux/scatterlist.h> +#include <linux/kabi.h>
#include <scsi/scsi_cmnd.h> #include <scsi/scsi_common.h> @@ -41,6 +42,9 @@ struct scsi_eh_save { unsigned char cmnd[32]; struct scsi_data_buffer sdb; struct scatterlist sense_sgl; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
extern void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 4c2dc8150c6d..f9ea73798ece 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -9,6 +9,7 @@ #include <linux/mutex.h> #include <linux/seq_file.h> #include <linux/blk-mq.h> +#include <linux/kabi.h> #include <scsi/scsi.h>
struct block_device; @@ -497,6 +498,11 @@ struct scsi_host_template {
/* Delay for runtime autosuspend */ int rpm_autosuspend_delay; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
/* @@ -710,6 +716,10 @@ struct Scsi_Host { */ struct device *dma_dev;
+ KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) /* * We should ensure that this is aligned, both for better performance * and also because some compilers (m68k) don't automatically force
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/4487 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/T...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/4487 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/T...