Correctly initialise the 2nd kernel segment, and don't

forget to actually install it in the segment register.
This may fix some of the weird panics seen when kernel VM
is heavily used.
This commit is contained in:
Peter Grehan 2004-12-29 09:41:40 +00:00
parent a4aef7f9a4
commit 22f2fe59b9
3 changed files with 9 additions and 3 deletions

View File

@ -758,7 +758,7 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend)
kernel_pmap->pm_sr[i] = EMPTY_SEGMENT;
}
kernel_pmap->pm_sr[KERNEL_SR] = KERNEL_SEGMENT;
kernel_pmap->pm_sr[KERNEL2_SR] = KERNEL_SEGMENT;
kernel_pmap->pm_sr[KERNEL2_SR] = KERNEL2_SEGMENT;
kernel_pmap->pm_active = ~0;
/*
@ -799,6 +799,8 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend)
}
__asm __volatile ("mtsr %0,%1"
:: "n"(KERNEL_SR), "r"(KERNEL_SEGMENT));
__asm __volatile ("mtsr %0,%1"
:: "n"(KERNEL2_SR), "r"(KERNEL2_SEGMENT));
__asm __volatile ("sync; mtsdr1 %0; isync"
:: "r"((u_int)pmap_pteg_table | (pmap_pteg_mask >> 10)));
tlbia();

View File

@ -758,7 +758,7 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend)
kernel_pmap->pm_sr[i] = EMPTY_SEGMENT;
}
kernel_pmap->pm_sr[KERNEL_SR] = KERNEL_SEGMENT;
kernel_pmap->pm_sr[KERNEL2_SR] = KERNEL_SEGMENT;
kernel_pmap->pm_sr[KERNEL2_SR] = KERNEL2_SEGMENT;
kernel_pmap->pm_active = ~0;
/*
@ -799,6 +799,8 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend)
}
__asm __volatile ("mtsr %0,%1"
:: "n"(KERNEL_SR), "r"(KERNEL_SEGMENT));
__asm __volatile ("mtsr %0,%1"
:: "n"(KERNEL2_SR), "r"(KERNEL2_SEGMENT));
__asm __volatile ("sync; mtsdr1 %0; isync"
:: "r"((u_int)pmap_pteg_table | (pmap_pteg_mask >> 10)));
tlbia();

View File

@ -758,7 +758,7 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend)
kernel_pmap->pm_sr[i] = EMPTY_SEGMENT;
}
kernel_pmap->pm_sr[KERNEL_SR] = KERNEL_SEGMENT;
kernel_pmap->pm_sr[KERNEL2_SR] = KERNEL_SEGMENT;
kernel_pmap->pm_sr[KERNEL2_SR] = KERNEL2_SEGMENT;
kernel_pmap->pm_active = ~0;
/*
@ -799,6 +799,8 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend)
}
__asm __volatile ("mtsr %0,%1"
:: "n"(KERNEL_SR), "r"(KERNEL_SEGMENT));
__asm __volatile ("mtsr %0,%1"
:: "n"(KERNEL2_SR), "r"(KERNEL2_SEGMENT));
__asm __volatile ("sync; mtsdr1 %0; isync"
:: "r"((u_int)pmap_pteg_table | (pmap_pteg_mask >> 10)));
tlbia();