Avoid ABI changes due to fixes in 3.10.6 and 3.10.7

Revert PowerPC fix for TM, which we don't enable.
Rearrange some other fields to be backward-compatible.

svn path=/dists/sid/linux/; revision=20503
This commit is contained in:
Ben Hutchings 2013-08-17 01:21:00 +00:00
parent d93c147e57
commit db19f6533d
7 changed files with 277 additions and 2 deletions

View File

@ -1,5 +1,8 @@
[abi]
abiname: 2
ignore-changes:
# Pointless function, removed in 3.10.6
menu_hrtimer_cancel
[base]
arches:

View File

@ -0,0 +1,76 @@
From: Ben Hutchings <ben@decadent.org.uk>
Date: Sat, 17 Aug 2013 00:11:22 +0200
Subject: Revert "powerpc/tm: Fix context switching TAR, PPR and DSCR SPRs"
Forwarded: not-needed
This reverts commit 28e61cc466d8daace4b0f04ba2b83e0bd68f5832, which
changes the kernel module ABI. We don't enable transactional memory
and therefore don't need this fix yet.
---
arch/powerpc/include/asm/processor.h | 4 ----
arch/powerpc/kernel/asm-offsets.c | 3 ---
arch/powerpc/kernel/tm.S | 20 --------------------
3 files changed, 27 deletions(-)
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -247,10 +247,6 @@ struct thread_struct {
unsigned long tm_orig_msr; /* Thread's MSR on ctx switch */
struct pt_regs ckpt_regs; /* Checkpointed registers */
- unsigned long tm_tar;
- unsigned long tm_ppr;
- unsigned long tm_dscr;
-
/*
* Transactional FP and VSX 0-31 register set.
* NOTE: the sense of these is the opposite of the integer ckpt_regs!
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -139,9 +139,6 @@ int main(void)
DEFINE(THREAD_TM_TFHAR, offsetof(struct thread_struct, tm_tfhar));
DEFINE(THREAD_TM_TEXASR, offsetof(struct thread_struct, tm_texasr));
DEFINE(THREAD_TM_TFIAR, offsetof(struct thread_struct, tm_tfiar));
- DEFINE(THREAD_TM_TAR, offsetof(struct thread_struct, tm_tar));
- DEFINE(THREAD_TM_PPR, offsetof(struct thread_struct, tm_ppr));
- DEFINE(THREAD_TM_DSCR, offsetof(struct thread_struct, tm_dscr));
DEFINE(PT_CKPT_REGS, offsetof(struct thread_struct, ckpt_regs));
DEFINE(THREAD_TRANSACT_VR0, offsetof(struct thread_struct,
transact_vr[0]));
--- a/arch/powerpc/kernel/tm.S
+++ b/arch/powerpc/kernel/tm.S
@@ -224,16 +224,6 @@ dont_backup_fp:
std r5, _CCR(r7)
std r6, _XER(r7)
-
- /* ******************** TAR, PPR, DSCR ********** */
- mfspr r3, SPRN_TAR
- mfspr r4, SPRN_PPR
- mfspr r5, SPRN_DSCR
-
- std r3, THREAD_TM_TAR(r12)
- std r4, THREAD_TM_PPR(r12)
- std r5, THREAD_TM_DSCR(r12)
-
/* MSR and flags: We don't change CRs, and we don't need to alter
* MSR.
*/
@@ -348,16 +338,6 @@ dont_restore_fp:
mtmsr r6 /* FP/Vec off again! */
restore_gprs:
-
- /* ******************** TAR, PPR, DSCR ********** */
- ld r4, THREAD_TM_TAR(r3)
- ld r5, THREAD_TM_PPR(r3)
- ld r6, THREAD_TM_DSCR(r3)
-
- mtspr SPRN_TAR, r4
- mtspr SPRN_PPR, r5
- mtspr SPRN_DSCR, r6
-
/* ******************** CR,LR,CCR,MSR ********** */
ld r3, _CTR(r7)
ld r4, _LINK(r7)

View File

@ -0,0 +1,110 @@
From: Ben Hutchings <ben@decadent.org.uk>
Subject: ARM: mm: Avoid ABI changes in 3.10.6
Date: Sat, 17 Aug 2013 00:35:01 +0200
Forwarded: not-needed
commit a5510daad56d ('ARM: move signal handlers into a vdso-like
page', commit 48be69a026b2 upstream) and commit 8271eb9ffaaa ('ARM:
7790/1: Fix deferred mm switch on VIVT processors', commit
bdae73cd374e upstream) added members to mm_context_t. Move them into
a new structure at the end of mm_struct (which is always allocated by
the core kernel) and hide it from genksyms.
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -6,13 +6,17 @@
typedef struct {
#ifdef CONFIG_CPU_HAS_ASID
atomic64_t id;
-#else
- int switch_pending;
#endif
unsigned int vmalloc_seq;
- unsigned long sigpage;
} mm_context_t;
+struct mm_context_ext {
+#ifndef CONFIG_CPU_HAS_ASID
+ int switch_pending;
+#endif
+ unsigned long sigpage;
+};
+
#ifdef CONFIG_CPU_HAS_ASID
#define ASID_BITS 8
#define ASID_MASK ((~0ULL) << ASID_BITS)
--- a/arch/arm/include/asm/mmu_context.h
+++ b/arch/arm/include/asm/mmu_context.h
@@ -55,7 +55,7 @@ static inline void check_and_switch_cont
* on non-ASID CPUs, the old mm will remain valid until the
* finish_arch_post_lock_switch() call.
*/
- mm->context.switch_pending = 1;
+ mm->context_ext.switch_pending = 1;
else
cpu_switch_mm(mm->pgd, mm);
}
@@ -66,7 +66,7 @@ static inline void finish_arch_post_lock
{
struct mm_struct *mm = current->mm;
- if (mm && mm->context.switch_pending) {
+ if (mm && mm->context_ext.switch_pending) {
/*
* Preemption must be disabled during cpu_switch_mm() as we
* have some stateful cache flush implementations. Check
@@ -74,8 +74,8 @@ static inline void finish_arch_post_lock
* switch to this mm was already done.
*/
preempt_disable();
- if (mm->context.switch_pending) {
- mm->context.switch_pending = 0;
+ if (mm->context_ext.switch_pending) {
+ mm->context_ext.switch_pending = 0;
cpu_switch_mm(mm->pgd, mm);
}
preempt_enable_no_resched();
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -437,6 +437,10 @@ struct mm_struct {
int first_nid;
#endif
struct uprobes_state uprobes_state;
+
+#if !defined(__GENKSYMS__) && defined(CONFIG_ARM)
+ struct mm_context_ext context_ext;
+#endif
};
/* first nid will either be a valid NID or one of these values */
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -474,7 +474,7 @@ int in_gate_area_no_mm(unsigned long add
const char *arch_vma_name(struct vm_area_struct *vma)
{
return is_gate_vma(vma) ? "[vectors]" :
- (vma->vm_mm && vma->vm_start == vma->vm_mm->context.sigpage) ?
+ (vma->vm_mm && vma->vm_start == vma->vm_mm->context_ext.sigpage) ?
"[sigpage]" : NULL;
}
@@ -504,7 +504,7 @@ int arch_setup_additional_pages(struct l
&signal_page);
if (ret == 0)
- mm->context.sigpage = addr;
+ mm->context_ext.sigpage = addr;
up_fail:
up_write(&mm->mmap_sem);
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -406,7 +406,7 @@ setup_return(struct pt_regs *regs, struc
* except when the MPU has protected the vectors
* page from PL0
*/
- retcode = mm->context.sigpage + signal_return_offset +
+ retcode = mm->context_ext.sigpage + signal_return_offset +
(idx << 2) + thumb;
} else
#endif

View File

@ -0,0 +1,50 @@
From: Ben Hutchings <ben@decadent.org.uk>
Subject: tracing: Avoid ABI change in 3.10.7
Date: Sat, 17 Aug 2013 00:08:43 +0200
Forwarded: not-needed
commit 2d7ddf0a8fa2 ('tracing: Fix fields of struct trace_iterator
that are zeroed by mistake', commit ed5467da0e36 upstream) rearranged
struct trace_iterator unnecessarilly. Change the memset() to avoid
those fields.
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -78,11 +78,6 @@ struct trace_iterator {
/* trace_seq for __print_flags() and __print_symbolic() etc. */
struct trace_seq tmp_seq;
- cpumask_var_t started;
-
- /* it's true when current open file is snapshot */
- bool snapshot;
-
/* The below is zeroed out in pipe_read */
struct trace_seq seq;
struct trace_entry *ent;
@@ -95,7 +90,10 @@ struct trace_iterator {
loff_t pos;
long idx;
- /* All new field here will be zeroed out in pipe_read */
+ cpumask_var_t started;
+
+ /* it's true when current open file is snapshot */
+ bool snapshot;
};
enum trace_iter_flags {
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4161,9 +4161,9 @@ waitagain:
if (cnt >= PAGE_SIZE)
cnt = PAGE_SIZE - 1;
- /* reset all but tr, trace, and overruns */
+ /* reset all but tr, trace, overruns, started, snapshot */
memset(&iter->seq, 0,
- sizeof(struct trace_iterator) -
+ offsetof(struct trace_iterator, started) -
offsetof(struct trace_iterator, seq));
cpumask_clear(iter->started);
iter->pos = -1;

View File

@ -0,0 +1,30 @@
From: Ben Hutchings <ben@decadent.org.uk>
Subject: user_ns: Avoid ABI change in 3.10.6
Date: Sat, 17 Aug 2013 01:47:55 +0200
Forwarded: not-needed
commit 5c5f9cd2b539 ('userns: limit the maximum depth of
user_namespace->parent chain', commit 8742f229b635 upstream)
added a new field to struct user_namespace.
struct user_namespace is only allocated by the core kernel, so move
the new field to the end and hide it from genksyms.
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -23,12 +23,14 @@ struct user_namespace {
struct uid_gid_map projid_map;
atomic_t count;
struct user_namespace *parent;
- int level;
kuid_t owner;
kgid_t group;
unsigned int proc_inum;
bool may_mount_sysfs;
bool may_mount_proc;
+#ifndef __GENKSYMS__
+ int level;
+#endif
};
extern struct user_namespace init_user_ns;

View File

@ -33,9 +33,9 @@ Index: linux-stable/include/linux/mm_types.h
+#ifdef CONFIG_PREEMPT_RT_BASE
+ struct rcu_head delayed_drop;
+#endif
};
/* first nid will either be a valid NID or one of these values */
#if !defined(__GENKSYMS__) && defined(CONFIG_ARM)
struct mm_context_ext context_ext;
Index: linux-stable/include/linux/sched.h
===================================================================
--- linux-stable.orig/include/linux/sched.h

View File

@ -121,3 +121,9 @@ bugfix/arm/I2C-I2C-mv64xxx-remove-I2C_M_NOSTART-code.patch
bugfix/arm/I2C-mv64xxx-move-mv64xxx_i2c_prepare_for_io.patch
bugfix/arm/I2C-mv64xxx-fix-race-between-FSM-interrupt-and-proce.patch
bugfix/arm/ARM-Fix-the-world-famous-typo-with-is_gate_vma.patch
# ABI stability
debian/tracing-avoid-abi-change-in-3.10.7.patch
debian/Revert-powerpc-tm-Fix-context-switching-TAR-PPR-and-.patch
debian/arm-mm-avoid-abi-change-in-3.10.6.patch
debian/user_ns-avoid-abi-change-in-3.10.6.patch