Displaying 20 results from an estimated 35 matches for "clear_ldt".
Did you mean:
clear_bit
2007 Apr 18
0
[RFC/PATCH PV_OPS X86_64 07/17] paravirt_ops - descriptor changes.
...art/include/asm-x86_64/desc.h
@@ -16,9 +16,8 @@
extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
-#define load_TR_desc() asm volatile("ltr %w0"::"r" (GDT_ENTRY_TSS*8))
-#define load_LDT_desc() asm volatile("lldt %w0"::"r" (GDT_ENTRY_LDT*8))
-#define clear_LDT() asm volatile("lldt %w0"::"r" (0))
+/* the cpu gdt accessor */
+#define cpu_gdt(_cpu) ((struct desc_struct *)cpu_gdt_descr[_cpu].address)
/*
* This is the ldt that every process will get unless we need
@@ -28,8 +27,6 @@ extern struct desc_struct default_ldt[];
extern str...
2007 Apr 18
0
[RFC/PATCH PV_OPS X86_64 07/17] paravirt_ops - descriptor changes.
...art/include/asm-x86_64/desc.h
@@ -16,9 +16,8 @@
extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
-#define load_TR_desc() asm volatile("ltr %w0"::"r" (GDT_ENTRY_TSS*8))
-#define load_LDT_desc() asm volatile("lldt %w0"::"r" (GDT_ENTRY_LDT*8))
-#define clear_LDT() asm volatile("lldt %w0"::"r" (0))
+/* the cpu gdt accessor */
+#define cpu_gdt(_cpu) ((struct desc_struct *)cpu_gdt_descr[_cpu].address)
/*
* This is the ldt that every process will get unless we need
@@ -28,8 +27,6 @@ extern struct desc_struct default_ldt[];
extern str...
2007 Apr 18
0
[PATCH 20/21] i386 Ldt cleanups 3
...pages, 0);
+ if (!err)
+ memcpy(new->ldt, old->ldt, old->ldt_pages*PAGE_SIZE);
+ up(&old->sem);
+ return err;
+}
+
+void destroy_ldt(mm_context_t *pc)
+{
+ int pages = pc->ldt_pages;
+ struct desc_struct *ldt = pc->ldt;
+
+ if (pc == ¤t->active_mm->context)
+ clear_LDT();
+ 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_str...
2007 Apr 18
0
[PATCH 20/21] i386 Ldt cleanups 3
...pages, 0);
+ if (!err)
+ memcpy(new->ldt, old->ldt, old->ldt_pages*PAGE_SIZE);
+ up(&old->sem);
+ return err;
+}
+
+void destroy_ldt(mm_context_t *pc)
+{
+ int pages = pc->ldt_pages;
+ struct desc_struct *ldt = pc->ldt;
+
+ if (pc == ¤t->active_mm->context)
+ clear_LDT();
+ 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_str...
2007 Apr 18
0
[PATCH 12/14] i386 / Move context switch inline
...riptors 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_mm && old_mm->context.size > 0) {
- down(&old_mm->context.sem);
- retval = copy_ldt(&...
2007 Apr 18
0
[PATCH 12/14] i386 / Move context switch inline
...riptors 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_mm && old_mm->context.size > 0) {
- down(&old_mm->context.sem);
- retval = copy_ldt(&...
2007 Apr 18
0
[PATCH 3/12] tls-is-ugly
...c inline void load_TLS(struct thread_struct *t, unsigned int cpu)
{
-#define C(i) per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i]
- C(0); C(1); C(2);
-#undef C
+ memcpy(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_TLS_MIN], t->tls_array, TLS_SIZE);
}
static inline void clear_LDT(void)
2007 Apr 18
0
[PATCH 13/14] i386 / Introduce hypervisor ldt hooks
...ldt(new, 0, old->size, 0);
- if (!err)
+ if (!err) {
memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
+ SetPagesLDT(new->ldt, (new->size * LDT_ENTRY_SIZE) / PAGE_SIZE);
+ }
up(&old->sem);
return err;
}
@@ -93,6 +99,7 @@
{
if (mm == current->active_mm)
clear_LDT();
+ ClearPagesLDT(mm->context.ldt, (mm->context.size * LDT_ENTRY_SIZE) / PAGE_SIZE);
if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(mm->context.ldt);
else
Index: linux-2.6.13/include/asm-i386/mach-default/mach_pgalloc.h
================================================...
2007 Apr 18
0
[PATCH 3/12] tls-is-ugly
...c inline void load_TLS(struct thread_struct *t, unsigned int cpu)
{
-#define C(i) per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i]
- C(0); C(1); C(2);
-#undef C
+ memcpy(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_TLS_MIN], t->tls_array, TLS_SIZE);
}
static inline void clear_LDT(void)
2007 Apr 18
0
[PATCH 13/14] i386 / Introduce hypervisor ldt hooks
...ldt(new, 0, old->size, 0);
- if (!err)
+ if (!err) {
memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
+ SetPagesLDT(new->ldt, (new->size * LDT_ENTRY_SIZE) / PAGE_SIZE);
+ }
up(&old->sem);
return err;
}
@@ -93,6 +99,7 @@
{
if (mm == current->active_mm)
clear_LDT();
+ ClearPagesLDT(mm->context.ldt, (mm->context.size * LDT_ENTRY_SIZE) / PAGE_SIZE);
if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(mm->context.ldt);
else
Index: linux-2.6.13/include/asm-i386/mach-default/mach_pgalloc.h
================================================...
2007 Apr 18
0
[PATCH 12/12] xen-ldt
...mp;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->context.ldt,
+ (mm->context.size * LDT_ENTRY_SIZE) /
+ PAGE_SIZE);
if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(mm->context.ldt);
else
kfree(mm->context.ldt);
mm->context.size = 0;
}
+ del_context_from_unpinned(mm...
2007 Apr 18
0
[PATCH 12/12] xen-ldt
...mp;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->context.ldt,
+ (mm->context.size * LDT_ENTRY_SIZE) /
+ PAGE_SIZE);
if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(mm->context.ldt);
else
kfree(mm->context.ldt);
mm->context.size = 0;
}
+ del_context_from_unpinned(mm...
2007 Apr 18
2
[PATCH 3/6] i386 virtualization - Make ldt a desc struct
...ZE);
> + SetPagesLDT(new->ldt, new->ldt_pages);
> }
> up(&old->sem);
> return err;
> @@ -97,14 +96,16 @@
>
> void destroy_ldt(struct mm_struct *mm)
> {
> + int pages = mm->context.ldt_pages;
> +
> if (mm == current->active_mm)
> clear_LDT();
> - ClearPagesLDT(mm->context.ldt, (mm->context.size * LDT_ENTRY_SIZE) / PAGE_SIZE);
> - if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
> + ClearPagesLDT(mm->context.ldt, pages);
> + if (pages > 1)
> vfree(mm->context.ldt);
> else
> kfree(mm-&g...
2007 Apr 18
2
[PATCH 3/6] i386 virtualization - Make ldt a desc struct
...ZE);
> + SetPagesLDT(new->ldt, new->ldt_pages);
> }
> up(&old->sem);
> return err;
> @@ -97,14 +96,16 @@
>
> void destroy_ldt(struct mm_struct *mm)
> {
> + int pages = mm->context.ldt_pages;
> +
> if (mm == current->active_mm)
> clear_LDT();
> - ClearPagesLDT(mm->context.ldt, (mm->context.size * LDT_ENTRY_SIZE) / PAGE_SIZE);
> - if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
> + ClearPagesLDT(mm->context.ldt, pages);
> + if (pages > 1)
> vfree(mm->context.ldt);
> else
> kfree(mm-&g...
2007 Apr 18
0
[PATCH 11/12] subarch-desc
..._struct *ldt, int entry, __u32 entry_a, __u32 entry_b)
-{
- ldt[entry].a = entry_a;
- ldt[entry].b = entry_b;
-}
-
-static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
-{
- memcpy(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN], t->tls_array, TLS_SIZE);
-}
-
static inline void clear_LDT(void)
{
int cpu = get_cpu();
Index: linux-2.6.13/include/asm-i386/mach-default/mach_desc.h
===================================================================
--- linux-2.6.13.orig/include/asm-i386/mach-default/mach_desc.h 2005-08-08 15:45:27.000000000 -0700
+++ linux-2.6.13/include/asm-i386/mac...
2007 Apr 18
0
[PATCH 11/12] subarch-desc
..._struct *ldt, int entry, __u32 entry_a, __u32 entry_b)
-{
- ldt[entry].a = entry_a;
- ldt[entry].b = entry_b;
-}
-
-static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
-{
- memcpy(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN], t->tls_array, TLS_SIZE);
-}
-
static inline void clear_LDT(void)
{
int cpu = get_cpu();
Index: linux-2.6.13/include/asm-i386/mach-default/mach_desc.h
===================================================================
--- linux-2.6.13.orig/include/asm-i386/mach-default/mach_desc.h 2005-08-08 15:45:27.000000000 -0700
+++ linux-2.6.13/include/asm-i386/mac...
2007 Apr 18
2
[PATCH 12/12; UPDATED] xen-ldt
...mp;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->context.ldt,
+ (mm->context.size * LDT_ENTRY_SIZE) /
+ PAGE_SIZE);
if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(mm->context.ldt);
else
kfree(mm->context.ldt);
mm->context.size = 0;
}
+ del_context_from_unpinned(mm...
2007 Apr 18
2
[PATCH 12/12; UPDATED] xen-ldt
...mp;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->context.ldt,
+ (mm->context.size * LDT_ENTRY_SIZE) /
+ PAGE_SIZE);
if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(mm->context.ldt);
else
kfree(mm->context.ldt);
mm->context.size = 0;
}
+ del_context_from_unpinned(mm...
2007 Apr 18
0
[PATCH 7/12] gdt-accessor
...\
@@ -112,7 +114,7 @@
static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
{
- memcpy(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_TLS_MIN], t->tls_array, TLS_SIZE);
+ memcpy(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN], t->tls_array, TLS_SIZE);
}
static inline void clear_LDT(void)
Index: linux-2.6.13/arch/i386/kernel/apm.c
===================================================================
--- linux-2.6.13.orig/arch/i386/kernel/apm.c 2005-08-08 17:09:57.000000000 -0700
+++ linux-2.6.13/arch/i386/kernel/apm.c 2005-08-08 17:16:07.000000000 -0700
@@ -597,12 +597,14 @@
c...
2007 Apr 18
0
[PATCH 7/12] gdt-accessor
...\
@@ -112,7 +114,7 @@
static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
{
- memcpy(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_TLS_MIN], t->tls_array, TLS_SIZE);
+ memcpy(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN], t->tls_array, TLS_SIZE);
}
static inline void clear_LDT(void)
Index: linux-2.6.13/arch/i386/kernel/apm.c
===================================================================
--- linux-2.6.13.orig/arch/i386/kernel/apm.c 2005-08-08 17:09:57.000000000 -0700
+++ linux-2.6.13/arch/i386/kernel/apm.c 2005-08-08 17:16:07.000000000 -0700
@@ -597,12 +597,14 @@
c...