]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
KABI PADDING FOR ORACLE SPECIFIC FUTURE EXTENSIONS
authorManjunath Govindashetty <manjunath.govindashetty@oracle.com>
Tue, 10 Nov 2015 10:45:46 +0000 (02:45 -0800)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Fri, 13 Nov 2015 16:50:03 +0000 (08:50 -0800)
Orabug 21903851

Padding added before ABI freeze to allow future extensions while
preserving ABI on interface structures scsi_disk ,queue_limits,block_device_operations,
sk_buff,user_namespace,ip_tunnel,net,sock,scsi_cmnd ,scsi_device

Reviwed-by: Martin Petersen <martin.petersen@oracle.com>
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
12 files changed:
drivers/scsi/sd.h
include/linux/blk_types.h
include/linux/blkdev.h
include/linux/mm_types.h
include/linux/skbuff.h
include/linux/uek_kabi.h [new file with mode: 0644]
include/linux/user_namespace.h
include/net/ip_tunnels.h
include/net/net_namespace.h
include/net/sock.h
include/scsi/scsi_cmnd.h
include/scsi/scsi_device.h

index 63ba5ca7f9a16b21735c1283c2a17df40a7ee06c..6932b6da984798a64797efacd1a1fe16fa7f4a15 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _SCSI_DISK_H
 #define _SCSI_DISK_H
 
+#include <linux/uek_kabi.h>
+
 /*
  * More than enough for everybody ;)  The huge number of majors
  * is a leftover from 16bit dev_t days, we don't really need that
@@ -93,6 +95,14 @@ struct scsi_disk {
        unsigned        lbpvpd : 1;
        unsigned        ws10 : 1;
        unsigned        ws16 : 1;
+         /* Oracle inc use only
+          *
+          * The following padding has been inserted before ABI freeze to
+          * allow extending the structure while preserving ABI.
+          */
+
+        UEK_KABI_RESERVED(1)
+        UEK_KABI_RESERVED(2)
 };
 #define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev)
 
index b7299febc4b4adfee00cb8b05d6fbf6558f01547..d92357eeed07a2d54fbe5155760dd3c46deb39ee 100644 (file)
@@ -6,6 +6,7 @@
 #define __LINUX_BLK_TYPES_H
 
 #include <linux/types.h>
+#include <linux/uek_kabi.h>
 
 struct bio_set;
 struct bio;
@@ -97,7 +98,6 @@ struct bio {
        struct bio_vec          *bi_io_vec;     /* the actual vec list */
 
        struct bio_set          *bi_pool;
-
        /*
         * We can inline a number of vecs at the end of the bio, to avoid
         * double allocations for a small number of bio_vecs. This member
index 5d93a6645e88676a7d90a1ac55b5d5d6792da667..d22c8ad2c1a15ac09a3bc2615182b734058ff620 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/smp.h>
 #include <linux/rcupdate.h>
 #include <linux/percpu-refcount.h>
+#include <linux/uek_kabi.h>
 
 #include <asm/scatterlist.h>
 
@@ -307,6 +308,14 @@ struct queue_limits {
        unsigned char           cluster;
        unsigned char           discard_zeroes_data;
        unsigned char           raid_partial_stripes_expensive;
+         /* Oracle inc use only
+          *
+          * The following padding has been inserted before ABI freeze to
+          * allow extending the structure while preserving ABI.
+          */
+
+        UEK_KABI_RESERVED(1)
+        UEK_KABI_RESERVED(2)
 };
 
 struct request_queue {
@@ -1613,6 +1622,12 @@ struct block_device_operations {
        int (*getgeo)(struct block_device *, struct hd_geometry *);
        /* this callback is with swap_lock and sometimes page table lock held */
        void (*swap_slot_free_notify) (struct block_device *, unsigned long);
+         /* Oracle inc use only
+          *
+          * The following padding has been inserted before ABI freeze to
+          * allow extending the structure while preserving ABI.
+          */
+       int  (*uek_reserved1) (struct block_device *, unsigned long);
        struct module *owner;
 };
 
index 8d37e26a1007c6493990093e7ce8a03f2b201419..f41302bfd50df7028c7c928603386a4e05b0f831 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _LINUX_MM_TYPES_H
 #define _LINUX_MM_TYPES_H
 
+#include <linux/uek_kabi.h>
 #include <linux/auxvec.h>
 #include <linux/types.h>
 #include <linux/threads.h>
@@ -313,6 +314,12 @@ struct vm_area_struct {
 #ifdef CONFIG_NUMA
        struct mempolicy *vm_policy;    /* NUMA policy for the VMA */
 #endif
+        /* Oracle inc use only 
+         * The following padding has been inserted before ABI freeze to
+         * allow extending the structure while preserving ABI.
+         */
+        UEK_KABI_RESERVED(1)
+        UEK_KABI_RESERVED(2)
 };
 
 struct core_thread {
index f15154a879c711870ba649f867fc6eeb47212f14..fcd05bcfba5414617a7aafb748d5155d8c391c54 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/netdev_features.h>
 #include <linux/sched.h>
+#include <linux/uek_kabi.h>
 #include <net/flow_keys.h>
 
 /* A. Checksumming of received packets by device.
@@ -607,6 +608,7 @@ struct sk_buff {
        __u8                    csum_valid:1;
        __u8                    csum_complete_sw:1;
        __u8                    csum_level:2;
+       __u8                    csum_pad:1;
        __u8                    csum_bad:1;
 
 #ifdef CONFIG_IPV6_NDISC_NODETYPE
@@ -675,6 +677,13 @@ struct sk_buff {
                                *data;
        unsigned int            truesize;
        atomic_t                users;
+         /* Oracle inc use only
+          *
+          * The following padding has been inserted before ABI freeze to
+          * allow extending the structure while preserving ABI.
+          */
+        UEK_KABI_RESERVED(1)
+        UEK_KABI_RESERVED(2)
 };
 
 #ifdef __KERNEL__
diff --git a/include/linux/uek_kabi.h b/include/linux/uek_kabi.h
new file mode 100644 (file)
index 0000000..32a4c7f
--- /dev/null
@@ -0,0 +1,118 @@
+ /*
+  * uek_abi.h - Oracle kabi abstraction header
+  *
+  * (C) 2015 Oracle, Inc.  All rights reserved.
+  *
+  * This file is released under the GPLv2.
+  * See the file COPYING for more details.
+  */
+ #ifndef _LINUX_UEK_KABI_H
+ #define _LINUX_UEK_KABI_H
+ #include <linux/compiler.h>
+ /*
+  * The UEK_KABI_REPLACE* macros attempt to add the ability to use the '_new'
+  * element while preserving size alignment and kabi agreement with the '_orig'
+  * element.
+  *
+  * The #ifdef __GENKSYMS__ preserves the kabi agreement, while the anonymous
+  * union structure preserves the size alignment (assuming the '_new' element is
+  * not bigger than the '_orig' element).
+  *
+  * UEK_KABI_REPLACE - simple replacement of _orig with a union of _orig and _new
+  * UEK_KABI_DEPRECATE - mark the element as deprecated and make it unusable
+  *                       by modules while preserving KABI checksums
+  *
+  * UEK_KABI_EXTEND - simple macro for adding a new element to a struct while
+  *                  preserving the kabi agreement (by wrapping with GENKSYMS).
+  * UEK_KABI_FILL_HOLE - simple macro for filling a hole in a struct while
+  *                     preserving the kabi agreement (by wrapping with GENKSYMS).
+  * UEK_KABI_RENAME - simple macro for renaming an element without changing its type
+  *                  while preserving thi kabi agreement (by wrapping with GENKSYMS).
+  *                  This macro can be used in bitfields, for example.
+  *                  NOTE: does not include the final ';'
+  * UEK_KABI_REPLACE_UNSAFE - unsafe version of UEK_KABI_REPLACE. Only use for typedefs.
+  *
+  * NOTE NOTE NOTE
+  * Don't use ';' after these macros as it messes up the kabi checker by
+  * changing what the resulting token string looks like.
+  * Instead let this macro add the ';' so it can be properly hidden from
+  * the kabi checker (mainly for UEK_KABI_EXTEND, but applied to all macros for
+  * uniformity).
+  * NOTE NOTE NOTE
+  */
+ #ifdef __GENKSYMS__
+ # define _UEK_KABI_REPLACE(_orig, _new)                _orig
+ # define _UEK_KABI_REPLACE_UNSAFE(_orig, _new)        _orig
+ # define _UEK_KABI_DEPRECATE(_type, _orig)        _type _orig
+ # define UEK_KABI_EXTEND(_new)
+ # define UEK_KABI_FILL_HOLE(_new)
+ # define UEK_KABI_RENAME(_orig, _new)                _orig
+ #else
+ #if IS_BUILTIN(CONFIG_UEK_KABI_SIZE_ALIGN_CHECKS)
+ #define __UEK_KABI_CHECK_SIZE_ALIGN(_orig, _new)                                \
+         union {                                                                \
+                 _Static_assert(sizeof(struct{_new;}) <= sizeof(struct{_orig;}), \
+                                "kabi sizeof test panic");                \
+                 _Static_assert(__alignof__(struct{_new;}) <= __alignof__(struct{_orig;}), \
+                                "kabi alignof test panic");                \
+         }
+ #else
+ #define __UEK_KABI_CHECK_SIZE_ALIGN(_orig, _new)
+ #endif
+ # define _UEK_KABI_REPLACE(_orig, _new)                        \
+         union {                                                \
+                 _new;                                        \
+                 struct {                                \
+                         _orig;                                \
+                 } __UNIQUE_ID(uek_kabi_hide);                \
+                 __UEK_KABI_CHECK_SIZE_ALIGN(_orig, _new);        \
+         }
+ #define _UEK_KABI_REPLACE_UNSAFE(_orig, _new)        _new
+ #define _UEK_KABI_DEPRECATE(_type, _orig)        _type uek_reserved_##_orig
+ #define UEK_KABI_EXTEND(_new)                         _new;
+ /* Warning, only use if a hole exists for _all_ arches. Use pahole to verify */
+ #define UEK_KABI_FILL_HOLE(_new)               _new;
+ #define UEK_KABI_RENAME(_orig, _new)                _new
+ #endif /* __GENKSYMS__ */
+ /* colon added wrappers for the UEK_KABI_REPLACE macros */
+ #define UEK_KABI_REPLACE(_orig, _new)                _UEK_KABI_REPLACE(_orig, _new);
+ #define UEK_KABI_REPLACE_UNSAFE(_orig, _new)        _UEK_KABI_REPLACE_UNSAFE(_orig, _new);
+ #define UEK_KABI_DEPRECATE(_type, _orig)                _UEK_KABI_DEPRECATE(_type, _orig);
+ /*
+  * Standardization  on Oracle inc reserved names.  These wrappers leverage
+  * those common names making it easier to read and find in the code.
+  */
+ #define _UEK_KABI_RESERVED(n)                unsigned long uek_reserved##n
+ #define _UEK_KABI_RESERVED_P(n)                void (*uek_reserved##n)(void)
+ #define UEK_KABI_RESERVED(n)                _UEK_KABI_RESERVED(n);
+ #define UEK_KABI_RESERVED_P(n)                _UEK_KABI_RESERVED_P(n);
+ /*
+  * Simple wrappers to replace standard Oracle inc reserved elements.
+  */
+ #define UEK_KABI_USE(n, _new)                UEK_KABI_REPLACE(_UEK_KABI_RESERVED(n), _new)
+ #define UEK_KABI_USE_P(n, _new)                UEK_KABI_REPLACE(_UEK_KABI_RESERVED_P(n), _new)
+ /*
+  * Macros for breaking up a reserved element into two smaller chunks using an
+  * anonymous struct inside an anonymous union.
+  */
+ #define UEK_KABI_USE2(n, _new1, _new2)        UEK_KABI_REPLACE(_UEK_KABI_RESERVED(n), struct{ _new1; _new2; })
+ #define UEK_KABI_USE2_P(n, _new1, _new2)        UEK_KABI_REPLACE(_UEK_KABI_RESERVED_P(n), struct{ _new1; _new2;})
+ #endif /* _LINUX_UEK_KABI_H */
index 8297e5b341d863aa627a3b44a70d025bc8bc7c30..78d1148ca6b6b209799f55e20661136e1ca7643b 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/ns_common.h>
 #include <linux/sched.h>
 #include <linux/err.h>
+#include <linux/uek_kabi.h>
 
 #define UID_GID_MAP_MAX_EXTENTS 5
 
@@ -39,6 +40,13 @@ struct user_namespace {
        struct key              *persistent_keyring_register;
        struct rw_semaphore     persistent_keyring_register_sem;
 #endif
+         /* Oracle use only
+          *
+          * The following padding has been inserted before ABI freeze to
+          * allow extending the structure while preserve ABI.
+          */
+        UEK_KABI_EXTEND(bool                    may_mount_sysfs)
+        UEK_KABI_EXTEND(bool                    may_mount_proc)
 };
 
 extern struct user_namespace init_user_ns;
index d8214cb88bbcfa6524a7d1900c543a45a05f7f31..95ceb532447cfb833d9184e36cef38ca793712b5 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <linux/types.h>
+#include <linux/uek_kabi.h>
 #include <linux/u64_stats_sync.h>
 #include <net/dsfield.h>
 #include <net/gro_cells.h>
@@ -84,6 +85,13 @@ struct ip_tunnel {
        unsigned int            prl_count;      /* # of entries in PRL */
        int                     ip_tnl_net_id;
        struct gro_cells        gro_cells;
+         /* Oracle inc use only
+          *
+          * The following padding has been inserted before ABI freeze to
+          * allow extending the structure while preserving ABI.
+          */
+        UEK_KABI_RESERVED(1)
+        UEK_KABI_RESERVED(2)
 };
 
 #define TUNNEL_CSUM            __cpu_to_be16(0x01)
index f733656404de0ea5cba33c83a641e37dc4e4d5e5..ee2e43512b3d5456f22490bbf3270ba3a80896f2 100644 (file)
@@ -28,6 +28,7 @@
 #include <net/netns/xfrm.h>
 #include <net/netns/mpls.h>
 #include <linux/ns_common.h>
+#include <linux/uek_kabi.h>
 
 struct user_namespace;
 struct proc_dir_entry;
@@ -133,6 +134,18 @@ struct net {
 #endif
        struct sock             *diag_nlsk;
        atomic_t                fnhe_genid;
+         /* Oracle use only
+          *
+          * The following padding has been inserted before ABI freeze to
+          * allow extending the structure while preserving ABI.
+          */
+        UEK_KABI_EXTEND(int              sysctl_ip_no_pmtu_disc)
+        UEK_KABI_EXTEND(int              sysctl_ip_fwd_use_pmtu)
+        /* upstream has this as part of netns_ipv4 */
+        UEK_KABI_EXTEND(struct local_ports ipv4_sysctl_local_ports)
+        UEK_KABI_EXTEND(spinlock_t       nsid_lock)
+        /* upstream has this as part of netns_ipv4 */
+        UEK_KABI_EXTEND(struct sock  * __percpu *ipv4_tcp_sk)
 };
 
 #include <linux/seq_file_net.h>
index 3a4898ec8c67c5242e9467a0d32f2e68f3a55302..6f91ef2f02e2df06e2d08bee1f25705024f68abb 100644 (file)
@@ -62,6 +62,7 @@
 #include <linux/filter.h>
 #include <linux/rculist_nulls.h>
 #include <linux/poll.h>
+#include <linux/uek_kabi.h>
 
 #include <linux/atomic.h>
 #include <net/dst.h>
@@ -438,6 +439,14 @@ struct sock {
        int                     (*sk_backlog_rcv)(struct sock *sk,
                                                  struct sk_buff *skb);
        void                    (*sk_destruct)(struct sock *sk);
+        /* Oracle specific
+         * padding inserted before ABI freeze to
+         * allow extending the structure while preserving ABI. Feel free
+         * to replace reserved slots with required structure field
+         * additions of your backport.
+         */
+        UEK_KABI_RESERVED(1)
+        UEK_KABI_RESERVED(2)
 };
 
 #define __sk_user_data(sk) ((*((void __rcu **)&(sk)->sk_user_data)))
index 9fc1aecfc81369b9cfc694bece77b9bdfde131e5..25cd82e585ca2ee2a5eaed1d9efde387edfc5e17 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/list.h>
 #include <linux/types.h>
 #include <linux/timer.h>
+#include <linux/uek_kabi.h>
 #include <linux/scatterlist.h>
 #include <scsi/scsi_device.h>
 
@@ -138,6 +139,13 @@ struct scsi_cmnd {
        int flags;              /* Command flags */
 
        unsigned char tag;      /* SCSI-II queued command tag */
+         /* Oracle inc use only
+          *
+          * The following padding has been inserted before ABI freeze to
+          * allow extending the structure while preserving ABI.
+          */
+         UEK_KABI_RESERVED(3)
+         UEK_KABI_RESERVED(4)
 };
 
 /*
index a4c9336811d17b14fe7c06e2171de329cf077b7b..58ec58ee0343022d0ec9d8d87434474ae009d4d1 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/blkdev.h>
 #include <scsi/scsi.h>
 #include <linux/atomic.h>
+#include <linux/uek_kabi.h>
 
 struct device;
 struct request_queue;
@@ -197,6 +198,13 @@ struct scsi_device {
 
        struct scsi_dh_data     *scsi_dh_data;
        enum scsi_device_state sdev_state;
+         /* Oracle inc use only
+          *
+          * The following padding has been inserted before ABI freeze to
+          * allow extending the structure while preserving ABI.
+          */
+        UEK_KABI_RESERVED(1)
+        UEK_KABI_RESERVED(2)
        unsigned long           sdev_data[0];
 } __attribute__((aligned(sizeof(unsigned long))));