Displaying 14 results from an estimated 14 matches for "old_mm".
2007 Apr 18
2
[PATCH 21/21] i386 Ldt context inline
...00000000 -0800
@@ -10,9 +10,28 @@
/*
* Used for LDT copy/destruction.
*/
-int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
-void destroy_context(struct mm_struct *mm);
+static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
+{
+ struct mm_struct * old_mm;
+ int retval = 0;
+
+ memset(&mm->context, 0, sizeof(mm->context));
+ init_MUTEX(&mm->context.sem);
+ old_mm = current->mm;
+ if (old_mm && unlikely(old_mm->context.ldt)) {
+ retval = copy_ldt(&mm->context, &old_mm->context);
+ }
+ return retval;
+}...
2007 Apr 18
2
[PATCH 21/21] i386 Ldt context inline
...00000000 -0800
@@ -10,9 +10,28 @@
/*
* Used for LDT copy/destruction.
*/
-int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
-void destroy_context(struct mm_struct *mm);
+static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
+{
+ struct mm_struct * old_mm;
+ int retval = 0;
+
+ memset(&mm->context, 0, sizeof(mm->context));
+ init_MUTEX(&mm->context.sem);
+ old_mm = current->mm;
+ if (old_mm && unlikely(old_mm->context.ldt)) {
+ retval = copy_ldt(&mm->context, &old_mm->context);
+ }
+ return retval;
+}...
2007 Apr 18
0
[PATCH 12/14] i386 / Move context switch inline
...size*LDT_ENTRY_SIZE);
+ up(&old->sem);
+ return err;
}
-/*
- * we do not have to muck with descriptors here, that is
- * done in switch_mm() as needed.
- */
-int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
+void destroy_ldt(struct mm_struct *mm)
{
- struct mm_struct * old_mm;
- int retval = 0;
-
- init_MUTEX(&mm->context.sem);
+ if (mm == current->active_mm)
+ clear_LDT();
+ if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
+ vfree(mm->context.ldt);
+ else
+ kfree(mm->context.ldt);
mm->context.size = 0;
- old_mm = current->mm;
- if (old_...
2007 Apr 18
0
[PATCH 12/14] i386 / Move context switch inline
...size*LDT_ENTRY_SIZE);
+ up(&old->sem);
+ return err;
}
-/*
- * we do not have to muck with descriptors here, that is
- * done in switch_mm() as needed.
- */
-int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
+void destroy_ldt(struct mm_struct *mm)
{
- struct mm_struct * old_mm;
- int retval = 0;
-
- init_MUTEX(&mm->context.sem);
+ if (mm == current->active_mm)
+ clear_LDT();
+ if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
+ vfree(mm->context.ldt);
+ else
+ kfree(mm->context.ldt);
mm->context.size = 0;
- old_mm = current->mm;
- if (old_...
2007 Apr 18
0
[PATCH 12/12] xen-ldt
...E_SIZE)
vfree(oldldt);
else
@@ -82,6 +89,8 @@
if (err < 0)
return err;
memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
+ make_pages_readonly(new->ldt, (new->size * LDT_ENTRY_SIZE) /
+ PAGE_SIZE);
return 0;
}
@@ -94,14 +103,16 @@
struct mm_struct * old_mm;
int retval = 0;
+ memset(&mm->context, 0, sizeof(mm->context));
init_MUTEX(&mm->context.sem);
- mm->context.size = 0;
old_mm = current->mm;
if (old_mm && old_mm->context.size > 0) {
down(&old_mm->context.sem);
retval = copy_ldt(&mm-&g...
2007 Apr 18
0
[PATCH 12/12] xen-ldt
...E_SIZE)
vfree(oldldt);
else
@@ -82,6 +89,8 @@
if (err < 0)
return err;
memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
+ make_pages_readonly(new->ldt, (new->size * LDT_ENTRY_SIZE) /
+ PAGE_SIZE);
return 0;
}
@@ -94,14 +103,16 @@
struct mm_struct * old_mm;
int retval = 0;
+ memset(&mm->context, 0, sizeof(mm->context));
init_MUTEX(&mm->context.sem);
- mm->context.size = 0;
old_mm = current->mm;
if (old_mm && old_mm->context.size > 0) {
down(&old_mm->context.sem);
retval = copy_ldt(&mm-&g...
2007 Apr 18
0
[PATCH 20/21] i386 Ldt cleanups 3
...if (pages > 1)
+ vfree(ldt);
+ else
+ kfree(ldt);
+ pc->ldt_pages = 0;
+ pc->ldt = NULL;
}
-/*
- * we do not have to muck with descriptors here, that is
- * done in switch_mm() as needed.
- */
int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
struct mm_struct * old_mm;
int retval = 0;
+ memset(&mm->context, 0, sizeof(mm->context));
init_MUTEX(&mm->context.sem);
- mm->context.size = 0;
old_mm = current->mm;
- if (old_mm && old_mm->context.size > 0) {
- down(&old_mm->context.sem);
+ if (old_mm && unlikel...
2007 Apr 18
0
[PATCH 20/21] i386 Ldt cleanups 3
...if (pages > 1)
+ vfree(ldt);
+ else
+ kfree(ldt);
+ pc->ldt_pages = 0;
+ pc->ldt = NULL;
}
-/*
- * we do not have to muck with descriptors here, that is
- * done in switch_mm() as needed.
- */
int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
struct mm_struct * old_mm;
int retval = 0;
+ memset(&mm->context, 0, sizeof(mm->context));
init_MUTEX(&mm->context.sem);
- mm->context.size = 0;
old_mm = current->mm;
- if (old_mm && old_mm->context.size > 0) {
- down(&old_mm->context.sem);
+ if (old_mm && unlikel...
2007 Apr 18
2
[PATCH 12/12; UPDATED] xen-ldt
...E_SIZE)
vfree(oldldt);
else
@@ -82,6 +89,8 @@
if (err < 0)
return err;
memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
+ make_pages_readonly(new->ldt, (new->size * LDT_ENTRY_SIZE) /
+ PAGE_SIZE);
return 0;
}
@@ -94,14 +103,16 @@
struct mm_struct * old_mm;
int retval = 0;
+ memset(&mm->context, 0, sizeof(mm->context));
init_MUTEX(&mm->context.sem);
- mm->context.size = 0;
old_mm = current->mm;
if (old_mm && old_mm->context.size > 0) {
down(&old_mm->context.sem);
retval = copy_ldt(&mm-&g...
2007 Apr 18
2
[PATCH 12/12; UPDATED] xen-ldt
...E_SIZE)
vfree(oldldt);
else
@@ -82,6 +89,8 @@
if (err < 0)
return err;
memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
+ make_pages_readonly(new->ldt, (new->size * LDT_ENTRY_SIZE) /
+ PAGE_SIZE);
return 0;
}
@@ -94,14 +103,16 @@
struct mm_struct * old_mm;
int retval = 0;
+ memset(&mm->context, 0, sizeof(mm->context));
init_MUTEX(&mm->context.sem);
- mm->context.size = 0;
old_mm = current->mm;
if (old_mm && old_mm->context.size > 0) {
down(&old_mm->context.sem);
retval = copy_ldt(&mm-&g...
2007 Apr 18
0
[PATCH 14/14] i386 / Introduce hypervisor lazy pinning hooks
...ux-2.6.13/include/asm-i386/mmu_context.h 2005-08-10 17:11:40.000000000 -0700
@@ -6,6 +6,7 @@
#include <asm/atomic.h>
#include <asm/pgalloc.h>
#include <asm/tlbflush.h>
+#include <mach_mmu.h>
/*
* Used for LDT copy/destruction.
@@ -15,12 +16,14 @@
struct mm_struct * old_mm;
int retval = 0;
+ memset(&mm->context, 0, sizeof(mm->context));
init_MUTEX(&mm->context.sem);
- mm->context.size = 0;
old_mm = current->mm;
if (old_mm && unlikely(old_mm->context.size > 0)) {
retval = copy_ldt(&mm->context, &old_mm->c...
2007 Apr 18
0
[PATCH 14/14] i386 / Introduce hypervisor lazy pinning hooks
...ux-2.6.13/include/asm-i386/mmu_context.h 2005-08-10 17:11:40.000000000 -0700
@@ -6,6 +6,7 @@
#include <asm/atomic.h>
#include <asm/pgalloc.h>
#include <asm/tlbflush.h>
+#include <mach_mmu.h>
/*
* Used for LDT copy/destruction.
@@ -15,12 +16,14 @@
struct mm_struct * old_mm;
int retval = 0;
+ memset(&mm->context, 0, sizeof(mm->context));
init_MUTEX(&mm->context.sem);
- mm->context.size = 0;
old_mm = current->mm;
if (old_mm && unlikely(old_mm->context.size > 0)) {
retval = copy_ldt(&mm->context, &old_mm->c...
2007 Apr 18
2
[PATCH 3/6] i386 virtualization - Make ldt a desc struct
...3.orig/include/asm-i386/mmu_context.h 2005-08-15 11:16:59.000000000 -0700
> +++ linux-2.6.13/include/asm-i386/mmu_context.h 2005-08-15 11:19:49.000000000 -0700
> @@ -19,7 +19,7 @@
> memset(&mm->context, 0, sizeof(mm->context));
> init_MUTEX(&mm->context.sem);
> old_mm = current->mm;
> - if (old_mm && unlikely(old_mm->context.size > 0)) {
> + if (old_mm && unlikely(old_mm->context.ldt)) {
> retval = copy_ldt(&mm->context, &old_mm->context);
> }
> if (retval == 0)
> @@ -32,7 +32,7 @@
> */
>...
2007 Apr 18
2
[PATCH 3/6] i386 virtualization - Make ldt a desc struct
...3.orig/include/asm-i386/mmu_context.h 2005-08-15 11:16:59.000000000 -0700
> +++ linux-2.6.13/include/asm-i386/mmu_context.h 2005-08-15 11:19:49.000000000 -0700
> @@ -19,7 +19,7 @@
> memset(&mm->context, 0, sizeof(mm->context));
> init_MUTEX(&mm->context.sem);
> old_mm = current->mm;
> - if (old_mm && unlikely(old_mm->context.size > 0)) {
> + if (old_mm && unlikely(old_mm->context.ldt)) {
> retval = copy_ldt(&mm->context, &old_mm->context);
> }
> if (retval == 0)
> @@ -32,7 +32,7 @@
> */
>...