From 33b3ab6631ded858f811d6f5f6d7af4ac15dbc65 Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.cz>
Date: Fri, 16 Sep 2011 11:56:20 +0200
Subject: [PATCH 3/3] kabi: Add placeholders to a couple of important
structures
Patch-mainline: Never, kabi
References: fate#312013
Add a void* suse_kabi_padding placeholder to the following structures:
struct smp_ops
struct vm_area_struct
struct mm_struct
struct zone
- adding an explicit padding here is not strictly required, but can
serve as documentation that there is some space
struct pglist_data
struct vfsmount
struct module
struct signal_struct
struct sched_entity
struct sock
struct task_struct
The idea is that when a fix appears that requires a new member in any of
these structures, we use this padding:
#ifdef __GENKSYMS__
void *suse_kabi_padding;
#else
long foo;
#endif
And we don't have to worry about changing size of the structure, as long
as the new member is a pointer or a long.
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
arch/x86/include/asm/smp.h | 1 +
include/linux/mm_types.h | 1 +
include/linux/mmzone.h | 1 +
include/linux/module.h | 1 +
include/linux/mount.h | 1 +
include/linux/sched.h | 2 ++
include/linux/sched/signal.h | 1 +
include/net/sock.h | 1 +
8 files changed, 9 insertions(+)
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -57,6 +57,7 @@ struct smp_ops {
void (*send_call_func_ipi)(const struct cpumask *mask);
void (*send_call_func_single_ipi)(int cpu);
+ void *suse_kabi_padding;
};
/* Globals due to paravirt */
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -343,6 +343,7 @@ struct vm_area_struct {
struct mempolicy *vm_policy; /* NUMA policy for the VMA */
#endif
struct vm_userfaultfd_ctx vm_userfaultfd_ctx;
+ void *suse_kabi_padding;
};
struct core_thread {
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -504,6 +504,7 @@ struct zone {
/* Zone statistics */
atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
atomic_long_t vm_numa_stat[NR_VM_NUMA_STAT_ITEMS];
+ void *suse_kabi_padding;
} ____cacheline_internodealigned_in_smp;
enum pgdat_flags {
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -475,6 +475,7 @@ struct module {
ctor_fn_t *ctors;
unsigned int num_ctors;
#endif
+ void *suse_kabi_padding;
} ____cacheline_aligned;
#ifndef MODULE_ARCH_INIT
#define MODULE_ARCH_INIT {}
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -67,6 +67,7 @@ struct vfsmount {
struct dentry *mnt_root; /* root of the mounted tree */
struct super_block *mnt_sb; /* pointer to superblock */
int mnt_flags;
+ void *suse_kabi_padding;
};
struct file; /* forward dec */
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -429,6 +429,7 @@ struct sched_rt_entity {
/* rq "owned" by this entity/group: */
struct rt_rq *my_q;
#endif
+ void *suse_kabi_padding;
};
struct sched_dl_entity {
@@ -1069,6 +1070,7 @@ struct task_struct {
#ifdef CONFIG_SECURITY
/* Used by LSM modules for access restriction: */
void *security;
+ void *suse_kabi_padding;
#endif
/* CPU-specific state of this task: */
struct thread_struct thread;
--- a/include/linux/sched/signal.h
+++ b/include/linux/sched/signal.h
@@ -222,6 +222,7 @@ struct signal_struct {
struct mutex cred_guard_mutex; /* guard against foreign influences on
* credential calculations
* (notably. ptrace) */
+ void *suse_kabi_padding;
};
/*
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -477,6 +477,7 @@ struct sock {
struct sk_buff *skb);
#endif
void (*sk_destruct)(struct sock *sk);
+ void *suse_kabi_padding;
struct sock_reuseport __rcu *sk_reuseport_cb;
struct rcu_head sk_rcu;
};