mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-25 22:25:37 +07:00
62e88b1c00
The x86 MPX patch set calls arch_unmap() and arch_bprm_mm_init() from fs/exec.c, so we need at least a stub for them in all architectures. They are only called under an #ifdef for CONFIG_MMU=y, so we can at least restict this to architectures with MMU support. blackfin/c6x have no MMU support, so do not call arch_unmap(). They also do not include mm_hooks.h or mmu_context.h at all and do not need to be touched. s390, um and unicore32 do not use asm-generic/mm_hooks.h, so got their own arch_unmap() versions. (I also moved um's arch_dup_mmap() to be closer to the other mm_hooks.h functions). xtensa only includes mm_hooks when MMU=y, which should be fine since arch_unmap() is called only from MMU=y code. For the rest, we use the stub copies of these functions in asm-generic/mm_hook.h. I cross compiled defconfigs for cris (to check NOMMU) and s390 to make sure that this works. I also checked a 64-bit build of UML and all my normal x86 builds including PARAVIRT on and off. Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Cc: Dave Hansen <dave@sr71.net> Cc: linux-arch@vger.kernel.org Cc: x86@kernel.org Link: http://lkml.kernel.org/r/20141118182350.8B4AA2C2@viggo.jf.intel.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
73 lines
1.7 KiB
C
73 lines
1.7 KiB
C
/*
|
|
* Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
|
|
* Licensed under the GPL
|
|
*/
|
|
|
|
#ifndef __UM_MMU_CONTEXT_H
|
|
#define __UM_MMU_CONTEXT_H
|
|
|
|
#include <linux/sched.h>
|
|
#include <asm/mmu.h>
|
|
|
|
extern void uml_setup_stubs(struct mm_struct *mm);
|
|
/*
|
|
* Needed since we do not use the asm-generic/mm_hooks.h:
|
|
*/
|
|
static inline void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm)
|
|
{
|
|
uml_setup_stubs(mm);
|
|
}
|
|
extern void arch_exit_mmap(struct mm_struct *mm);
|
|
static inline void arch_unmap(struct mm_struct *mm,
|
|
struct vm_area_struct *vma,
|
|
unsigned long start, unsigned long end)
|
|
{
|
|
}
|
|
static inline void arch_bprm_mm_init(struct mm_struct *mm,
|
|
struct vm_area_struct *vma)
|
|
{
|
|
}
|
|
/*
|
|
* end asm-generic/mm_hooks.h functions
|
|
*/
|
|
|
|
#define deactivate_mm(tsk,mm) do { } while (0)
|
|
|
|
extern void force_flush_all(void);
|
|
|
|
static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
|
|
{
|
|
/*
|
|
* This is called by fs/exec.c and sys_unshare()
|
|
* when the new ->mm is used for the first time.
|
|
*/
|
|
__switch_mm(&new->context.id);
|
|
down_write(&new->mmap_sem);
|
|
uml_setup_stubs(new);
|
|
up_write(&new->mmap_sem);
|
|
}
|
|
|
|
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
|
|
struct task_struct *tsk)
|
|
{
|
|
unsigned cpu = smp_processor_id();
|
|
|
|
if(prev != next){
|
|
cpumask_clear_cpu(cpu, mm_cpumask(prev));
|
|
cpumask_set_cpu(cpu, mm_cpumask(next));
|
|
if(next != &init_mm)
|
|
__switch_mm(&next->context.id);
|
|
}
|
|
}
|
|
|
|
static inline void enter_lazy_tlb(struct mm_struct *mm,
|
|
struct task_struct *tsk)
|
|
{
|
|
}
|
|
|
|
extern int init_new_context(struct task_struct *task, struct mm_struct *mm);
|
|
|
|
extern void destroy_context(struct mm_struct *mm);
|
|
|
|
#endif
|