Skip to content

Commit

Permalink
Merge branch 'parisc-3.14' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/deller/parisc-linux

Pull parisc updates from Helge Deller:
 "The three major changes in this patchset is a implementation for
  flexible userspace memory maps, cache-flushing fixes (again), and a
  long-discussed ABI change to make EWOULDBLOCK the same value as
  EAGAIN.

  parisc has been the only platform where we had EWOULDBLOCK != EAGAIN
  to keep HP-UX compatibility.  Since we will probably never implement
  full HP-UX support, we prefer to drop this compatibility to make it
  easier for us with Linux userspace programs which mostly never checked
  for both values.  We don't expect major fall-outs because of this
  change, and if we face some, we will simply rebuild the necessary
  applications in the debian archives"

* 'parisc-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: add flexible mmap memory layout support
  parisc: Make EWOULDBLOCK be equal to EAGAIN on parisc
  parisc: convert uapi/asm/stat.h to use native types only
  parisc: wire up sched_setattr and sched_getattr
  parisc: fix cache-flushing
  parisc/sti_console: prefer Linux fonts over built-in ROM fonts
  • Loading branch information
torvalds committed Feb 3, 2014
2 parents 1c0b8a7 + 9dabf60 commit 69048e0
Show file tree
Hide file tree
Showing 15 changed files with 278 additions and 73 deletions.
2 changes: 0 additions & 2 deletions arch/parisc/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ void mark_rodata_ro(void);
static inline void *kmap(struct page *page)
{
might_sleep();
flush_dcache_page(page);
return page_address(page);
}

Expand All @@ -144,7 +143,6 @@ static inline void kunmap(struct page *page)
static inline void *kmap_atomic(struct page *page)
{
pagefault_disable();
flush_dcache_page(page);
return page_address(page);
}

Expand Down
4 changes: 4 additions & 0 deletions arch/parisc/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,8 @@ struct pt_regs; /* forward declaration... */

#define ELF_HWCAP 0

struct mm_struct;
extern unsigned long arch_randomize_brk(struct mm_struct *);
#define arch_randomize_brk arch_randomize_brk

#endif
3 changes: 2 additions & 1 deletion arch/parisc/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ struct page;
void clear_page_asm(void *page);
void copy_page_asm(void *to, void *from);
#define clear_user_page(vto, vaddr, page) clear_page_asm(vto)
#define copy_user_page(vto, vfrom, vaddr, page) copy_page_asm(vto, vfrom)
void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
struct page *pg);

/* #define CONFIG_PARISC_TMPALIAS */

Expand Down
1 change: 1 addition & 0 deletions arch/parisc/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
/* We provide our own get_unmapped_area to provide cache coherency */

#define HAVE_ARCH_UNMAPPED_AREA
#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN

#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
Expand Down
2 changes: 2 additions & 0 deletions arch/parisc/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#endif
#define current_text_addr() ({ void *pc; current_ia(pc); pc; })

#define HAVE_ARCH_PICK_MMAP_LAYOUT

#define TASK_SIZE_OF(tsk) ((tsk)->thread.task_size)
#define TASK_SIZE TASK_SIZE_OF(current)
#define TASK_UNMAPPED_BASE (current->thread.map_base)
Expand Down
10 changes: 10 additions & 0 deletions arch/parisc/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ struct thread_info {
#define _TIF_SYSCALL_TRACE_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
_TIF_BLOCKSTEP | _TIF_SYSCALL_AUDIT)

#ifdef CONFIG_64BIT
# ifdef CONFIG_COMPAT
# define is_32bit_task() (test_thread_flag(TIF_32BIT))
# else
# define is_32bit_task() (0)
# endif
#else
# define is_32bit_task() (1)
#endif

#endif /* __KERNEL__ */

#endif /* _ASM_PARISC_THREAD_INFO_H */
2 changes: 1 addition & 1 deletion arch/parisc/include/uapi/asm/errno.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

#define EALREADY 244 /* Operation already in progress */
#define EINPROGRESS 245 /* Operation now in progress */
#define EWOULDBLOCK 246 /* Operation would block (Linux returns EAGAIN) */
#define EWOULDBLOCK EAGAIN /* Operation would block (Not HPUX compliant) */
#define ENOTEMPTY 247 /* Directory not empty */
#define ENAMETOOLONG 248 /* File name too long */
#define ELOOP 249 /* Too many symbolic links encountered */
Expand Down
40 changes: 19 additions & 21 deletions arch/parisc/include/uapi/asm/stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,65 @@

struct stat {
unsigned int st_dev; /* dev_t is 32 bits on parisc */
ino_t st_ino; /* 32 bits */
mode_t st_mode; /* 16 bits */
unsigned int st_ino; /* 32 bits */
unsigned short st_mode; /* 16 bits */
unsigned short st_nlink; /* 16 bits */
unsigned short st_reserved1; /* old st_uid */
unsigned short st_reserved2; /* old st_gid */
unsigned int st_rdev;
off_t st_size;
time_t st_atime;
signed int st_size;
signed int st_atime;
unsigned int st_atime_nsec;
time_t st_mtime;
signed int st_mtime;
unsigned int st_mtime_nsec;
time_t st_ctime;
signed int st_ctime;
unsigned int st_ctime_nsec;
int st_blksize;
int st_blocks;
unsigned int __unused1; /* ACL stuff */
unsigned int __unused2; /* network */
ino_t __unused3; /* network */
unsigned int __unused3; /* network */
unsigned int __unused4; /* cnodes */
unsigned short __unused5; /* netsite */
short st_fstype;
unsigned int st_realdev;
unsigned short st_basemode;
unsigned short st_spareshort;
uid_t st_uid;
gid_t st_gid;
unsigned int st_uid;
unsigned int st_gid;
unsigned int st_spare4[3];
};

#define STAT_HAVE_NSEC

typedef __kernel_off64_t off64_t;

struct hpux_stat64 {
unsigned int st_dev; /* dev_t is 32 bits on parisc */
ino_t st_ino; /* 32 bits */
mode_t st_mode; /* 16 bits */
unsigned int st_ino; /* 32 bits */
unsigned short st_mode; /* 16 bits */
unsigned short st_nlink; /* 16 bits */
unsigned short st_reserved1; /* old st_uid */
unsigned short st_reserved2; /* old st_gid */
unsigned int st_rdev;
off64_t st_size;
time_t st_atime;
signed long long st_size;
signed int st_atime;
unsigned int st_spare1;
time_t st_mtime;
signed int st_mtime;
unsigned int st_spare2;
time_t st_ctime;
signed int st_ctime;
unsigned int st_spare3;
int st_blksize;
__u64 st_blocks;
unsigned long long st_blocks;
unsigned int __unused1; /* ACL stuff */
unsigned int __unused2; /* network */
ino_t __unused3; /* network */
unsigned int __unused3; /* network */
unsigned int __unused4; /* cnodes */
unsigned short __unused5; /* netsite */
short st_fstype;
unsigned int st_realdev;
unsigned short st_basemode;
unsigned short st_spareshort;
uid_t st_uid;
gid_t st_gid;
unsigned int st_uid;
unsigned int st_gid;
unsigned int st_spare4[3];
};

Expand Down
4 changes: 3 additions & 1 deletion arch/parisc/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,10 @@
#define __NR_process_vm_writev (__NR_Linux + 331)
#define __NR_kcmp (__NR_Linux + 332)
#define __NR_finit_module (__NR_Linux + 333)
#define __NR_sched_setattr (__NR_Linux + 334)
#define __NR_sched_getattr (__NR_Linux + 335)

#define __NR_Linux_syscalls (__NR_finit_module + 1)
#define __NR_Linux_syscalls (__NR_sched_getattr + 1)


#define __IGNORE_select /* newselect */
Expand Down
14 changes: 14 additions & 0 deletions arch/parisc/kernel/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,20 @@ void flush_kernel_dcache_page_addr(void *addr)
}
EXPORT_SYMBOL(flush_kernel_dcache_page_addr);

void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
struct page *pg)
{
/* Copy using kernel mapping. No coherency is needed (all in
kunmap) for the `to' page. However, the `from' page needs to
be flushed through a mapping equivalent to the user mapping
before it can be accessed through the kernel mapping. */
preempt_disable();
flush_dcache_page_asm(__pa(vfrom), vaddr);
preempt_enable();
copy_page_asm(vto, vfrom);
}
EXPORT_SYMBOL(copy_user_page);

void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
{
unsigned long flags;
Expand Down
21 changes: 20 additions & 1 deletion arch/parisc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Copyright (C) 2000 Grant Grundler <grundler with parisc-linux.org>
* Copyright (C) 2001 Alan Modra <amodra at parisc-linux.org>
* Copyright (C) 2001-2002 Ryan Bradetich <rbrad at parisc-linux.org>
* Copyright (C) 2001-2007 Helge Deller <deller at parisc-linux.org>
* Copyright (C) 2001-2014 Helge Deller <deller@gmx.de>
* Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
*
*
Expand Down Expand Up @@ -49,6 +49,7 @@
#include <linux/kallsyms.h>
#include <linux/uaccess.h>
#include <linux/rcupdate.h>
#include <linux/random.h>

#include <asm/io.h>
#include <asm/asm-offsets.h>
Expand Down Expand Up @@ -286,3 +287,21 @@ void *dereference_function_descriptor(void *ptr)
return ptr;
}
#endif

static inline unsigned long brk_rnd(void)
{
/* 8MB for 32bit, 1GB for 64bit */
if (is_32bit_task())
return (get_random_int() & 0x7ffUL) << PAGE_SHIFT;
else
return (get_random_int() & 0x3ffffUL) << PAGE_SHIFT;
}

unsigned long arch_randomize_brk(struct mm_struct *mm)
{
unsigned long ret = PAGE_ALIGN(mm->brk + brk_rnd());

if (ret < mm->brk)
return mm->brk;
return ret;
}
Loading

0 comments on commit 69048e0

Please sign in to comment.