init.c (9195481d2f869a2707a272057f3f8664fd277534) init.c (c376222960ae91d5ffb9197ee36771aaed1d9f90)
1/*
2 * Initialize MMU support.
3 *
4 * Copyright (C) 1998-2003 Hewlett-Packard Co
5 * David Mosberger-Tang <davidm@hpl.hp.com>
6 */
7#include <linux/kernel.h>
8#include <linux/init.h>

--- 162 unchanged lines hidden (view full) ---

171
172 ia64_set_rbs_bot();
173
174 /*
175 * If we're out of memory and kmem_cache_alloc() returns NULL, we simply ignore
176 * the problem. When the process attempts to write to the register backing store
177 * for the first time, it will get a SEGFAULT in this case.
178 */
1/*
2 * Initialize MMU support.
3 *
4 * Copyright (C) 1998-2003 Hewlett-Packard Co
5 * David Mosberger-Tang <davidm@hpl.hp.com>
6 */
7#include <linux/kernel.h>
8#include <linux/init.h>

--- 162 unchanged lines hidden (view full) ---

171
172 ia64_set_rbs_bot();
173
174 /*
175 * If we're out of memory and kmem_cache_alloc() returns NULL, we simply ignore
176 * the problem. When the process attempts to write to the register backing store
177 * for the first time, it will get a SEGFAULT in this case.
178 */
179 vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
179 vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
180 if (vma) {
180 if (vma) {
181 memset(vma, 0, sizeof(*vma));
182 vma->vm_mm = current->mm;
183 vma->vm_start = current->thread.rbs_bot & PAGE_MASK;
184 vma->vm_end = vma->vm_start + PAGE_SIZE;
185 vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7];
186 vma->vm_flags = VM_DATA_DEFAULT_FLAGS|VM_GROWSUP|VM_ACCOUNT;
187 down_write(&current->mm->mmap_sem);
188 if (insert_vm_struct(current->mm, vma)) {
189 up_write(&current->mm->mmap_sem);
190 kmem_cache_free(vm_area_cachep, vma);
191 return;
192 }
193 up_write(&current->mm->mmap_sem);
194 }
195
196 /* map NaT-page at address zero to speed up speculative dereferencing of NULL: */
197 if (!(current->personality & MMAP_PAGE_ZERO)) {
181 vma->vm_mm = current->mm;
182 vma->vm_start = current->thread.rbs_bot & PAGE_MASK;
183 vma->vm_end = vma->vm_start + PAGE_SIZE;
184 vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7];
185 vma->vm_flags = VM_DATA_DEFAULT_FLAGS|VM_GROWSUP|VM_ACCOUNT;
186 down_write(&current->mm->mmap_sem);
187 if (insert_vm_struct(current->mm, vma)) {
188 up_write(&current->mm->mmap_sem);
189 kmem_cache_free(vm_area_cachep, vma);
190 return;
191 }
192 up_write(&current->mm->mmap_sem);
193 }
194
195 /* map NaT-page at address zero to speed up speculative dereferencing of NULL: */
196 if (!(current->personality & MMAP_PAGE_ZERO)) {
198 vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
197 vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
199 if (vma) {
198 if (vma) {
200 memset(vma, 0, sizeof(*vma));
201 vma->vm_mm = current->mm;
202 vma->vm_end = PAGE_SIZE;
203 vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT);
204 vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO | VM_RESERVED;
205 down_write(&current->mm->mmap_sem);
206 if (insert_vm_struct(current->mm, vma)) {
207 up_write(&current->mm->mmap_sem);
208 kmem_cache_free(vm_area_cachep, vma);

--- 568 unchanged lines hidden ---
199 vma->vm_mm = current->mm;
200 vma->vm_end = PAGE_SIZE;
201 vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT);
202 vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO | VM_RESERVED;
203 down_write(&current->mm->mmap_sem);
204 if (insert_vm_struct(current->mm, vma)) {
205 up_write(&current->mm->mmap_sem);
206 kmem_cache_free(vm_area_cachep, vma);

--- 568 unchanged lines hidden ---