diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/ia32/sys_ia32.c | 10 | ||||
-rw-r--r-- | arch/ia64/kernel/efi.c | 36 | ||||
-rw-r--r-- | arch/ia64/kernel/perfmon.c | 11 | ||||
-rw-r--r-- | arch/ia64/kernel/setup.c | 30 | ||||
-rw-r--r-- | arch/ia64/lib/Makefile | 3 | ||||
-rw-r--r-- | arch/ia64/mm/contig.c | 5 | ||||
-rw-r--r-- | arch/ia64/mm/discontig.c | 6 |
7 files changed, 81 insertions, 20 deletions
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index d430d36ae49d..0afb4fe7c35b 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c | |||
@@ -1267,6 +1267,10 @@ sys32_getdents (unsigned int fd, struct compat_dirent __user *dirent, unsigned i | |||
1267 | struct getdents32_callback buf; | 1267 | struct getdents32_callback buf; |
1268 | int error; | 1268 | int error; |
1269 | 1269 | ||
1270 | error = -EFAULT; | ||
1271 | if (!access_ok(VERIFY_WRITE, dirent, count)) | ||
1272 | goto out; | ||
1273 | |||
1270 | error = -EBADF; | 1274 | error = -EBADF; |
1271 | file = fget(fd); | 1275 | file = fget(fd); |
1272 | if (!file) | 1276 | if (!file) |
@@ -1283,10 +1287,10 @@ sys32_getdents (unsigned int fd, struct compat_dirent __user *dirent, unsigned i | |||
1283 | error = buf.error; | 1287 | error = buf.error; |
1284 | lastdirent = buf.previous; | 1288 | lastdirent = buf.previous; |
1285 | if (lastdirent) { | 1289 | if (lastdirent) { |
1286 | error = -EINVAL; | ||
1287 | if (put_user(file->f_pos, &lastdirent->d_off)) | 1290 | if (put_user(file->f_pos, &lastdirent->d_off)) |
1288 | goto out_putf; | 1291 | error = -EFAULT; |
1289 | error = count - buf.count; | 1292 | else |
1293 | error = count - buf.count; | ||
1290 | } | 1294 | } |
1291 | 1295 | ||
1292 | out_putf: | 1296 | out_putf: |
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 772ba6fe110f..4061593e5b17 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c | |||
@@ -21,6 +21,7 @@ | |||
21 | * Skip non-WB memory and ignore empty memory ranges. | 21 | * Skip non-WB memory and ignore empty memory ranges. |
22 | */ | 22 | */ |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/bootmem.h> | ||
24 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
25 | #include <linux/init.h> | 26 | #include <linux/init.h> |
26 | #include <linux/types.h> | 27 | #include <linux/types.h> |
@@ -1009,6 +1010,11 @@ efi_memmap_init(unsigned long *s, unsigned long *e) | |||
1009 | } else | 1010 | } else |
1010 | ae = efi_md_end(md); | 1011 | ae = efi_md_end(md); |
1011 | 1012 | ||
1013 | #ifdef CONFIG_CRASH_DUMP | ||
1014 | /* saved_max_pfn should ignore max_addr= command line arg */ | ||
1015 | if (saved_max_pfn < (ae >> PAGE_SHIFT)) | ||
1016 | saved_max_pfn = (ae >> PAGE_SHIFT); | ||
1017 | #endif | ||
1012 | /* keep within max_addr= and min_addr= command line arg */ | 1018 | /* keep within max_addr= and min_addr= command line arg */ |
1013 | as = max(as, min_addr); | 1019 | as = max(as, min_addr); |
1014 | ae = min(ae, max_addr); | 1020 | ae = min(ae, max_addr); |
@@ -1177,3 +1183,33 @@ kdump_find_rsvd_region (unsigned long size, | |||
1177 | return ~0UL; | 1183 | return ~0UL; |
1178 | } | 1184 | } |
1179 | #endif | 1185 | #endif |
1186 | |||
1187 | #ifdef CONFIG_PROC_VMCORE | ||
1188 | /* locate the size find a the descriptor at a certain address */ | ||
1189 | unsigned long | ||
1190 | vmcore_find_descriptor_size (unsigned long address) | ||
1191 | { | ||
1192 | void *efi_map_start, *efi_map_end, *p; | ||
1193 | efi_memory_desc_t *md; | ||
1194 | u64 efi_desc_size; | ||
1195 | unsigned long ret = 0; | ||
1196 | |||
1197 | efi_map_start = __va(ia64_boot_param->efi_memmap); | ||
1198 | efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size; | ||
1199 | efi_desc_size = ia64_boot_param->efi_memdesc_size; | ||
1200 | |||
1201 | for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { | ||
1202 | md = p; | ||
1203 | if (efi_wb(md) && md->type == EFI_LOADER_DATA | ||
1204 | && md->phys_addr == address) { | ||
1205 | ret = efi_md_size(md); | ||
1206 | break; | ||
1207 | } | ||
1208 | } | ||
1209 | |||
1210 | if (ret == 0) | ||
1211 | printk(KERN_WARNING "Cannot locate EFI vmcore descriptor\n"); | ||
1212 | |||
1213 | return ret; | ||
1214 | } | ||
1215 | #endif | ||
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 9ddf896a137a..abc7ad035886 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -2299,7 +2299,7 @@ pfm_remap_buffer(struct vm_area_struct *vma, unsigned long buf, unsigned long ad | |||
2299 | * allocate a sampling buffer and remaps it into the user address space of the task | 2299 | * allocate a sampling buffer and remaps it into the user address space of the task |
2300 | */ | 2300 | */ |
2301 | static int | 2301 | static int |
2302 | pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned long rsize, void **user_vaddr) | 2302 | pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t *ctx, unsigned long rsize, void **user_vaddr) |
2303 | { | 2303 | { |
2304 | struct mm_struct *mm = task->mm; | 2304 | struct mm_struct *mm = task->mm; |
2305 | struct vm_area_struct *vma = NULL; | 2305 | struct vm_area_struct *vma = NULL; |
@@ -2349,6 +2349,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon | |||
2349 | * partially initialize the vma for the sampling buffer | 2349 | * partially initialize the vma for the sampling buffer |
2350 | */ | 2350 | */ |
2351 | vma->vm_mm = mm; | 2351 | vma->vm_mm = mm; |
2352 | vma->vm_file = filp; | ||
2352 | vma->vm_flags = VM_READ| VM_MAYREAD |VM_RESERVED; | 2353 | vma->vm_flags = VM_READ| VM_MAYREAD |VM_RESERVED; |
2353 | vma->vm_page_prot = PAGE_READONLY; /* XXX may need to change */ | 2354 | vma->vm_page_prot = PAGE_READONLY; /* XXX may need to change */ |
2354 | 2355 | ||
@@ -2387,6 +2388,8 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon | |||
2387 | goto error; | 2388 | goto error; |
2388 | } | 2389 | } |
2389 | 2390 | ||
2391 | get_file(filp); | ||
2392 | |||
2390 | /* | 2393 | /* |
2391 | * now insert the vma in the vm list for the process, must be | 2394 | * now insert the vma in the vm list for the process, must be |
2392 | * done with mmap lock held | 2395 | * done with mmap lock held |
@@ -2464,7 +2467,7 @@ pfarg_is_sane(struct task_struct *task, pfarg_context_t *pfx) | |||
2464 | } | 2467 | } |
2465 | 2468 | ||
2466 | static int | 2469 | static int |
2467 | pfm_setup_buffer_fmt(struct task_struct *task, pfm_context_t *ctx, unsigned int ctx_flags, | 2470 | pfm_setup_buffer_fmt(struct task_struct *task, struct file *filp, pfm_context_t *ctx, unsigned int ctx_flags, |
2468 | unsigned int cpu, pfarg_context_t *arg) | 2471 | unsigned int cpu, pfarg_context_t *arg) |
2469 | { | 2472 | { |
2470 | pfm_buffer_fmt_t *fmt = NULL; | 2473 | pfm_buffer_fmt_t *fmt = NULL; |
@@ -2505,7 +2508,7 @@ pfm_setup_buffer_fmt(struct task_struct *task, pfm_context_t *ctx, unsigned int | |||
2505 | /* | 2508 | /* |
2506 | * buffer is always remapped into the caller's address space | 2509 | * buffer is always remapped into the caller's address space |
2507 | */ | 2510 | */ |
2508 | ret = pfm_smpl_buffer_alloc(current, ctx, size, &uaddr); | 2511 | ret = pfm_smpl_buffer_alloc(current, filp, ctx, size, &uaddr); |
2509 | if (ret) goto error; | 2512 | if (ret) goto error; |
2510 | 2513 | ||
2511 | /* keep track of user address of buffer */ | 2514 | /* keep track of user address of buffer */ |
@@ -2716,7 +2719,7 @@ pfm_context_create(pfm_context_t *ctx, void *arg, int count, struct pt_regs *reg | |||
2716 | * does the user want to sample? | 2719 | * does the user want to sample? |
2717 | */ | 2720 | */ |
2718 | if (pfm_uuid_cmp(req->ctx_smpl_buf_id, pfm_null_uuid)) { | 2721 | if (pfm_uuid_cmp(req->ctx_smpl_buf_id, pfm_null_uuid)) { |
2719 | ret = pfm_setup_buffer_fmt(current, ctx, ctx_flags, 0, req); | 2722 | ret = pfm_setup_buffer_fmt(current, filp, ctx, ctx_flags, 0, req); |
2720 | if (ret) goto buffer_error; | 2723 | if (ret) goto buffer_error; |
2721 | } | 2724 | } |
2722 | 2725 | ||
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 5fa09d141ab7..7d6fe65c93f4 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -251,6 +251,12 @@ reserve_memory (void) | |||
251 | } | 251 | } |
252 | #endif | 252 | #endif |
253 | 253 | ||
254 | #ifdef CONFIG_PROC_VMCORE | ||
255 | if (reserve_elfcorehdr(&rsvd_region[n].start, | ||
256 | &rsvd_region[n].end) == 0) | ||
257 | n++; | ||
258 | #endif | ||
259 | |||
254 | efi_memmap_init(&rsvd_region[n].start, &rsvd_region[n].end); | 260 | efi_memmap_init(&rsvd_region[n].start, &rsvd_region[n].end); |
255 | n++; | 261 | n++; |
256 | 262 | ||
@@ -453,6 +459,30 @@ static int __init parse_elfcorehdr(char *arg) | |||
453 | return 0; | 459 | return 0; |
454 | } | 460 | } |
455 | early_param("elfcorehdr", parse_elfcorehdr); | 461 | early_param("elfcorehdr", parse_elfcorehdr); |
462 | |||
463 | int __init reserve_elfcorehdr(unsigned long *start, unsigned long *end) | ||
464 | { | ||
465 | unsigned long length; | ||
466 | |||
467 | /* We get the address using the kernel command line, | ||
468 | * but the size is extracted from the EFI tables. | ||
469 | * Both address and size are required for reservation | ||
470 | * to work properly. | ||
471 | */ | ||
472 | |||
473 | if (elfcorehdr_addr >= ELFCORE_ADDR_MAX) | ||
474 | return -EINVAL; | ||
475 | |||
476 | if ((length = vmcore_find_descriptor_size(elfcorehdr_addr)) == 0) { | ||
477 | elfcorehdr_addr = ELFCORE_ADDR_MAX; | ||
478 | return -EINVAL; | ||
479 | } | ||
480 | |||
481 | *start = (unsigned long)__va(elfcorehdr_addr); | ||
482 | *end = *start + length; | ||
483 | return 0; | ||
484 | } | ||
485 | |||
456 | #endif /* CONFIG_PROC_VMCORE */ | 486 | #endif /* CONFIG_PROC_VMCORE */ |
457 | 487 | ||
458 | void __init | 488 | void __init |
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile index 38fa6e49e791..46edf8444c7e 100644 --- a/arch/ia64/lib/Makefile +++ b/arch/ia64/lib/Makefile | |||
@@ -9,12 +9,11 @@ lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \ | |||
9 | checksum.o clear_page.o csum_partial_copy.o \ | 9 | checksum.o clear_page.o csum_partial_copy.o \ |
10 | clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \ | 10 | clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \ |
11 | flush.o ip_fast_csum.o do_csum.o \ | 11 | flush.o ip_fast_csum.o do_csum.o \ |
12 | memset.o strlen.o | 12 | memset.o strlen.o xor.o |
13 | 13 | ||
14 | lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o | 14 | lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o |
15 | lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o | 15 | lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o |
16 | lib-$(CONFIG_PERFMON) += carta_random.o | 16 | lib-$(CONFIG_PERFMON) += carta_random.o |
17 | lib-$(CONFIG_MD_RAID456) += xor.o | ||
18 | 17 | ||
19 | AFLAGS___divdi3.o = | 18 | AFLAGS___divdi3.o = |
20 | AFLAGS___udivdi3.o = -DUNSIGNED | 19 | AFLAGS___udivdi3.o = -DUNSIGNED |
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c index ca4d41e5f177..fb0f4698f5d0 100644 --- a/arch/ia64/mm/contig.c +++ b/arch/ia64/mm/contig.c | |||
@@ -197,11 +197,6 @@ find_memory (void) | |||
197 | 197 | ||
198 | find_initrd(); | 198 | find_initrd(); |
199 | 199 | ||
200 | #ifdef CONFIG_CRASH_DUMP | ||
201 | /* If we are doing a crash dump, we still need to know the real mem | ||
202 | * size before original memory map is reset. */ | ||
203 | saved_max_pfn = max_pfn; | ||
204 | #endif | ||
205 | } | 200 | } |
206 | 201 | ||
207 | #ifdef CONFIG_SMP | 202 | #ifdef CONFIG_SMP |
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index 16835108bb5b..11a2d8825d89 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c | |||
@@ -480,12 +480,6 @@ void __init find_memory(void) | |||
480 | max_pfn = max_low_pfn; | 480 | max_pfn = max_low_pfn; |
481 | 481 | ||
482 | find_initrd(); | 482 | find_initrd(); |
483 | |||
484 | #ifdef CONFIG_CRASH_DUMP | ||
485 | /* If we are doing a crash dump, we still need to know the real mem | ||
486 | * size before original memory map is reset. */ | ||
487 | saved_max_pfn = max_pfn; | ||
488 | #endif | ||
489 | } | 483 | } |
490 | 484 | ||
491 | #ifdef CONFIG_SMP | 485 | #ifdef CONFIG_SMP |