]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Nov 2017 22:23:52 +0000 (14:23 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Nov 2017 22:23:52 +0000 (14:23 -0800)
Pull second round of s390 updates from Martin Schwidefsky:

 - rework of the vdso code to avoid the use of the access register mode

 - use perf AUX buffers for the transport of diagnostic sample data

 - add perf_regs and user stack dump support

 - enable perf call graphs for user space programs

 - add perf register support for floating-point registers

 - all remaining s390 related timer_setup conversions

 - bug fixes and cleanups

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (30 commits)
  s390: remove unused parameter from Makefile
  zfcp: purely mechanical update using timer API, plus blank lines
  s390/scsi: Convert timers to use timer_setup()
  s390/cpum_sf: correctly set the PID and TID in perf samples
  s390/cpum_sf: load program parameter at sampler enablement
  s390/perf: add perf register support for floating-point registers
  s390/perf: extend perf_regs support to include floating-point registers
  s390/perf: define common DWARF register string table
  s390/perf: add support for perf_regs and libdw
  s390/perf: add perf_regs support and user stack dump
  s390/cpum_sf: do not register PMU if no sampling mode is authorized
  s390/cpumf: remove raw event support in basic-only sampling mode
  s390/perf: add callback to perf to enable using AUX buffer
  s390/cpumf: enable using AUX buffer
  s390/cpumf: introduce AUX buffer for dump diagnostic sample data
  s390/disassembler: increase show_code buffer size
  s390: Remove CONFIG_HARDENED_USERCOPY
  s390: enable CPU alternatives unconditionally
  s390/nmi: remove unused code
  s390/mm: remove unused code
  ...

1  2 
arch/s390/include/asm/mmu_context.h

index cf4c1cb17dcd35ab9a18197e9dbeed41d1a0b376,6133aa376b7c321a03a66ca78978bd5b32dbc9a7..f4a07f788f78b3160f9ae312e699805b47f67ebe
@@@ -44,8 -44,6 +44,8 @@@ static inline int init_new_context(stru
                mm->context.asce_limit = STACK_TOP_MAX;
                mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
                                   _ASCE_USER_BITS | _ASCE_TYPE_REGION3;
 +              /* pgd_alloc() did not account this pud */
 +              mm_inc_nr_puds(mm);
                break;
        case -PAGE_SIZE:
                /* forked 5-level task, set new asce with new_mm->pgd */
@@@ -61,7 -59,7 +61,7 @@@
                /* forked 2-level compat task, set new asce with new mm->pgd */
                mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
                                   _ASCE_USER_BITS | _ASCE_TYPE_SEGMENT;
 -              /* pgd_alloc() did not increase mm->nr_pmds */
 +              /* pgd_alloc() did not account this pmd */
                mm_inc_nr_pmds(mm);
        }
        crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm));
  static inline void set_user_asce(struct mm_struct *mm)
  {
        S390_lowcore.user_asce = mm->context.asce;
-       if (current->thread.mm_segment.ar4)
-               __ctl_load(S390_lowcore.user_asce, 7, 7);
-       set_cpu_flag(CIF_ASCE_PRIMARY);
+       __ctl_load(S390_lowcore.user_asce, 1, 1);
+       clear_cpu_flag(CIF_ASCE_PRIMARY);
  }
  
  static inline void clear_user_asce(void)
  {
        S390_lowcore.user_asce = S390_lowcore.kernel_asce;
-       __ctl_load(S390_lowcore.user_asce, 1, 1);
-       __ctl_load(S390_lowcore.user_asce, 7, 7);
- }
- static inline void load_kernel_asce(void)
- {
-       unsigned long asce;
-       __ctl_store(asce, 1, 1);
-       if (asce != S390_lowcore.kernel_asce)
-               __ctl_load(S390_lowcore.kernel_asce, 1, 1);
+       __ctl_load(S390_lowcore.kernel_asce, 1, 1);
        set_cpu_flag(CIF_ASCE_PRIMARY);
  }
  
+ mm_segment_t enable_sacf_uaccess(void);
+ void disable_sacf_uaccess(mm_segment_t old_fs);
  static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
                             struct task_struct *tsk)
  {
        int cpu = smp_processor_id();
  
-       S390_lowcore.user_asce = next->context.asce;
        if (prev == next)
                return;
+       S390_lowcore.user_asce = next->context.asce;
        cpumask_set_cpu(cpu, &next->context.cpu_attach_mask);
-       /* Clear old ASCE by loading the kernel ASCE. */
-       __ctl_load(S390_lowcore.kernel_asce, 1, 1);
-       __ctl_load(S390_lowcore.kernel_asce, 7, 7);
+       /* Clear previous user-ASCE from CR1 and CR7 */
+       if (!test_cpu_flag(CIF_ASCE_PRIMARY)) {
+               __ctl_load(S390_lowcore.kernel_asce, 1, 1);
+               set_cpu_flag(CIF_ASCE_PRIMARY);
+       }
+       if (test_cpu_flag(CIF_ASCE_SECONDARY)) {
+               __ctl_load(S390_lowcore.vdso_asce, 7, 7);
+               clear_cpu_flag(CIF_ASCE_SECONDARY);
+       }
        cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask);
  }
  
@@@ -117,7 -112,6 +114,6 @@@ static inline void finish_arch_post_loc
        struct task_struct *tsk = current;
        struct mm_struct *mm = tsk->mm;
  
-       load_kernel_asce();
        if (mm) {
                preempt_disable();
                while (atomic_read(&mm->context.flush_count))