forked from Minki/linux
e5992f2e6c
Add code that allows KVM to control the virtual memory layout that is seen by a guest. The guest address space uses a second page table that shares the last level pte-tables with the process page table. If a page is unmapped from the process page table it is automatically unmapped from the guest page table as well. The guest address space mapping starts out empty, KVM can map any individual 1MB segments from the process virtual memory to any 1MB aligned location in the guest virtual memory. If a target segment in the process virtual memory does not exist or is unmapped while a guest mapping exists the desired target address is stored as an invalid segment table entry in the guest page table. The population of the guest page table is fault driven. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
25 lines
708 B
C
25 lines
708 B
C
#ifndef __MMU_H
|
|
#define __MMU_H
|
|
|
|
typedef struct {
|
|
atomic_t attach_count;
|
|
unsigned int flush_mm;
|
|
spinlock_t list_lock;
|
|
struct list_head pgtable_list;
|
|
struct list_head gmap_list;
|
|
unsigned long asce_bits;
|
|
unsigned long asce_limit;
|
|
unsigned long vdso_base;
|
|
/* Cloned contexts will be created with extended page tables. */
|
|
unsigned int alloc_pgste:1;
|
|
/* The mmu context has extended page tables. */
|
|
unsigned int has_pgste:1;
|
|
} mm_context_t;
|
|
|
|
#define INIT_MM_CONTEXT(name) \
|
|
.context.list_lock = __SPIN_LOCK_UNLOCKED(name.context.list_lock), \
|
|
.context.pgtable_list = LIST_HEAD_INIT(name.context.pgtable_list), \
|
|
.context.gmap_list = LIST_HEAD_INIT(name.context.gmap_list),
|
|
|
|
#endif
|