aboutsummaryrefslogtreecommitdiffstats
path: root/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2003-04-15 17:09:30 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2003-04-15 17:09:30 +0000
commit3067e628b29d9bbe831b41f18f342f853aa5db88 (patch)
treecbe69f0fed531fac4a6a18a99441c6f0efa97031 /xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c
parent97c4f6c00218c8cf74f75a8466c4254cdfba160b (diff)
downloadxen-3067e628b29d9bbe831b41f18f342f853aa5db88.tar.gz
xen-3067e628b29d9bbe831b41f18f342f853aa5db88.tar.bz2
xen-3067e628b29d9bbe831b41f18f342f853aa5db88.zip
bitkeeper revision 1.165.1.1 (3e9c3ccaCJe7Z8jxplsENPEQ5oFIFw)
Many files: Partial checkin of virtualised LDT support.
Diffstat (limited to 'xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c')
-rw-r--r--xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c
index 32ce1a66ab..4dc1273c7b 100644
--- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c
+++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c
@@ -140,6 +140,8 @@ void release_segments(struct mm_struct *mm)
if (ldt) {
mm->context.segments = NULL;
clear_LDT();
+ make_pages_writeable(ldt, (LDT_ENTRIES*LDT_ENTRY_SIZE)/PAGE_SIZE);
+ flush_page_update_queue();
vfree(ldt);
}
}
@@ -225,10 +227,15 @@ void copy_segments(struct task_struct *p, struct mm_struct *new_mm)
* Completely new LDT, we initialize it from the parent:
*/
ldt = vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE);
- if (!ldt)
+ if ( ldt == NULL )
+ {
printk(KERN_WARNING "ldt allocation failed\n");
+ }
else
+ {
memcpy(ldt, old_ldt, LDT_ENTRIES*LDT_ENTRY_SIZE);
+ make_pages_readonly(ldt, (LDT_ENTRIES*LDT_ENTRY_SIZE)/PAGE_SIZE);
+ }
}
new_mm->context.segments = ldt;
new_mm->context.cpuvalid = ~0UL; /* valid on all CPU's - they can't have stale data */
@@ -335,6 +342,10 @@ void __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
struct thread_struct *prev = &prev_p->thread,
*next = &next_p->thread;
+ __cli();
+
+ MULTICALL_flush_page_update_queue();
+
/*
* This is basically 'unlazy_fpu', except that we queue a multicall to
* indicate FPU task switch, rather than synchronously trapping to Xen.
@@ -356,7 +367,7 @@ void __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
/* EXECUTE ALL TASK SWITCH XEN SYSCALLS AT THIS POINT. */
execute_multicall_list();
- sti(); /* matches 'cli' in switch_mm() */
+ __sti();
/*
* Save away %fs and %gs. No need to save %es and %ds, as