Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __MMU_H
0003 #define __MMU_H
0004 
0005 #include <linux/cpumask.h>
0006 #include <linux/errno.h>
0007 #include <asm/asm-extable.h>
0008 
0009 typedef struct {
0010     spinlock_t lock;
0011     cpumask_t cpu_attach_mask;
0012     atomic_t flush_count;
0013     unsigned int flush_mm;
0014     struct list_head pgtable_list;
0015     struct list_head gmap_list;
0016     unsigned long gmap_asce;
0017     unsigned long asce;
0018     unsigned long asce_limit;
0019     unsigned long vdso_base;
0020     /* The mmu context belongs to a secure guest. */
0021     atomic_t protected_count;
0022     /*
0023      * The following bitfields need a down_write on the mm
0024      * semaphore when they are written to. As they are only
0025      * written once, they can be read without a lock.
0026      *
0027      * The mmu context allocates 4K page tables.
0028      */
0029     unsigned int alloc_pgste:1;
0030     /* The mmu context uses extended page tables. */
0031     unsigned int has_pgste:1;
0032     /* The mmu context uses storage keys. */
0033     unsigned int uses_skeys:1;
0034     /* The mmu context uses CMM. */
0035     unsigned int uses_cmm:1;
0036     /* The gmaps associated with this context are allowed to use huge pages. */
0037     unsigned int allow_gmap_hpage_1m:1;
0038 } mm_context_t;
0039 
0040 #define INIT_MM_CONTEXT(name)                          \
0041     .context.lock = __SPIN_LOCK_UNLOCKED(name.context.lock),       \
0042     .context.pgtable_list = LIST_HEAD_INIT(name.context.pgtable_list), \
0043     .context.gmap_list = LIST_HEAD_INIT(name.context.gmap_list),
0044 
0045 #endif