Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6dd61c8 authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge Committed by Andi Kleen
Browse files

[PATCH] x86: PARAVIRT: add hooks to intercept mm creation and destruction



Add hooks to allow a paravirt implementation to track the lifetime of
an mm.  Paravirtualization requires three hooks, but only two are
needed in common code.  They are:

arch_dup_mmap, which is called when a new mmap is created at fork

arch_exit_mmap, which is called when the last process reference to an
  mm is dropped, which typically happens on exit and exec.

The third hook is activate_mm, which is called from the arch-specific
activate_mm() macro/function, and so doesn't need stub versions for
other architectures.  It's called when an mm is first used.

Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Cc: linux-arch@vger.kernel.org
Cc: James Bottomley <James.Bottomley@SteelEye.com>
Acked-by: default avatarIngo Molnar <mingo@elte.hu>
parent 5311ab62
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -237,6 +237,10 @@ struct paravirt_ops paravirt_ops = {
	.irq_enable_sysexit = native_irq_enable_sysexit,
	.iret = native_iret,

	.dup_mmap = paravirt_nop,
	.exit_mmap = paravirt_nop,
	.activate_mm = paravirt_nop,

	.startup_ipi_hook = paravirt_nop,
};

+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include <asm/system.h>
#include <asm/machvec.h>
#include <asm/compiler.h>
#include <asm-generic/mm_hooks.h>

/*
 * Force a context reload. This is needed when we change the page
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include <linux/compiler.h>
#include <asm/cacheflush.h>
#include <asm/proc-fns.h>
#include <asm-generic/mm_hooks.h>

void __check_kvm_seq(struct mm_struct *mm);

+2 −0
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@
#ifndef __ASM_ARM_MMU_CONTEXT_H
#define __ASM_ARM_MMU_CONTEXT_H

#include <asm-generic/mm_hooks.h>

#define init_new_context(tsk,mm)	0
#define destroy_context(mm)		do { } while(0)

+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <asm/tlbflush.h>
#include <asm/pgalloc.h>
#include <asm/sysreg.h>
#include <asm-generic/mm_hooks.h>

/*
 * The MMU "context" consists of two things:
Loading