Displaying 14 results from an estimated 14 matches for "copy_ldt".
Did you mean:
copy_gdt
2007 Apr 18
0
[PATCH 12/14] i386 / Move context switch inline
...hat the process context has an LDT to deal with.
Now the code in ldt.c is called only when actually dealing with LDT
creation or destruction. Careful analysis of alloc_ldt function showed
that by using two const parameters, huge amounts of dead code would be
eliminated, allowing it to inline into copy_ldt. This results in just
better assembly code everywhere, and saves 118 bytes of space in my
compilation - even with a lesser gcc (3.2.2).
Less importantly, it puts the context code in mmu_context.h, which is
just cleaner and helps make some later hypervisor diffs more readable.
Patch-against: 2.6....
2007 Apr 18
0
[PATCH 12/14] i386 / Move context switch inline
...hat the process context has an LDT to deal with.
Now the code in ldt.c is called only when actually dealing with LDT
creation or destruction. Careful analysis of alloc_ldt function showed
that by using two const parameters, huge amounts of dead code would be
eliminated, allowing it to inline into copy_ldt. This results in just
better assembly code everywhere, and saves 118 bytes of space in my
compilation - even with a lesser gcc (3.2.2).
Less importantly, it puts the context code in mmu_context.h, which is
just cleaner and helps make some later hypervisor diffs more readable.
Patch-against: 2.6....
2007 Apr 18
2
[PATCH 21/21] i386 Ldt context inline
...14-zach-work.orig/include/asm-i386/desc.h 2005-11-05 02:30:35.000000000 -0800
+++ linux-2.6.14-zach-work/include/asm-i386/desc.h 2005-11-05 02:32:51.000000000 -0800
@@ -271,6 +271,9 @@ static inline void restore_bios_segments
put_cpu();
}
+extern void destroy_ldt(mm_context_t *pc);
+extern int copy_ldt(mm_context_t *new, mm_context_t *old);
+
#endif /* !__ASSEMBLY__ */
#endif
Index: linux-2.6.14-zach-work/include/asm-i386/mmu_context.h
===================================================================
--- linux-2.6.14-zach-work.orig/include/asm-i386/mmu_context.h 2005-11-05 02:30:35.00000000...
2007 Apr 18
2
[PATCH 21/21] i386 Ldt context inline
...14-zach-work.orig/include/asm-i386/desc.h 2005-11-05 02:30:35.000000000 -0800
+++ linux-2.6.14-zach-work/include/asm-i386/desc.h 2005-11-05 02:32:51.000000000 -0800
@@ -271,6 +271,9 @@ static inline void restore_bios_segments
put_cpu();
}
+extern void destroy_ldt(mm_context_t *pc);
+extern int copy_ldt(mm_context_t *new, mm_context_t *old);
+
#endif /* !__ASSEMBLY__ */
#endif
Index: linux-2.6.14-zach-work/include/asm-i386/mmu_context.h
===================================================================
--- linux-2.6.14-zach-work.orig/include/asm-i386/mmu_context.h 2005-11-05 02:30:35.00000000...
2007 Apr 18
0
[PATCH 20/21] i386 Ldt cleanups 3
...(mm_context_t *pc, i
load_LDT(pc);
#endif
}
- if (oldsize) {
- if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE)
+ if (old_pages) {
+ if (old_pages > 1)
vfree(oldldt);
else
kfree(oldldt);
@@ -76,31 +76,43 @@ static int alloc_ldt(mm_context_t *pc, i
return 0;
}
-static inline int copy_ldt(mm_context_t *new, mm_context_t *old)
+int copy_ldt(mm_context_t *new, mm_context_t *old)
{
- int err = alloc_ldt(new, old->size, 0);
- if (err < 0)
- return err;
- memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
- return 0;
+ int err;
+
+ down(&old->sem);
+ err = allo...
2007 Apr 18
0
[PATCH 20/21] i386 Ldt cleanups 3
...(mm_context_t *pc, i
load_LDT(pc);
#endif
}
- if (oldsize) {
- if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE)
+ if (old_pages) {
+ if (old_pages > 1)
vfree(oldldt);
else
kfree(oldldt);
@@ -76,31 +76,43 @@ static int alloc_ldt(mm_context_t *pc, i
return 0;
}
-static inline int copy_ldt(mm_context_t *new, mm_context_t *old)
+int copy_ldt(mm_context_t *new, mm_context_t *old)
{
- int err = alloc_ldt(new, old->size, 0);
- if (err < 0)
- return err;
- memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
- return 0;
+ int err;
+
+ down(&old->sem);
+ err = allo...
2007 Apr 18
0
[PATCH 14/14] i386 / Introduce hypervisor lazy pinning hooks
...@@ -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->context);
}
+ if (retval == 0)
+ add_lazy_mm(mm);
return retval;
}
@@ -31,6 +34,7 @@
{
if (unlikely(mm->context.size))
destroy_ldt(mm);
+ del_lazy_mm(mm);
}
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
Ind...
2007 Apr 18
0
[PATCH 14/14] i386 / Introduce hypervisor lazy pinning hooks
...@@ -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->context);
}
+ if (retval == 0)
+ add_lazy_mm(mm);
return retval;
}
@@ -31,6 +34,7 @@
{
if (unlikely(mm->context.size))
destroy_ldt(mm);
+ del_lazy_mm(mm);
}
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
Ind...
2007 Apr 18
0
[PATCH 12/12] xen-ldt
...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->context, &old_mm->context);
up(&old_mm->context.sem);
}
+ if (retval == 0)
+ add_context_to_unpinned(mm);
return retval;
}
@@ -113,12 +124,16 @@
if (mm->context.size) {
if (mm == current->active_mm)
clear_LDT();
+ make_pages_writable(mm->conte...
2007 Apr 18
0
[PATCH 12/12] xen-ldt
...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->context, &old_mm->context);
up(&old_mm->context.sem);
}
+ if (retval == 0)
+ add_context_to_unpinned(mm);
return retval;
}
@@ -113,12 +124,16 @@
if (mm->context.size) {
if (mm == current->active_mm)
clear_LDT();
+ make_pages_writable(mm->conte...
2007 Apr 18
2
[PATCH 12/12; UPDATED] xen-ldt
...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->context, &old_mm->context);
up(&old_mm->context.sem);
}
+ if (retval == 0)
+ add_context_to_unpinned(mm);
return retval;
}
@@ -113,12 +124,16 @@
if (mm->context.size) {
if (mm == current->active_mm)
clear_LDT();
+ make_pages_writable(mm->conte...
2007 Apr 18
2
[PATCH 12/12; UPDATED] xen-ldt
...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->context, &old_mm->context);
up(&old_mm->context.sem);
}
+ if (retval == 0)
+ add_context_to_unpinned(mm);
return retval;
}
@@ -113,12 +124,16 @@
if (mm->context.size) {
if (mm == current->active_mm)
clear_LDT();
+ make_pages_writable(mm->conte...
2007 Apr 18
2
[PATCH 3/6] i386 virtualization - Make ldt a desc struct
...,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 @@
> */
> static inline void destroy_context(struct mm_struct *mm)
> {
> - if (unlikely(mm->context.size))
> + if (unlikely(mm->context.ldt))
> destroy_ldt(mm);
>...
2007 Apr 18
2
[PATCH 3/6] i386 virtualization - Make ldt a desc struct
...,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 @@
> */
> static inline void destroy_context(struct mm_struct *mm)
> {
> - if (unlikely(mm->context.size))
> + if (unlikely(mm->context.ldt))
> destroy_ldt(mm);
>...