Skip to content

Commit 4571bc5

Browse files
committed
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
2 parents 8aa3417 + 73580da commit 4571bc5

File tree

8 files changed

+88
-68
lines changed

8 files changed

+88
-68
lines changed

arch/parisc/include/asm/cacheflush.h

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,9 @@ static inline void flush_kernel_dcache_page(struct page *page)
4343

4444
#define flush_kernel_dcache_range(start,size) \
4545
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;
5946

60-
for ( ; cursor < vaddr + size; cursor += PAGE_SIZE) {
61-
struct page *page = vmalloc_to_page(cursor);
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-
}
47+
void flush_kernel_vmap_range(void *vaddr, int size);
48+
void invalidate_kernel_vmap_range(void *vaddr, int size);
6849

6950
#define flush_cache_vmap(start, end) flush_cache_all()
7051
#define flush_cache_vunmap(start, end) flush_cache_all()

arch/parisc/include/asm/uaccess.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
* that put_user is the same as __put_user, etc.
3333
*/
3434

35-
#define access_ok(type, uaddr, size) (1)
35+
#define access_ok(type, uaddr, size) \
36+
( (uaddr) == (uaddr) )
3637

3738
#define put_user __put_user
3839
#define get_user __get_user

arch/parisc/include/uapi/asm/unistd.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,9 @@
362362
#define __NR_copy_file_range (__NR_Linux + 346)
363363
#define __NR_preadv2 (__NR_Linux + 347)
364364
#define __NR_pwritev2 (__NR_Linux + 348)
365+
#define __NR_statx (__NR_Linux + 349)
365366

366-
#define __NR_Linux_syscalls (__NR_pwritev2 + 1)
367+
#define __NR_Linux_syscalls (__NR_statx + 1)
367368

368369

369370
#define __IGNORE_select /* newselect */

arch/parisc/kernel/cache.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,3 +616,25 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
616616
__flush_cache_page(vma, vmaddr, PFN_PHYS(pfn));
617617
}
618618
}
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);

arch/parisc/kernel/module.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
620620
*/
621621
*loc = fsel(val, addend);
622622
break;
623+
case R_PARISC_SECREL32:
624+
/* 32-bit section relative address. */
625+
*loc = fsel(val, addend);
626+
break;
623627
case R_PARISC_DPREL21L:
624628
/* left 21 bit of relative address */
625629
val = lrsel(val - dp, addend);
@@ -807,6 +811,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
807811
*/
808812
*loc = fsel(val, addend);
809813
break;
814+
case R_PARISC_SECREL32:
815+
/* 32-bit section relative address. */
816+
*loc = fsel(val, addend);
817+
break;
810818
case R_PARISC_FPTR64:
811819
/* 64-bit function address */
812820
if(in_local(me, (void *)(val + addend))) {

0 commit comments

Comments
 (0)