lkml.org 
[lkml]   [1999]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 2.3.11 breaks wine


On Sun, 25 Jul 1999, Oliver Neukum wrote:

> Hi list,
>
> i would like to report that 2.3.11 breaks wine. It segfaults immediatly.
> However, strangely, this is not the case, if wine is straced.
> This is beyond me (in the depths of i386)

Very likely to happen. No promises, but try 2.3.12-pre2 + attached patch.
LDT hadling is in the flux right now, so... Details are more than welcome
- try to force the coredump and look at the stack trace (bt in gdb). That
may help.
diff -urN linux-2.3.12-pre2/arch/arm/mm/fault-armo.c linux-bird.mm/arch/arm/mm/fault-armo.c
--- linux-2.3.12-pre2/arch/arm/mm/fault-armo.c Mon Jun 21 12:35:50 1999
+++ linux-bird.mm/arch/arm/mm/fault-armo.c Sun Jul 25 10:53:07 1999
@@ -48,7 +48,7 @@
pgd_t *init;

if (pgd) {
- init = pgd_offset(&init_mm, 0);
+ init = pgd_offset_k(0);
memzero(pgd, USER_PTRS_PER_PGD * BYTES_PER_PTR);
memcpy(pgd + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * BYTES_PER_PTR);
diff -urN linux-2.3.12-pre2/arch/arm/mm/fault-armv.c linux-bird.mm/arch/arm/mm/fault-armv.c
--- linux-2.3.12-pre2/arch/arm/mm/fault-armv.c Mon Jun 21 12:35:50 1999
+++ linux-bird.mm/arch/arm/mm/fault-armv.c Sun Jul 25 10:53:07 1999
@@ -41,7 +41,7 @@
pgd_t *init;

if (pgd) {
- init = pgd_offset(&init_mm, 0);
+ init = pgd_offset_k(0);
memzero(pgd, USER_PTRS_PER_PGD * BYTES_PER_PTR);
memcpy(pgd + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * BYTES_PER_PTR);
diff -urN linux-2.3.12-pre2/arch/arm/mm/ioremap.c linux-bird.mm/arch/arm/mm/ioremap.c
--- linux-2.3.12-pre2/arch/arm/mm/ioremap.c Mon Jun 21 14:09:16 1999
+++ linux-bird.mm/arch/arm/mm/ioremap.c Sun Jul 25 10:53:07 1999
@@ -82,7 +82,7 @@
unsigned long end = address + size;

phys_addr -= address;
- dir = pgd_offset(&init_mm, address);
+ dir = pgd_offset_k(address);
flush_cache_all();
while (address < end) {
pmd_t *pmd = pmd_alloc_kernel(dir, address);
diff -urN linux-2.3.12-pre2/arch/i386/kernel/process.c linux-bird.mm/arch/i386/kernel/process.c
--- linux-2.3.12-pre2/arch/i386/kernel/process.c Sun Jul 25 09:23:21 1999
+++ linux-bird.mm/arch/i386/kernel/process.c Sun Jul 25 10:53:07 1999
@@ -510,11 +510,6 @@
__asm__ __volatile__("movl %w0,%%fs ; movl %w0,%%gs"
: /* no outputs */
: "r" (0));
-
- /*
- * Load the LDT entry of init_task.
- */
- load_LDT(&init_mm);
}

/*
@@ -597,22 +592,19 @@
/*
* default LDT - use the one from init_task
*/
- if (new_mm)
- new_mm->segments = NULL;
+ new_mm->segments = NULL;
return;
}

- if (new_mm) {
- /*
- * Completely new LDT, we initialize it from the parent:
- */
- ldt = vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE);
- if (!ldt)
- printk(KERN_WARNING "ldt allocation failed\n");
- else
- memcpy(ldt, old_ldt, LDT_ENTRIES*LDT_ENTRY_SIZE);
- new_mm->segments = ldt;
- }
+ /*
+ * Completely new LDT, we initialize it from the parent:
+ */
+ ldt = vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE);
+ if (!ldt)
+ printk(KERN_WARNING "ldt allocation failed\n");
+ else
+ memcpy(ldt, old_ldt, LDT_ENTRIES*LDT_ENTRY_SIZE);
+ new_mm->segments = ldt;
return;
}

diff -urN linux-2.3.12-pre2/arch/i386/kernel/setup.c linux-bird.mm/arch/i386/kernel/setup.c
--- linux-2.3.12-pre2/arch/i386/kernel/setup.c Sun Jul 25 09:23:21 1999
+++ linux-bird.mm/arch/i386/kernel/setup.c Sun Jul 25 10:55:14 1999
@@ -1033,6 +1033,7 @@
current->active_mm = &init_mm;
t->esp0 = current->thread.esp0;
set_tss_desc(nr,t);
+ current->thread.cr3 = t->cr3;
gdt_table[__TSS(nr)].b &= 0xfffffdff;
load_TR(nr);
load_LDT(&init_mm);
diff -urN linux-2.3.12-pre2/arch/i386/kernel/traps.c linux-bird.mm/arch/i386/kernel/traps.c
--- linux-2.3.12-pre2/arch/i386/kernel/traps.c Wed Jul 21 21:10:40 1999
+++ linux-bird.mm/arch/i386/kernel/traps.c Sun Jul 25 10:53:07 1999
@@ -493,7 +493,7 @@
* move the IDT into it and write protect this page.
*/
page = (unsigned long) vmalloc(PAGE_SIZE);
- pgd = pgd_offset(&init_mm, page);
+ pgd = pgd_offset_k(page);
pmd = pmd_offset(pgd, page);
pte = pte_offset(pmd, page);
free_page(pte_page(*pte));
diff -urN linux-2.3.12-pre2/arch/i386/mm/ioremap.c linux-bird.mm/arch/i386/mm/ioremap.c
--- linux-2.3.12-pre2/arch/i386/mm/ioremap.c Mon Jun 21 13:32:10 1999
+++ linux-bird.mm/arch/i386/mm/ioremap.c Sun Jul 25 10:53:07 1999
@@ -59,7 +59,7 @@
unsigned long end = address + size;

phys_addr -= address;
- dir = pgd_offset(&init_mm, address);
+ dir = pgd_offset_k(address);
flush_cache_all();
while (address < end) {
pmd_t *pmd = pmd_alloc_kernel(dir, address);
diff -urN linux-2.3.12-pre2/arch/mips/kernel/irixelf.c linux-bird.mm/arch/mips/kernel/irixelf.c
--- linux-2.3.12-pre2/arch/mips/kernel/irixelf.c Sun Jul 25 09:23:21 1999
+++ linux-bird.mm/arch/mips/kernel/irixelf.c Sun Jul 25 10:53:08 1999
@@ -44,7 +44,7 @@

static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs);
static int load_irix_library(int fd);
-static int irix_core_dump(long signr, struct pt_regs * regs);
+static int irix_core_dump(long signr, struct pt_regs * regs, struct file * file);
extern int dump_fpu (elf_fpregset_t *);

static struct linux_binfmt irix_format = {
diff -urN linux-2.3.12-pre2/arch/ppc/mm/init.c linux-bird.mm/arch/ppc/mm/init.c
--- linux-2.3.12-pre2/arch/ppc/mm/init.c Sun Jul 25 09:23:21 1999
+++ linux-bird.mm/arch/ppc/mm/init.c Sun Jul 25 10:55:29 1999
@@ -523,7 +523,7 @@
#ifndef CONFIG_8xx
mm->context = NO_CONTEXT;
if (mm == current->mm)
- activate_context(current);
+ activate_context();
#else
asm volatile ("tlbia" : : );
#endif
diff -urN linux-2.3.12-pre2/arch/sparc/mm/io-unit.c linux-bird.mm/arch/sparc/mm/io-unit.c
--- linux-2.3.12-pre2/arch/sparc/mm/io-unit.c Mon Jun 21 12:36:02 1999
+++ linux-bird.mm/arch/sparc/mm/io-unit.c Sun Jul 25 10:53:08 1999
@@ -184,7 +184,7 @@
pte_t *ptep;
long i;

- pgdp = pgd_offset(init_task.mm, addr);
+ pgdp = pgd_offset_k(addr);
pmdp = pmd_offset(pgdp, addr);
ptep = pte_offset(pmdp, addr);

diff -urN linux-2.3.12-pre2/arch/sparc/mm/iommu.c linux-bird.mm/arch/sparc/mm/iommu.c
--- linux-2.3.12-pre2/arch/sparc/mm/iommu.c Mon Jun 21 12:36:02 1999
+++ linux-bird.mm/arch/sparc/mm/iommu.c Sun Jul 25 10:53:08 1999
@@ -225,7 +225,7 @@
pmd_t *pmdp;
pte_t *ptep;

- pgdp = pgd_offset(init_task.mm, addr);
+ pgdp = pgd_offset_k(addr);
pmdp = pmd_offset(pgdp, addr);
ptep = pte_offset(pmdp, addr);

diff -urN linux-2.3.12-pre2/arch/sparc/mm/srmmu.c linux-bird.mm/arch/sparc/mm/srmmu.c
--- linux-2.3.12-pre2/arch/sparc/mm/srmmu.c Sun Jul 25 09:23:21 1999
+++ linux-bird.mm/arch/sparc/mm/srmmu.c Sun Jul 25 10:55:33 1999
@@ -542,7 +542,7 @@

ret = (pgd_t *)__get_free_page(GFP_KERNEL);
if (ret) {
- pgd_t *init = pgd_offset(&init_mm, 0);
+ pgd_t *init = pgd_offset_k(0);
memset(ret + (0 * PTRS_PER_PGD), 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
memcpy(ret + (0 * PTRS_PER_PGD) + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
diff -urN linux-2.3.12-pre2/arch/sparc/mm/sun4c.c linux-bird.mm/arch/sparc/mm/sun4c.c
--- linux-2.3.12-pre2/arch/sparc/mm/sun4c.c Sun Jul 25 09:23:21 1999
+++ linux-bird.mm/arch/sparc/mm/sun4c.c Sun Jul 25 10:55:33 1999
@@ -2536,7 +2536,7 @@

ret = (unsigned long *)__get_free_page(GFP_KERNEL);
memset (ret, 0, (KERNBASE / SUN4C_PGDIR_SIZE) * sizeof(pgd_t));
- init = pgd_offset(&init_mm, 0);
+ init = pgd_offset_k(0);
memcpy (((pgd_t *)ret) + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
}
diff -urN linux-2.3.12-pre2/arch/sparc64/kernel/binfmt_aout32.c linux-bird.mm/arch/sparc64/kernel/binfmt_aout32.c
--- linux-2.3.12-pre2/arch/sparc64/kernel/binfmt_aout32.c Sun Jul 25 09:23:21 1999
+++ linux-bird.mm/arch/sparc64/kernel/binfmt_aout32.c Sun Jul 25 10:53:08 1999
@@ -34,7 +34,7 @@

static int load_aout32_binary(struct linux_binprm *, struct pt_regs * regs);
static int load_aout32_library(int fd);
-static int aout32_core_dump(long signr, struct pt_regs * regs);
+static int aout32_core_dump(long signr, struct pt_regs * regs, struct file *file);

extern void dump_thread(struct pt_regs *, struct user *);

diff -urN linux-2.3.12-pre2/arch/sparc64/kernel/process.c linux-bird.mm/arch/sparc64/kernel/process.c
--- linux-2.3.12-pre2/arch/sparc64/kernel/process.c Wed Jun 30 17:06:44 1999
+++ linux-bird.mm/arch/sparc64/kernel/process.c Sun Jul 25 10:53:08 1999
@@ -442,7 +442,7 @@
/* exec_mmap() set context to NO_CONTEXT, here is
* where we grab a new one.
*/
- activate_context(current);
+ activate_context();
}
if (current->tss.flags & SPARC_FLAG_32BIT)
__asm__ __volatile__("stxa %%g0, [%0] %1"
diff -urN linux-2.3.12-pre2/arch/sparc64/mm/init.c linux-bird.mm/arch/sparc64/mm/init.c
--- linux-2.3.12-pre2/arch/sparc64/mm/init.c Wed Jun 30 17:06:49 1999
+++ linux-bird.mm/arch/sparc64/mm/init.c Sun Jul 25 10:53:08 1999
@@ -386,7 +386,7 @@
dvma_pages_current_offset;

/* Map the CPU's view. */
- pgdp = pgd_offset(init_task.mm, addr);
+ pgdp = pgd_offset_k(addr);
pmdp = pmd_alloc_kernel(pgdp, addr);
ptep = pte_alloc_kernel(pmdp, addr);
pte = mk_pte(the_page, PAGE_KERNEL);
@@ -677,7 +677,7 @@
for (vaddr = trans[i].virt;
vaddr < trans[i].virt + trans[i].size;
vaddr += PAGE_SIZE) {
- pgdp = pgd_offset(init_task.mm, vaddr);
+ pgdp = pgd_offset_k(vaddr);
if (pgd_none(*pgdp)) {
pmdp = sparc_init_alloc(&mempool,
PMD_TABLE_SIZE);
@@ -1049,7 +1049,7 @@
pte_t *ptep;

while (start < end) {
- pgdp = pgd_offset(init_task.mm, start);
+ pgdp = pgd_offset_k(start);
if (pgd_none(*pgdp)) {
pmdp = sparc_init_alloc(&mempool, PAGE_SIZE);
memset(pmdp, 0, PAGE_SIZE);
@@ -1073,7 +1073,7 @@
void sparc_ultra_mapioaddr(unsigned long physaddr, unsigned long virt_addr,
int bus, int rdonly)
{
- pgd_t *pgdp = pgd_offset(init_task.mm, virt_addr);
+ pgd_t *pgdp = pgd_offset_k(virt_addr);
pmd_t *pmdp = pmd_offset(pgdp, virt_addr);
pte_t *ptep = pte_offset(pmdp, virt_addr);
pte_t pte;
@@ -1095,7 +1095,7 @@
pmd_t *pmdp;
pte_t *ptep;

- pgdp = pgd_offset(init_task.mm, virt_addr);
+ pgdp = pgd_offset_k(virt_addr);
pmdp = pmd_offset(pgdp, virt_addr);
ptep = pte_offset(pmdp, virt_addr);

diff -urN linux-2.3.12-pre2/fs/exec.c linux-bird.mm/fs/exec.c
--- linux-2.3.12-pre2/fs/exec.c Sun Jul 25 09:23:23 1999
+++ linux-bird.mm/fs/exec.c Sun Jul 25 10:53:09 1999
@@ -371,6 +371,7 @@
if (old_mm && atomic_read(&old_mm->mm_users) == 1) {
flush_cache_mm(old_mm);
mm_release();
+ forget_segments();
release_segments(old_mm);
exit_mmap(old_mm);
flush_tlb_mm(old_mm);
@@ -379,25 +380,21 @@

mm = mm_alloc();
if (mm) {
+ struct mm_struct *active_mm = current->active_mm;
mm->cpu_vm_mask = (1UL << smp_processor_id());
mm->total_vm = 0;
mm->rss = 0;
- mm->pgd = pgd_alloc();
- if (mm->pgd) {
- struct mm_struct *active_mm = current->active_mm;
-
- current->mm = mm;
- current->active_mm = mm;
- activate_context();
- mm_release();
- if (old_mm) {
- mmput(old_mm);
- return 0;
- }
- mmdrop(active_mm);
+ current->mm = mm;
+ current->active_mm = mm;
+ forget_segments();
+ activate_context();
+ mm_release();
+ if (old_mm) {
+ mmput(old_mm);
return 0;
}
- kmem_cache_free(mm_cachep, mm);
+ mmdrop(active_mm);
+ return 0;
}
return -ENOMEM;
}
diff -urN linux-2.3.12-pre2/include/asm-alpha/mmu_context.h linux-bird.mm/include/asm-alpha/mmu_context.h
--- linux-2.3.12-pre2/include/asm-alpha/mmu_context.h Wed Jul 21 21:10:46 1999
+++ linux-bird.mm/include/asm-alpha/mmu_context.h Sun Jul 25 10:53:09 1999
@@ -212,10 +212,10 @@
*/

extern inline void
-activate_context(struct task_struct *task)
+activate_context(void)
{
- get_new_mmu_context(task, task->mm);
- reload_context(task);
+ get_new_mmu_context(current, current->mm);
+ reload_context(current);
}

#endif /* __ALPHA_MMU_CONTEXT_H */
diff -urN linux-2.3.12-pre2/include/asm-alpha/pgtable.h linux-bird.mm/include/asm-alpha/pgtable.h
--- linux-2.3.12-pre2/include/asm-alpha/pgtable.h Wed Jul 21 21:10:46 1999
+++ linux-bird.mm/include/asm-alpha/pgtable.h Sun Jul 25 10:53:09 1999
@@ -458,7 +458,7 @@
pgd_t *ret = (pgd_t *)__get_free_page(GFP_KERNEL), *init;

if (ret) {
- init = pgd_offset(&init_mm, 0);
+ init = pgd_offset_k(0);
memset (ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
diff -urN linux-2.3.12-pre2/include/asm-arm/mmu_context.h linux-bird.mm/include/asm-arm/mmu_context.h
--- linux-2.3.12-pre2/include/asm-arm/mmu_context.h Mon Jun 21 12:36:50 1999
+++ linux-bird.mm/include/asm-arm/mmu_context.h Sun Jul 25 10:53:09 1999
@@ -13,6 +13,6 @@

#define init_new_context(mm) do { } while(0)
#define destroy_context(mm) do { } while(0)
-#define activate_context(tsk) do { } while(0)
+#define activate_context() do { } while(0)

#endif
diff -urN linux-2.3.12-pre2/include/asm-i386/mmu_context.h linux-bird.mm/include/asm-i386/mmu_context.h
--- linux-2.3.12-pre2/include/asm-i386/mmu_context.h Sun Jul 25 09:23:23 1999
+++ linux-bird.mm/include/asm-i386/mmu_context.h Sun Jul 25 10:53:09 1999
@@ -26,12 +26,13 @@
static inline void activate_context(void)
{
struct task_struct *tsk = current;
- struct mm_struct *mm = tsk->mm;
+ struct mm_struct *mm = tsk->active_mm;
unsigned long cr3;

load_LDT(mm);
cr3 = __pa(mm->pgd);
tsk->thread.cr3 = cr3;
+ init_tss[smp_processor_id()].cr3 = cr3;
__asm__ __volatile__("movl %0,%%cr3": :"r" (cr3));
}

diff -urN linux-2.3.12-pre2/include/asm-i386/pgtable.h linux-bird.mm/include/asm-i386/pgtable.h
--- linux-2.3.12-pre2/include/asm-i386/pgtable.h Sun Jul 25 09:23:23 1999
+++ linux-bird.mm/include/asm-i386/pgtable.h Sun Jul 25 10:53:09 1999
@@ -395,7 +395,7 @@
pgd_t *ret = (pgd_t *)__get_free_page(GFP_KERNEL), *init;

if (ret) {
- init = pgd_offset(&init_mm, 0);
+ init = pgd_offset_k(0);
memset (ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
diff -urN linux-2.3.12-pre2/include/asm-m68k/mmu_context.h linux-bird.mm/include/asm-m68k/mmu_context.h
--- linux-2.3.12-pre2/include/asm-m68k/mmu_context.h Mon Jun 21 12:36:53 1999
+++ linux-bird.mm/include/asm-m68k/mmu_context.h Sun Jul 25 10:53:09 1999
@@ -8,6 +8,6 @@

#define init_new_context(mm) do { } while(0)
#define destroy_context(mm) do { } while(0)
-#define activate_context(tsk) do { } while(0)
+#define activate_context() do { } while(0)

#endif
diff -urN linux-2.3.12-pre2/include/asm-mips/mmu_context.h linux-bird.mm/include/asm-mips/mmu_context.h
--- linux-2.3.12-pre2/include/asm-mips/mmu_context.h Mon Jun 21 12:36:53 1999
+++ linux-bird.mm/include/asm-mips/mmu_context.h Sun Jul 25 10:53:09 1999
@@ -99,10 +99,10 @@
* After we have set current->mm to a new value, this activates
* the context for the new mm so we see the new mappings.
*/
-extern inline void activate_context(struct task_struct *tsk)
+extern inline void activate_context(void)
{
- get_mmu_context(tsk);
- set_entryhi(tsk->mm->context);
+ get_mmu_context(current);
+ set_entryhi(current->mm->context);
}

extern void __asid_setup(unsigned int inc, unsigned int mask,
diff -urN linux-2.3.12-pre2/include/asm-mips/pgtable.h linux-bird.mm/include/asm-mips/pgtable.h
--- linux-2.3.12-pre2/include/asm-mips/pgtable.h Sat Jun 26 16:43:27 1999
+++ linux-bird.mm/include/asm-mips/pgtable.h Sun Jul 25 10:53:09 1999
@@ -407,7 +407,7 @@
pgd_t *ret = (pgd_t *)__get_free_page(GFP_KERNEL), *init;

if (ret) {
- init = pgd_offset(&init_mm, 0);
+ init = pgd_offset_k(0);
pgd_init((unsigned long)ret);
memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
diff -urN linux-2.3.12-pre2/include/asm-ppc/mmu_context.h linux-bird.mm/include/asm-ppc/mmu_context.h
--- linux-2.3.12-pre2/include/asm-ppc/mmu_context.h Mon Jun 21 12:36:54 1999
+++ linux-bird.mm/include/asm-ppc/mmu_context.h Sun Jul 25 10:53:09 1999
@@ -74,10 +74,10 @@
* After we have set current->mm to a new value, this activates
* the context for the new mm so we see the new mappings.
*/
-extern inline void activate_context(struct task_struct *tsk)
+extern inline void activate_context(void)
{
- get_mmu_context(tsk);
- set_context(tsk->mm->context);
+ get_mmu_context(current);
+ set_context(current->mm->context);
}

/*
diff -urN linux-2.3.12-pre2/include/asm-ppc/pgtable.h linux-bird.mm/include/asm-ppc/pgtable.h
--- linux-2.3.12-pre2/include/asm-ppc/pgtable.h Sat Jun 26 16:43:31 1999
+++ linux-bird.mm/include/asm-ppc/pgtable.h Sun Jul 25 10:53:09 1999
@@ -422,7 +422,7 @@
memset (ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
}
if (ret) {
- init = pgd_offset(&init_mm, 0);
+ init = pgd_offset_k(0);
/*memset (ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));*/
memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
diff -urN linux-2.3.12-pre2/include/asm-sparc/mmu_context.h linux-bird.mm/include/asm-sparc/mmu_context.h
--- linux-2.3.12-pre2/include/asm-sparc/mmu_context.h Mon Jun 21 12:36:56 1999
+++ linux-bird.mm/include/asm-sparc/mmu_context.h Sun Jul 25 10:53:09 1999
@@ -25,6 +25,6 @@
/* This need not do anything on Sparc32. The switch happens
* properly later as a side effect of calling flush_thread.
*/
-#define activate_context(tsk) do { } while(0)
+#define activate_context() do { } while(0)

#endif /* !(__SPARC_MMU_CONTEXT_H) */
diff -urN linux-2.3.12-pre2/include/asm-sparc/processor.h linux-bird.mm/include/asm-sparc/processor.h
--- linux-2.3.12-pre2/include/asm-sparc/processor.h Mon Jun 21 13:17:35 1999
+++ linux-bird.mm/include/asm-sparc/processor.h Sun Jul 25 10:53:09 1999
@@ -154,7 +154,7 @@
extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);


-#define copy_segments(__nr, __tsk, __mm) \
+#define copy_segments(__tsk, __mm) \
if((__tsk) == current && \
(__mm) != NULL) \
flush_user_windows()
diff -urN linux-2.3.12-pre2/include/asm-sparc64/mmu_context.h linux-bird.mm/include/asm-sparc64/mmu_context.h
--- linux-2.3.12-pre2/include/asm-sparc64/mmu_context.h Mon Jun 21 13:17:39 1999
+++ linux-bird.mm/include/asm-sparc64/mmu_context.h Sun Jul 25 10:53:09 1999
@@ -118,11 +118,11 @@
* the new context above, then we set it to the current cpu so the
* smp tlb flush routines do not get confused.
*/
-#define activate_context(__tsk) \
+#define activate_context() \
do { flushw_user(); \
- (__tsk)->mm->cpu_vm_mask = 0; \
- __get_mmu_context(__tsk); \
- (__tsk)->mm->cpu_vm_mask = (1UL<<smp_processor_id()); \
+ (current)->mm->cpu_vm_mask = 0; \
+ __get_mmu_context(current); \
+ (current)->mm->cpu_vm_mask = (1UL<<smp_processor_id()); \
} while(0)

#endif /* !(__ASSEMBLY__) */
diff -urN linux-2.3.12-pre2/kernel/exit.c linux-bird.mm/kernel/exit.c
--- linux-2.3.12-pre2/kernel/exit.c Wed Jul 21 21:10:47 1999
+++ linux-bird.mm/kernel/exit.c Sun Jul 25 10:53:09 1999
@@ -238,6 +238,7 @@
struct mm_struct * mm = tsk->mm;

if (mm) {
+ forget_segments();
mm_release();
atomic_inc(&mm->mm_count);
tsk->mm = NULL;
diff -urN linux-2.3.12-pre2/kernel/fork.c linux-bird.mm/kernel/fork.c
--- linux-2.3.12-pre2/kernel/fork.c Sun Jul 25 09:23:23 1999
+++ linux-bird.mm/kernel/fork.c Sun Jul 25 10:53:09 1999
@@ -304,8 +304,14 @@
atomic_set(&mm->mm_count, 1);
init_MUTEX(&mm->mmap_sem);
mm->page_table_lock = SPIN_LOCK_UNLOCKED;
+ mm->pgd = pgd_alloc();
+ if (!mm->pgd)
+ goto free_mm;
}
return mm;
+free_mm:
+ kmem_cache_free(mm_cachep, mm);
+ return NULL;
}

/* Please note the differences between mmput and mm_release.
@@ -324,7 +330,6 @@
void mm_release(void)
{
struct task_struct *tsk = current;
- forget_segments();
/* notify parent sleeping on vfork() */
if (tsk->flags & PF_VFORK) {
tsk->flags &= ~PF_VFORK;
@@ -390,10 +395,6 @@
tsk->mm = mm;
tsk->active_mm = mm;

- mm->pgd = pgd_alloc();
- if (!mm->pgd)
- goto free_mm;
-
/*
* child gets a private LDT (if there was an LDT in the parent)
*/
@@ -411,9 +412,6 @@
init_new_context(tsk,mm);
return 0;

-free_mm:
- kmem_cache_free(mm_cachep, mm);
- return retval;
free_pt:
mmput(mm);
fail_nomem:
diff -urN linux-2.3.12-pre2/kernel/sched.c linux-bird.mm/kernel/sched.c
--- linux-2.3.12-pre2/kernel/sched.c Wed Jul 21 21:10:47 1999
+++ linux-bird.mm/kernel/sched.c Sun Jul 25 10:53:09 1999
@@ -791,10 +791,10 @@
{
struct mm_struct *mm = next->mm;
if (!mm) {
- mm = prev->active_mm;
- set_mmu_context(prev,next);
if (next->active_mm) BUG();
+ mm = prev->active_mm;
next->active_mm = mm;
+ set_mmu_context(prev,next);
atomic_inc(&mm->mm_count);
}
}
\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.074 / U:1.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site