s390/mm: Avoid ABI change in 4.9.52
authorBen Hutchings <ben@decadent.org.uk>
Mon, 27 Nov 2017 20:49:07 +0000 (20:49 +0000)
committerYves-Alexis Perez <corsac@debian.org>
Fri, 9 Feb 2018 12:58:52 +0000 (12:58 +0000)
Commit 60f07c8ec5fa "s390/mm: fix race on mm->context.flush_mm" added
a field to the s390 definition of mm_context_t.  This is embedded in
the arch-indepdendent struct mm_struct, so adding a new field results
in an incompatible change to the layout of the larger struct.

Move the new field out of mm_context_t to the end of mm_struct, and
hide the change from genksyms.

Gbp-Pq: Topic debian
Gbp-Pq: Name s390-mm-avoid-abi-change-in-4.9.52.patch

arch/s390/include/asm/mmu.h
arch/s390/include/asm/mmu_context.h
arch/s390/include/asm/tlbflush.h
include/linux/mm_types.h

index af85d6b120284e2ee674c082098470a787ca49a5..8dac31f56df9143cd7c7b5265e3d21b29701f418 100644 (file)
@@ -5,7 +5,6 @@
 #include <linux/errno.h>
 
 typedef struct {
-       spinlock_t lock;
        cpumask_t cpu_attach_mask;
        atomic_t flush_count;
        unsigned int flush_mm;
@@ -26,7 +25,7 @@ typedef struct {
 } mm_context_t;
 
 #define INIT_MM_CONTEXT(name)                                             \
-       .context.lock = __SPIN_LOCK_UNLOCKED(name.context.lock),           \
+       .s390_flush_lock = __SPIN_LOCK_UNLOCKED(name.s390_flush_lock),     \
        .context.pgtable_lock =                                            \
                        __SPIN_LOCK_UNLOCKED(name.context.pgtable_lock),   \
        .context.pgtable_list = LIST_HEAD_INIT(name.context.pgtable_list), \
index f65a708ac395dc93cf4d5602f9c2f59007e4c7f0..dee12239a36f4595eecd3e5220d3b8b8313775e3 100644 (file)
@@ -15,7 +15,7 @@
 static inline int init_new_context(struct task_struct *tsk,
                                   struct mm_struct *mm)
 {
-       spin_lock_init(&mm->context.lock);
+       spin_lock_init(&mm->s390_flush_lock);
        spin_lock_init(&mm->context.pgtable_lock);
        INIT_LIST_HEAD(&mm->context.pgtable_list);
        spin_lock_init(&mm->context.gmap_lock);
index eed927aeb08f9501c0285094b0a911a66d117482..7ddd9824ffd72fa09eda1da928aeaa468790c5f8 100644 (file)
@@ -96,12 +96,12 @@ static inline void __tlb_flush_kernel(void)
 
 static inline void __tlb_flush_mm_lazy(struct mm_struct * mm)
 {
-       spin_lock(&mm->context.lock);
+       spin_lock(&mm->s390_flush_lock);
        if (mm->context.flush_mm) {
                mm->context.flush_mm = 0;
                __tlb_flush_mm(mm);
        }
-       spin_unlock(&mm->context.lock);
+       spin_unlock(&mm->s390_flush_lock);
 }
 
 /*
index 6616107518adb0eac4086fe99125aa2157f0c326..fd22e5f9732fe608e5d177f48fd12ed2336bfa40 100644 (file)
@@ -523,6 +523,12 @@ struct mm_struct {
        atomic_long_t hugetlb_usage;
 #endif
        struct work_struct async_put_work;
+#ifndef __GENKSYMS__
+#ifdef CONFIG_S390
+       /* bwh: This should be in s390's mm_context_t but that breaks ABI */
+       spinlock_t s390_flush_lock;
+#endif
+#endif
 };
 
 static inline void mm_init_cpumask(struct mm_struct *mm)