~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/s390/include/asm/mmu_context.h

Version: ~ [ linux-5.11-rc3 ] ~ [ linux-5.10.7 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.89 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.167 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.215 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.251 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.251 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  S390 version
  3  *
  4  *  Derived from "include/asm-i386/mmu_context.h"
  5  */
  6 
  7 #ifndef __S390_MMU_CONTEXT_H
  8 #define __S390_MMU_CONTEXT_H
  9 
 10 #include <asm/pgalloc.h>
 11 #include <asm/uaccess.h>
 12 #include <asm/tlbflush.h>
 13 #include <asm/ctl_reg.h>
 14 
 15 static inline int init_new_context(struct task_struct *tsk,
 16                                    struct mm_struct *mm)
 17 {
 18         atomic_set(&mm->context.attach_count, 0);
 19         mm->context.flush_mm = 0;
 20         mm->context.asce_bits = _ASCE_TABLE_LENGTH | _ASCE_USER_BITS;
 21 #ifdef CONFIG_64BIT
 22         mm->context.asce_bits |= _ASCE_TYPE_REGION3;
 23 #endif
 24         mm->context.has_pgste = 0;
 25         mm->context.asce_limit = STACK_TOP_MAX;
 26         crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm));
 27         return 0;
 28 }
 29 
 30 #define destroy_context(mm)             do { } while (0)
 31 
 32 #ifndef CONFIG_64BIT
 33 #define LCTL_OPCODE "lctl"
 34 #else
 35 #define LCTL_OPCODE "lctlg"
 36 #endif
 37 
 38 static inline void update_mm(struct mm_struct *mm, struct task_struct *tsk)
 39 {
 40         pgd_t *pgd = mm->pgd;
 41 
 42         S390_lowcore.user_asce = mm->context.asce_bits | __pa(pgd);
 43         /* Load primary space page table origin. */
 44         asm volatile(LCTL_OPCODE" 1,1,%0\n" : : "m" (S390_lowcore.user_asce));
 45         set_fs(current->thread.mm_segment);
 46 }
 47 
 48 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
 49                              struct task_struct *tsk)
 50 {
 51         cpumask_set_cpu(smp_processor_id(), mm_cpumask(next));
 52         update_mm(next, tsk);
 53         atomic_dec(&prev->context.attach_count);
 54         WARN_ON(atomic_read(&prev->context.attach_count) < 0);
 55         atomic_inc(&next->context.attach_count);
 56         /* Check for TLBs not flushed yet */
 57         __tlb_flush_mm_lazy(next);
 58 }
 59 
 60 #define enter_lazy_tlb(mm,tsk)  do { } while (0)
 61 #define deactivate_mm(tsk,mm)   do { } while (0)
 62 
 63 static inline void activate_mm(struct mm_struct *prev,
 64                                struct mm_struct *next)
 65 {
 66         switch_mm(prev, next, current);
 67 }
 68 
 69 static inline void arch_dup_mmap(struct mm_struct *oldmm,
 70                                  struct mm_struct *mm)
 71 {
 72 #ifdef CONFIG_64BIT
 73         if (oldmm->context.asce_limit < mm->context.asce_limit)
 74                 crst_table_downgrade(mm, oldmm->context.asce_limit);
 75 #endif
 76 }
 77 
 78 static inline void arch_exit_mmap(struct mm_struct *mm)
 79 {
 80 }
 81 
 82 #endif /* __S390_MMU_CONTEXT_H */
 83 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp