From 3067e628b29d9bbe831b41f18f342f853aa5db88 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Tue, 15 Apr 2003 17:09:30 +0000 Subject: bitkeeper revision 1.165.1.1 (3e9c3ccaCJe7Z8jxplsENPEQ5oFIFw) Many files: Partial checkin of virtualised LDT support. --- xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/process.c') 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 -- cgit v1.2.3