Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4571bc5a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 8aa34172 73580dac
Loading
Loading
Loading
Loading
+2 −21
Original line number Diff line number Diff line
@@ -43,28 +43,9 @@ static inline void flush_kernel_dcache_page(struct page *page)

#define flush_kernel_dcache_range(start,size) \
	flush_kernel_dcache_range_asm((start), (start)+(size));
/* vmap range flushes and invalidates.  Architecturally, we don't need
 * the invalidate, because the CPU should refuse to speculate once an
 * area has been flushed, so invalidate is left empty */
static inline void flush_kernel_vmap_range(void *vaddr, int size)
{
	unsigned long start = (unsigned long)vaddr;

	flush_kernel_dcache_range_asm(start, start + size);
}
static inline void invalidate_kernel_vmap_range(void *vaddr, int size)
{
	unsigned long start = (unsigned long)vaddr;
	void *cursor = vaddr;

	for ( ; cursor < vaddr + size; cursor += PAGE_SIZE) {
		struct page *page = vmalloc_to_page(cursor);

		if (test_and_clear_bit(PG_dcache_dirty, &page->flags))
			flush_kernel_dcache_page(page);
	}
	flush_kernel_dcache_range_asm(start, start + size);
}
void flush_kernel_vmap_range(void *vaddr, int size);
void invalidate_kernel_vmap_range(void *vaddr, int size);

#define flush_cache_vmap(start, end)		flush_cache_all()
#define flush_cache_vunmap(start, end)		flush_cache_all()
+2 −1
Original line number Diff line number Diff line
@@ -32,7 +32,8 @@
 * that put_user is the same as __put_user, etc.
 */

#define access_ok(type, uaddr, size) (1)
#define access_ok(type, uaddr, size)	\
	( (uaddr) == (uaddr) )

#define put_user __put_user
#define get_user __get_user
+2 −1
Original line number Diff line number Diff line
@@ -362,8 +362,9 @@
#define __NR_copy_file_range	(__NR_Linux + 346)
#define __NR_preadv2		(__NR_Linux + 347)
#define __NR_pwritev2		(__NR_Linux + 348)
#define __NR_statx		(__NR_Linux + 349)

#define __NR_Linux_syscalls	(__NR_pwritev2 + 1)
#define __NR_Linux_syscalls	(__NR_statx + 1)


#define __IGNORE_select		/* newselect */
+22 −0
Original line number Diff line number Diff line
@@ -616,3 +616,25 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
		__flush_cache_page(vma, vmaddr, PFN_PHYS(pfn));
	}
}

void flush_kernel_vmap_range(void *vaddr, int size)
{
	unsigned long start = (unsigned long)vaddr;

	if ((unsigned long)size > parisc_cache_flush_threshold)
		flush_data_cache();
	else
		flush_kernel_dcache_range_asm(start, start + size);
}
EXPORT_SYMBOL(flush_kernel_vmap_range);

void invalidate_kernel_vmap_range(void *vaddr, int size)
{
	unsigned long start = (unsigned long)vaddr;

	if ((unsigned long)size > parisc_cache_flush_threshold)
		flush_data_cache();
	else
		flush_kernel_dcache_range_asm(start, start + size);
}
EXPORT_SYMBOL(invalidate_kernel_vmap_range);
+8 −0
Original line number Diff line number Diff line
@@ -620,6 +620,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
			 */
			*loc = fsel(val, addend); 
			break;
		case R_PARISC_SECREL32:
			/* 32-bit section relative address. */
			*loc = fsel(val, addend);
			break;
		case R_PARISC_DPREL21L:
			/* left 21 bit of relative address */
			val = lrsel(val - dp, addend);
@@ -807,6 +811,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
			 */
			*loc = fsel(val, addend); 
			break;
		case R_PARISC_SECREL32:
			/* 32-bit section relative address. */
			*loc = fsel(val, addend);
			break;
		case R_PARISC_FPTR64:
			/* 64-bit function address */
			if(in_local(me, (void *)(val + addend))) {
Loading