diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-19 21:11:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-19 21:11:13 -0400 |
commit | 4571bc5abfba3bed8cb18f640bfcaf336473aee3 (patch) | |
tree | 0bdd35f2d443b7de7ce90462b4f7bd0d241833ac | |
parent | 8aa3417255fababc0cab7128dd7520d3af344ab8 (diff) | |
parent | 73580dac7618e4bcd21679f553cf3c97323fec46 (diff) |
Merge branch 'parisc-4.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc fixes from Helge Deller:
- Mikulas Patocka added support for R_PARISC_SECREL32 relocations in
modules with CONFIG_MODVERSIONS.
- Dave Anglin optimized the cache flushing for vmap ranges.
- Arvind Yadav provided a fix for a potential NULL pointer dereference
in the parisc perf code (and some code cleanups).
- I wired up the new statx system call, fixed some compiler warnings
with the access_ok() macro and fixed shutdown code to really halt a
system at shutdown instead of crashing & rebooting.
* 'parisc-4.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
parisc: Fix system shutdown halt
parisc: perf: Fix potential NULL pointer dereference
parisc: Avoid compiler warnings with access_ok()
parisc: Wire up statx system call
parisc: Optimize flush_kernel_vmap_range and invalidate_kernel_vmap_range
parisc: support R_PARISC_SECREL32 relocation in modules
-rw-r--r-- | arch/parisc/include/asm/cacheflush.h | 23 | ||||
-rw-r--r-- | arch/parisc/include/asm/uaccess.h | 3 | ||||
-rw-r--r-- | arch/parisc/include/uapi/asm/unistd.h | 3 | ||||
-rw-r--r-- | arch/parisc/kernel/cache.c | 22 | ||||
-rw-r--r-- | arch/parisc/kernel/module.c | 8 | ||||
-rw-r--r-- | arch/parisc/kernel/perf.c | 94 | ||||
-rw-r--r-- | arch/parisc/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/parisc/kernel/syscall_table.S | 1 |
8 files changed, 88 insertions, 68 deletions
diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h index 19c9c3c5f267..c7e15cc5c668 100644 --- a/arch/parisc/include/asm/cacheflush.h +++ b/arch/parisc/include/asm/cacheflush.h | |||
@@ -43,28 +43,9 @@ static inline void flush_kernel_dcache_page(struct page *page) | |||
43 | 43 | ||
44 | #define flush_kernel_dcache_range(start,size) \ | 44 | #define flush_kernel_dcache_range(start,size) \ |
45 | flush_kernel_dcache_range_asm((start), (start)+(size)); | 45 | flush_kernel_dcache_range_asm((start), (start)+(size)); |
46 | /* vmap range flushes and invalidates. Architecturally, we don't need | ||
47 | * the invalidate, because the CPU should refuse to speculate once an | ||
48 | * area has been flushed, so invalidate is left empty */ | ||
49 | static inline void flush_kernel_vmap_range(void *vaddr, int size) | ||
50 | { | ||
51 | unsigned long start = (unsigned long)vaddr; | ||
52 | |||
53 | flush_kernel_dcache_range_asm(start, start + size); | ||
54 | } | ||
55 | static inline void invalidate_kernel_vmap_range(void *vaddr, int size) | ||
56 | { | ||
57 | unsigned long start = (unsigned long)vaddr; | ||
58 | void *cursor = vaddr; | ||
59 | 46 | ||
60 | for ( ; cursor < vaddr + size; cursor += PAGE_SIZE) { | 47 | void flush_kernel_vmap_range(void *vaddr, int size); |
61 | struct page *page = vmalloc_to_page(cursor); | 48 | void invalidate_kernel_vmap_range(void *vaddr, int size); |
62 | |||
63 | if (test_and_clear_bit(PG_dcache_dirty, &page->flags)) | ||
64 | flush_kernel_dcache_page(page); | ||
65 | } | ||
66 | flush_kernel_dcache_range_asm(start, start + size); | ||
67 | } | ||
68 | 49 | ||
69 | #define flush_cache_vmap(start, end) flush_cache_all() | 50 | #define flush_cache_vmap(start, end) flush_cache_all() |
70 | #define flush_cache_vunmap(start, end) flush_cache_all() | 51 | #define flush_cache_vunmap(start, end) flush_cache_all() |
diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h index fb4382c28259..edfbf9d6a6dd 100644 --- a/arch/parisc/include/asm/uaccess.h +++ b/arch/parisc/include/asm/uaccess.h | |||
@@ -32,7 +32,8 @@ | |||
32 | * that put_user is the same as __put_user, etc. | 32 | * that put_user is the same as __put_user, etc. |
33 | */ | 33 | */ |
34 | 34 | ||
35 | #define access_ok(type, uaddr, size) (1) | 35 | #define access_ok(type, uaddr, size) \ |
36 | ( (uaddr) == (uaddr) ) | ||
36 | 37 | ||
37 | #define put_user __put_user | 38 | #define put_user __put_user |
38 | #define get_user __get_user | 39 | #define get_user __get_user |
diff --git a/arch/parisc/include/uapi/asm/unistd.h b/arch/parisc/include/uapi/asm/unistd.h index 6b0741e7a7ed..667c99421003 100644 --- a/arch/parisc/include/uapi/asm/unistd.h +++ b/arch/parisc/include/uapi/asm/unistd.h | |||
@@ -362,8 +362,9 @@ | |||
362 | #define __NR_copy_file_range (__NR_Linux + 346) | 362 | #define __NR_copy_file_range (__NR_Linux + 346) |
363 | #define __NR_preadv2 (__NR_Linux + 347) | 363 | #define __NR_preadv2 (__NR_Linux + 347) |
364 | #define __NR_pwritev2 (__NR_Linux + 348) | 364 | #define __NR_pwritev2 (__NR_Linux + 348) |
365 | #define __NR_statx (__NR_Linux + 349) | ||
365 | 366 | ||
366 | #define __NR_Linux_syscalls (__NR_pwritev2 + 1) | 367 | #define __NR_Linux_syscalls (__NR_statx + 1) |
367 | 368 | ||
368 | 369 | ||
369 | #define __IGNORE_select /* newselect */ | 370 | #define __IGNORE_select /* newselect */ |
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 0dc72d5de861..c32a09095216 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c | |||
@@ -616,3 +616,25 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long | |||
616 | __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn)); | 616 | __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn)); |
617 | } | 617 | } |
618 | } | 618 | } |
619 | |||
620 | void flush_kernel_vmap_range(void *vaddr, int size) | ||
621 | { | ||
622 | unsigned long start = (unsigned long)vaddr; | ||
623 | |||
624 | if ((unsigned long)size > parisc_cache_flush_threshold) | ||
625 | flush_data_cache(); | ||
626 | else | ||
627 | flush_kernel_dcache_range_asm(start, start + size); | ||
628 | } | ||
629 | EXPORT_SYMBOL(flush_kernel_vmap_range); | ||
630 | |||
631 | void invalidate_kernel_vmap_range(void *vaddr, int size) | ||
632 | { | ||
633 | unsigned long start = (unsigned long)vaddr; | ||
634 | |||
635 | if ((unsigned long)size > parisc_cache_flush_threshold) | ||
636 | flush_data_cache(); | ||
637 | else | ||
638 | flush_kernel_dcache_range_asm(start, start + size); | ||
639 | } | ||
640 | EXPORT_SYMBOL(invalidate_kernel_vmap_range); | ||
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index a0ecdb4abcc8..c66c943d9322 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c | |||
@@ -620,6 +620,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs, | |||
620 | */ | 620 | */ |
621 | *loc = fsel(val, addend); | 621 | *loc = fsel(val, addend); |
622 | break; | 622 | break; |
623 | case R_PARISC_SECREL32: | ||
624 | /* 32-bit section relative address. */ | ||
625 | *loc = fsel(val, addend); | ||
626 | break; | ||
623 | case R_PARISC_DPREL21L: | 627 | case R_PARISC_DPREL21L: |
624 | /* left 21 bit of relative address */ | 628 | /* left 21 bit of relative address */ |
625 | val = lrsel(val - dp, addend); | 629 | val = lrsel(val - dp, addend); |
@@ -807,6 +811,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs, | |||
807 | */ | 811 | */ |
808 | *loc = fsel(val, addend); | 812 | *loc = fsel(val, addend); |
809 | break; | 813 | break; |
814 | case R_PARISC_SECREL32: | ||
815 | /* 32-bit section relative address. */ | ||
816 | *loc = fsel(val, addend); | ||
817 | break; | ||
810 | case R_PARISC_FPTR64: | 818 | case R_PARISC_FPTR64: |
811 | /* 64-bit function address */ | 819 | /* 64-bit function address */ |
812 | if(in_local(me, (void *)(val + addend))) { | 820 | if(in_local(me, (void *)(val + addend))) { |
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c index e282a5131d77..6017a5af2e6e 100644 --- a/arch/parisc/kernel/perf.c +++ b/arch/parisc/kernel/perf.c | |||
@@ -39,7 +39,7 @@ | |||
39 | * the PDC INTRIGUE calls. This is done to eliminate bugs introduced | 39 | * the PDC INTRIGUE calls. This is done to eliminate bugs introduced |
40 | * in various PDC revisions. The code is much more maintainable | 40 | * in various PDC revisions. The code is much more maintainable |
41 | * and reliable this way vs having to debug on every version of PDC | 41 | * and reliable this way vs having to debug on every version of PDC |
42 | * on every box. | 42 | * on every box. |
43 | */ | 43 | */ |
44 | 44 | ||
45 | #include <linux/capability.h> | 45 | #include <linux/capability.h> |
@@ -195,8 +195,8 @@ static int perf_config(uint32_t *image_ptr); | |||
195 | static int perf_release(struct inode *inode, struct file *file); | 195 | static int perf_release(struct inode *inode, struct file *file); |
196 | static int perf_open(struct inode *inode, struct file *file); | 196 | static int perf_open(struct inode *inode, struct file *file); |
197 | static ssize_t perf_read(struct file *file, char __user *buf, size_t cnt, loff_t *ppos); | 197 | static ssize_t perf_read(struct file *file, char __user *buf, size_t cnt, loff_t *ppos); |
198 | static ssize_t perf_write(struct file *file, const char __user *buf, size_t count, | 198 | static ssize_t perf_write(struct file *file, const char __user *buf, |
199 | loff_t *ppos); | 199 | size_t count, loff_t *ppos); |
200 | static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | 200 | static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
201 | static void perf_start_counters(void); | 201 | static void perf_start_counters(void); |
202 | static int perf_stop_counters(uint32_t *raddr); | 202 | static int perf_stop_counters(uint32_t *raddr); |
@@ -222,7 +222,7 @@ extern void perf_intrigue_disable_perf_counters (void); | |||
222 | /* | 222 | /* |
223 | * configure: | 223 | * configure: |
224 | * | 224 | * |
225 | * Configure the cpu with a given data image. First turn off the counters, | 225 | * Configure the cpu with a given data image. First turn off the counters, |
226 | * then download the image, then turn the counters back on. | 226 | * then download the image, then turn the counters back on. |
227 | */ | 227 | */ |
228 | static int perf_config(uint32_t *image_ptr) | 228 | static int perf_config(uint32_t *image_ptr) |
@@ -234,7 +234,7 @@ static int perf_config(uint32_t *image_ptr) | |||
234 | error = perf_stop_counters(raddr); | 234 | error = perf_stop_counters(raddr); |
235 | if (error != 0) { | 235 | if (error != 0) { |
236 | printk("perf_config: perf_stop_counters = %ld\n", error); | 236 | printk("perf_config: perf_stop_counters = %ld\n", error); |
237 | return -EINVAL; | 237 | return -EINVAL; |
238 | } | 238 | } |
239 | 239 | ||
240 | printk("Preparing to write image\n"); | 240 | printk("Preparing to write image\n"); |
@@ -242,7 +242,7 @@ printk("Preparing to write image\n"); | |||
242 | error = perf_write_image((uint64_t *)image_ptr); | 242 | error = perf_write_image((uint64_t *)image_ptr); |
243 | if (error != 0) { | 243 | if (error != 0) { |
244 | printk("perf_config: DOWNLOAD = %ld\n", error); | 244 | printk("perf_config: DOWNLOAD = %ld\n", error); |
245 | return -EINVAL; | 245 | return -EINVAL; |
246 | } | 246 | } |
247 | 247 | ||
248 | printk("Preparing to start counters\n"); | 248 | printk("Preparing to start counters\n"); |
@@ -254,7 +254,7 @@ printk("Preparing to start counters\n"); | |||
254 | } | 254 | } |
255 | 255 | ||
256 | /* | 256 | /* |
257 | * Open the device and initialize all of its memory. The device is only | 257 | * Open the device and initialize all of its memory. The device is only |
258 | * opened once, but can be "queried" by multiple processes that know its | 258 | * opened once, but can be "queried" by multiple processes that know its |
259 | * file descriptor. | 259 | * file descriptor. |
260 | */ | 260 | */ |
@@ -298,19 +298,19 @@ static ssize_t perf_read(struct file *file, char __user *buf, size_t cnt, loff_t | |||
298 | * called on the processor that the download should happen | 298 | * called on the processor that the download should happen |
299 | * on. | 299 | * on. |
300 | */ | 300 | */ |
301 | static ssize_t perf_write(struct file *file, const char __user *buf, size_t count, | 301 | static ssize_t perf_write(struct file *file, const char __user *buf, |
302 | loff_t *ppos) | 302 | size_t count, loff_t *ppos) |
303 | { | 303 | { |
304 | size_t image_size; | 304 | size_t image_size; |
305 | uint32_t image_type; | 305 | uint32_t image_type; |
306 | uint32_t interface_type; | 306 | uint32_t interface_type; |
307 | uint32_t test; | 307 | uint32_t test; |
308 | 308 | ||
309 | if (perf_processor_interface == ONYX_INTF) | 309 | if (perf_processor_interface == ONYX_INTF) |
310 | image_size = PCXU_IMAGE_SIZE; | 310 | image_size = PCXU_IMAGE_SIZE; |
311 | else if (perf_processor_interface == CUDA_INTF) | 311 | else if (perf_processor_interface == CUDA_INTF) |
312 | image_size = PCXW_IMAGE_SIZE; | 312 | image_size = PCXW_IMAGE_SIZE; |
313 | else | 313 | else |
314 | return -EFAULT; | 314 | return -EFAULT; |
315 | 315 | ||
316 | if (!capable(CAP_SYS_ADMIN)) | 316 | if (!capable(CAP_SYS_ADMIN)) |
@@ -330,22 +330,22 @@ static ssize_t perf_write(struct file *file, const char __user *buf, size_t coun | |||
330 | 330 | ||
331 | /* First check the machine type is correct for | 331 | /* First check the machine type is correct for |
332 | the requested image */ | 332 | the requested image */ |
333 | if (((perf_processor_interface == CUDA_INTF) && | 333 | if (((perf_processor_interface == CUDA_INTF) && |
334 | (interface_type != CUDA_INTF)) || | 334 | (interface_type != CUDA_INTF)) || |
335 | ((perf_processor_interface == ONYX_INTF) && | 335 | ((perf_processor_interface == ONYX_INTF) && |
336 | (interface_type != ONYX_INTF))) | 336 | (interface_type != ONYX_INTF))) |
337 | return -EINVAL; | 337 | return -EINVAL; |
338 | 338 | ||
339 | /* Next check to make sure the requested image | 339 | /* Next check to make sure the requested image |
340 | is valid */ | 340 | is valid */ |
341 | if (((interface_type == CUDA_INTF) && | 341 | if (((interface_type == CUDA_INTF) && |
342 | (test >= MAX_CUDA_IMAGES)) || | 342 | (test >= MAX_CUDA_IMAGES)) || |
343 | ((interface_type == ONYX_INTF) && | 343 | ((interface_type == ONYX_INTF) && |
344 | (test >= MAX_ONYX_IMAGES))) | 344 | (test >= MAX_ONYX_IMAGES))) |
345 | return -EINVAL; | 345 | return -EINVAL; |
346 | 346 | ||
347 | /* Copy the image into the processor */ | 347 | /* Copy the image into the processor */ |
348 | if (interface_type == CUDA_INTF) | 348 | if (interface_type == CUDA_INTF) |
349 | return perf_config(cuda_images[test]); | 349 | return perf_config(cuda_images[test]); |
350 | else | 350 | else |
351 | return perf_config(onyx_images[test]); | 351 | return perf_config(onyx_images[test]); |
@@ -359,7 +359,7 @@ static ssize_t perf_write(struct file *file, const char __user *buf, size_t coun | |||
359 | static void perf_patch_images(void) | 359 | static void perf_patch_images(void) |
360 | { | 360 | { |
361 | #if 0 /* FIXME!! */ | 361 | #if 0 /* FIXME!! */ |
362 | /* | 362 | /* |
363 | * NOTE: this routine is VERY specific to the current TLB image. | 363 | * NOTE: this routine is VERY specific to the current TLB image. |
364 | * If the image is changed, this routine might also need to be changed. | 364 | * If the image is changed, this routine might also need to be changed. |
365 | */ | 365 | */ |
@@ -367,9 +367,9 @@ static void perf_patch_images(void) | |||
367 | extern void $i_dtlb_miss_2_0(); | 367 | extern void $i_dtlb_miss_2_0(); |
368 | extern void PA2_0_iva(); | 368 | extern void PA2_0_iva(); |
369 | 369 | ||
370 | /* | 370 | /* |
371 | * We can only use the lower 32-bits, the upper 32-bits should be 0 | 371 | * We can only use the lower 32-bits, the upper 32-bits should be 0 |
372 | * anyway given this is in the kernel | 372 | * anyway given this is in the kernel |
373 | */ | 373 | */ |
374 | uint32_t itlb_addr = (uint32_t)&($i_itlb_miss_2_0); | 374 | uint32_t itlb_addr = (uint32_t)&($i_itlb_miss_2_0); |
375 | uint32_t dtlb_addr = (uint32_t)&($i_dtlb_miss_2_0); | 375 | uint32_t dtlb_addr = (uint32_t)&($i_dtlb_miss_2_0); |
@@ -377,21 +377,21 @@ static void perf_patch_images(void) | |||
377 | 377 | ||
378 | if (perf_processor_interface == ONYX_INTF) { | 378 | if (perf_processor_interface == ONYX_INTF) { |
379 | /* clear last 2 bytes */ | 379 | /* clear last 2 bytes */ |
380 | onyx_images[TLBMISS][15] &= 0xffffff00; | 380 | onyx_images[TLBMISS][15] &= 0xffffff00; |
381 | /* set 2 bytes */ | 381 | /* set 2 bytes */ |
382 | onyx_images[TLBMISS][15] |= (0x000000ff&((dtlb_addr) >> 24)); | 382 | onyx_images[TLBMISS][15] |= (0x000000ff&((dtlb_addr) >> 24)); |
383 | onyx_images[TLBMISS][16] = (dtlb_addr << 8)&0xffffff00; | 383 | onyx_images[TLBMISS][16] = (dtlb_addr << 8)&0xffffff00; |
384 | onyx_images[TLBMISS][17] = itlb_addr; | 384 | onyx_images[TLBMISS][17] = itlb_addr; |
385 | 385 | ||
386 | /* clear last 2 bytes */ | 386 | /* clear last 2 bytes */ |
387 | onyx_images[TLBHANDMISS][15] &= 0xffffff00; | 387 | onyx_images[TLBHANDMISS][15] &= 0xffffff00; |
388 | /* set 2 bytes */ | 388 | /* set 2 bytes */ |
389 | onyx_images[TLBHANDMISS][15] |= (0x000000ff&((dtlb_addr) >> 24)); | 389 | onyx_images[TLBHANDMISS][15] |= (0x000000ff&((dtlb_addr) >> 24)); |
390 | onyx_images[TLBHANDMISS][16] = (dtlb_addr << 8)&0xffffff00; | 390 | onyx_images[TLBHANDMISS][16] = (dtlb_addr << 8)&0xffffff00; |
391 | onyx_images[TLBHANDMISS][17] = itlb_addr; | 391 | onyx_images[TLBHANDMISS][17] = itlb_addr; |
392 | 392 | ||
393 | /* clear last 2 bytes */ | 393 | /* clear last 2 bytes */ |
394 | onyx_images[BIG_CPI][15] &= 0xffffff00; | 394 | onyx_images[BIG_CPI][15] &= 0xffffff00; |
395 | /* set 2 bytes */ | 395 | /* set 2 bytes */ |
396 | onyx_images[BIG_CPI][15] |= (0x000000ff&((dtlb_addr) >> 24)); | 396 | onyx_images[BIG_CPI][15] |= (0x000000ff&((dtlb_addr) >> 24)); |
397 | onyx_images[BIG_CPI][16] = (dtlb_addr << 8)&0xffffff00; | 397 | onyx_images[BIG_CPI][16] = (dtlb_addr << 8)&0xffffff00; |
@@ -404,24 +404,24 @@ static void perf_patch_images(void) | |||
404 | 404 | ||
405 | } else if (perf_processor_interface == CUDA_INTF) { | 405 | } else if (perf_processor_interface == CUDA_INTF) { |
406 | /* Cuda interface */ | 406 | /* Cuda interface */ |
407 | cuda_images[TLBMISS][16] = | 407 | cuda_images[TLBMISS][16] = |
408 | (cuda_images[TLBMISS][16]&0xffff0000) | | 408 | (cuda_images[TLBMISS][16]&0xffff0000) | |
409 | ((dtlb_addr >> 8)&0x0000ffff); | 409 | ((dtlb_addr >> 8)&0x0000ffff); |
410 | cuda_images[TLBMISS][17] = | 410 | cuda_images[TLBMISS][17] = |
411 | ((dtlb_addr << 24)&0xff000000) | ((itlb_addr >> 16)&0x000000ff); | 411 | ((dtlb_addr << 24)&0xff000000) | ((itlb_addr >> 16)&0x000000ff); |
412 | cuda_images[TLBMISS][18] = (itlb_addr << 16)&0xffff0000; | 412 | cuda_images[TLBMISS][18] = (itlb_addr << 16)&0xffff0000; |
413 | 413 | ||
414 | cuda_images[TLBHANDMISS][16] = | 414 | cuda_images[TLBHANDMISS][16] = |
415 | (cuda_images[TLBHANDMISS][16]&0xffff0000) | | 415 | (cuda_images[TLBHANDMISS][16]&0xffff0000) | |
416 | ((dtlb_addr >> 8)&0x0000ffff); | 416 | ((dtlb_addr >> 8)&0x0000ffff); |
417 | cuda_images[TLBHANDMISS][17] = | 417 | cuda_images[TLBHANDMISS][17] = |
418 | ((dtlb_addr << 24)&0xff000000) | ((itlb_addr >> 16)&0x000000ff); | 418 | ((dtlb_addr << 24)&0xff000000) | ((itlb_addr >> 16)&0x000000ff); |
419 | cuda_images[TLBHANDMISS][18] = (itlb_addr << 16)&0xffff0000; | 419 | cuda_images[TLBHANDMISS][18] = (itlb_addr << 16)&0xffff0000; |
420 | 420 | ||
421 | cuda_images[BIG_CPI][16] = | 421 | cuda_images[BIG_CPI][16] = |
422 | (cuda_images[BIG_CPI][16]&0xffff0000) | | 422 | (cuda_images[BIG_CPI][16]&0xffff0000) | |
423 | ((dtlb_addr >> 8)&0x0000ffff); | 423 | ((dtlb_addr >> 8)&0x0000ffff); |
424 | cuda_images[BIG_CPI][17] = | 424 | cuda_images[BIG_CPI][17] = |
425 | ((dtlb_addr << 24)&0xff000000) | ((itlb_addr >> 16)&0x000000ff); | 425 | ((dtlb_addr << 24)&0xff000000) | ((itlb_addr >> 16)&0x000000ff); |
426 | cuda_images[BIG_CPI][18] = (itlb_addr << 16)&0xffff0000; | 426 | cuda_images[BIG_CPI][18] = (itlb_addr << 16)&0xffff0000; |
427 | } else { | 427 | } else { |
@@ -433,7 +433,7 @@ static void perf_patch_images(void) | |||
433 | 433 | ||
434 | /* | 434 | /* |
435 | * ioctl routine | 435 | * ioctl routine |
436 | * All routines effect the processor that they are executed on. Thus you | 436 | * All routines effect the processor that they are executed on. Thus you |
437 | * must be running on the processor that you wish to change. | 437 | * must be running on the processor that you wish to change. |
438 | */ | 438 | */ |
439 | 439 | ||
@@ -459,7 +459,7 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
459 | } | 459 | } |
460 | 460 | ||
461 | /* copy out the Counters */ | 461 | /* copy out the Counters */ |
462 | if (copy_to_user((void __user *)arg, raddr, | 462 | if (copy_to_user((void __user *)arg, raddr, |
463 | sizeof (raddr)) != 0) { | 463 | sizeof (raddr)) != 0) { |
464 | error = -EFAULT; | 464 | error = -EFAULT; |
465 | break; | 465 | break; |
@@ -487,7 +487,7 @@ static const struct file_operations perf_fops = { | |||
487 | .open = perf_open, | 487 | .open = perf_open, |
488 | .release = perf_release | 488 | .release = perf_release |
489 | }; | 489 | }; |
490 | 490 | ||
491 | static struct miscdevice perf_dev = { | 491 | static struct miscdevice perf_dev = { |
492 | MISC_DYNAMIC_MINOR, | 492 | MISC_DYNAMIC_MINOR, |
493 | PA_PERF_DEV, | 493 | PA_PERF_DEV, |
@@ -595,7 +595,7 @@ static int perf_stop_counters(uint32_t *raddr) | |||
595 | /* OR sticky2 (bit 1496) to counter2 bit 32 */ | 595 | /* OR sticky2 (bit 1496) to counter2 bit 32 */ |
596 | tmp64 |= (userbuf[23] >> 8) & 0x0000000080000000; | 596 | tmp64 |= (userbuf[23] >> 8) & 0x0000000080000000; |
597 | raddr[2] = (uint32_t)tmp64; | 597 | raddr[2] = (uint32_t)tmp64; |
598 | 598 | ||
599 | /* Counter3 is bits 1497 to 1528 */ | 599 | /* Counter3 is bits 1497 to 1528 */ |
600 | tmp64 = (userbuf[23] >> 7) & 0x00000000ffffffff; | 600 | tmp64 = (userbuf[23] >> 7) & 0x00000000ffffffff; |
601 | /* OR sticky3 (bit 1529) to counter3 bit 32 */ | 601 | /* OR sticky3 (bit 1529) to counter3 bit 32 */ |
@@ -617,7 +617,7 @@ static int perf_stop_counters(uint32_t *raddr) | |||
617 | userbuf[22] = 0; | 617 | userbuf[22] = 0; |
618 | userbuf[23] = 0; | 618 | userbuf[23] = 0; |
619 | 619 | ||
620 | /* | 620 | /* |
621 | * Write back the zeroed bytes + the image given | 621 | * Write back the zeroed bytes + the image given |
622 | * the read was destructive. | 622 | * the read was destructive. |
623 | */ | 623 | */ |
@@ -625,13 +625,13 @@ static int perf_stop_counters(uint32_t *raddr) | |||
625 | } else { | 625 | } else { |
626 | 626 | ||
627 | /* | 627 | /* |
628 | * Read RDR-15 which contains the counters and sticky bits | 628 | * Read RDR-15 which contains the counters and sticky bits |
629 | */ | 629 | */ |
630 | if (!perf_rdr_read_ubuf(15, userbuf)) { | 630 | if (!perf_rdr_read_ubuf(15, userbuf)) { |
631 | return -13; | 631 | return -13; |
632 | } | 632 | } |
633 | 633 | ||
634 | /* | 634 | /* |
635 | * Clear out the counters | 635 | * Clear out the counters |
636 | */ | 636 | */ |
637 | perf_rdr_clear(15); | 637 | perf_rdr_clear(15); |
@@ -644,7 +644,7 @@ static int perf_stop_counters(uint32_t *raddr) | |||
644 | raddr[2] = (uint32_t)((userbuf[1] >> 32) & 0x00000000ffffffffUL); | 644 | raddr[2] = (uint32_t)((userbuf[1] >> 32) & 0x00000000ffffffffUL); |
645 | raddr[3] = (uint32_t)(userbuf[1] & 0x00000000ffffffffUL); | 645 | raddr[3] = (uint32_t)(userbuf[1] & 0x00000000ffffffffUL); |
646 | } | 646 | } |
647 | 647 | ||
648 | return 0; | 648 | return 0; |
649 | } | 649 | } |
650 | 650 | ||
@@ -682,7 +682,7 @@ static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer) | |||
682 | i = tentry->num_words; | 682 | i = tentry->num_words; |
683 | while (i--) { | 683 | while (i--) { |
684 | buffer[i] = 0; | 684 | buffer[i] = 0; |
685 | } | 685 | } |
686 | 686 | ||
687 | /* Check for bits an even number of 64 */ | 687 | /* Check for bits an even number of 64 */ |
688 | if ((xbits = width & 0x03f) != 0) { | 688 | if ((xbits = width & 0x03f) != 0) { |
@@ -808,18 +808,22 @@ static int perf_write_image(uint64_t *memaddr) | |||
808 | } | 808 | } |
809 | 809 | ||
810 | runway = ioremap_nocache(cpu_device->hpa.start, 4096); | 810 | runway = ioremap_nocache(cpu_device->hpa.start, 4096); |
811 | if (!runway) { | ||
812 | pr_err("perf_write_image: ioremap failed!\n"); | ||
813 | return -ENOMEM; | ||
814 | } | ||
811 | 815 | ||
812 | /* Merge intrigue bits into Runway STATUS 0 */ | 816 | /* Merge intrigue bits into Runway STATUS 0 */ |
813 | tmp64 = __raw_readq(runway + RUNWAY_STATUS) & 0xffecfffffffffffful; | 817 | tmp64 = __raw_readq(runway + RUNWAY_STATUS) & 0xffecfffffffffffful; |
814 | __raw_writeq(tmp64 | (*memaddr++ & 0x0013000000000000ul), | 818 | __raw_writeq(tmp64 | (*memaddr++ & 0x0013000000000000ul), |
815 | runway + RUNWAY_STATUS); | 819 | runway + RUNWAY_STATUS); |
816 | 820 | ||
817 | /* Write RUNWAY DEBUG registers */ | 821 | /* Write RUNWAY DEBUG registers */ |
818 | for (i = 0; i < 8; i++) { | 822 | for (i = 0; i < 8; i++) { |
819 | __raw_writeq(*memaddr++, runway + RUNWAY_DEBUG); | 823 | __raw_writeq(*memaddr++, runway + RUNWAY_DEBUG); |
820 | } | 824 | } |
821 | 825 | ||
822 | return 0; | 826 | return 0; |
823 | } | 827 | } |
824 | 828 | ||
825 | /* | 829 | /* |
@@ -843,7 +847,7 @@ printk("perf_rdr_write\n"); | |||
843 | perf_rdr_shift_out_U(rdr_num, buffer[i]); | 847 | perf_rdr_shift_out_U(rdr_num, buffer[i]); |
844 | } else { | 848 | } else { |
845 | perf_rdr_shift_out_W(rdr_num, buffer[i]); | 849 | perf_rdr_shift_out_W(rdr_num, buffer[i]); |
846 | } | 850 | } |
847 | } | 851 | } |
848 | printk("perf_rdr_write done\n"); | 852 | printk("perf_rdr_write done\n"); |
849 | } | 853 | } |
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index 06f7ca7fe70b..b76f503eee4a 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c | |||
@@ -142,6 +142,8 @@ void machine_power_off(void) | |||
142 | 142 | ||
143 | printk(KERN_EMERG "System shut down completed.\n" | 143 | printk(KERN_EMERG "System shut down completed.\n" |
144 | "Please power this system off now."); | 144 | "Please power this system off now."); |
145 | |||
146 | for (;;); | ||
145 | } | 147 | } |
146 | 148 | ||
147 | void (*pm_power_off)(void) = machine_power_off; | 149 | void (*pm_power_off)(void) = machine_power_off; |
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 3cfef1de8061..44aeaa9c039f 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S | |||
@@ -444,6 +444,7 @@ | |||
444 | ENTRY_SAME(copy_file_range) | 444 | ENTRY_SAME(copy_file_range) |
445 | ENTRY_COMP(preadv2) | 445 | ENTRY_COMP(preadv2) |
446 | ENTRY_COMP(pwritev2) | 446 | ENTRY_COMP(pwritev2) |
447 | ENTRY_SAME(statx) | ||
447 | 448 | ||
448 | 449 | ||
449 | .ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b)) | 450 | .ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b)) |