Skip to content

Commit

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

Pull parisc updates from Helge Deller.

The bulk of this is optimized page coping/clearing and cache flushing
(virtual caches are lovely) by John David Anglin.

* 'parisc-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: (31 commits)
  arch/parisc/include/asm: use ARRAY_SIZE macro in mmzone.h
  parisc: remove empty lines and unnecessary #ifdef coding in include/asm/signal.h
  parisc: sendfile and sendfile64 syscall cleanups
  parisc: switch to available compat_sched_rr_get_interval implementation
  parisc: fix fallocate syscall
  parisc: fix error return codes for rt_sigaction and rt_sigprocmask
  parisc: convert msgrcv and msgsnd syscalls to use compat layer
  parisc: correctly wire up mq_* functions for CONFIG_COMPAT case
  parisc: fix personality on 32bit kernel
  parisc: wire up process_vm_readv, process_vm_writev, kcmp and finit_module syscalls
  parisc: led driver requires CONFIG_VM_EVENT_COUNTERS
  parisc: remove unused compat_rt_sigframe.h header
  parisc/mm/fault.c: Port OOM changes to do_page_fault
  parisc: space register variables need to be in native length (unsigned long)
  parisc: fix ptrace breakage
  parisc: always detect multiple physical ranges
  parisc: ensure that mmapped shared pages are aligned at SHMLBA addresses
  parisc: disable preemption while flushing D- or I-caches through TMPALIAS region
  parisc: remove IRQF_DISABLED
  parisc: fixes and cleanups in page cache flushing (4/4)
  ...
  • Loading branch information
Linus Torvalds committed Feb 23, 2013
2 parents c68fea3 + 1dda59b commit 5f32ed1
Show file tree
Hide file tree
Showing 32 changed files with 708 additions and 316 deletions.
21 changes: 21 additions & 0 deletions arch/parisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,23 @@ config PREFETCH
def_bool y
depends on PA8X00 || PA7200

config MLONGCALLS
bool "Enable the -mlong-calls compiler option for big kernels"
def_bool y if (!MODULES)
depends on PA8X00
help
If you configure the kernel to include many drivers built-in instead
as modules, the kernel executable may become too big, so that the
linker will not be able to resolve some long branches and fails to link
your vmlinux kernel. In that case enabling this option will help you
to overcome this limit by using the -mlong-calls compiler option.

Usually you want to say N here, unless you e.g. want to build
a kernel which includes all necessary drivers built-in and which can
be used for TFTP booting without the need to have an initrd ramdisk.

Enabling this option will probably slow down your kernel.

config 64BIT
bool "64-bit kernel"
depends on PA8X00
Expand Down Expand Up @@ -254,6 +271,10 @@ config COMPAT
def_bool y
depends on 64BIT

config SYSVIPC_COMPAT
def_bool y
depends on COMPAT && SYSVIPC

config HPUX
bool "Support for HP-UX binaries"
depends on !64BIT
Expand Down
13 changes: 8 additions & 5 deletions arch/parisc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,17 @@ ifdef CONFIG_64BIT
UTS_MACHINE := parisc64
CHECKFLAGS += -D__LP64__=1 -m64
WIDTH := 64

# FIXME: if no default set, should really try to locate dynamically
ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE := hppa64-linux-gnu-
endif
else # 32-bit
WIDTH :=
endif

# attempt to help out folks who are cross-compiling
ifeq ($(NATIVE),1)
CROSS_COMPILE := hppa$(WIDTH)-linux-
else
ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE := hppa$(WIDTH)-linux-gnu-
endif
endif

OBJCOPY_FLAGS =-O binary -R .note -R .comment -S
Expand All @@ -65,6 +64,10 @@ ifndef CONFIG_FUNCTION_TRACER
cflags-y += -ffunction-sections
endif

# Use long jumps instead of long branches (needed if your linker fails to
# link a too big vmlinux executable)
cflags-$(CONFIG_MLONGCALLS) += -mlong-calls

# select which processor to optimise for
cflags-$(CONFIG_PA7100) += -march=1.1 -mschedule=7100
cflags-$(CONFIG_PA7200) += -march=1.1 -mschedule=7200
Expand Down
3 changes: 1 addition & 2 deletions arch/parisc/hpux/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ int hpux_execve(struct pt_regs *regs)

error = do_execve(filename->name,
(const char __user *const __user *) regs->gr[25],
(const char __user *const __user *) regs->gr[24],
regs);
(const char __user *const __user *) regs->gr[24]);

putname(filename);

Expand Down
2 changes: 2 additions & 0 deletions arch/parisc/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vma
{
if (PageAnon(page)) {
flush_tlb_page(vma, vmaddr);
preempt_disable();
flush_dcache_page_asm(page_to_phys(page), vmaddr);
preempt_enable();
}
}

Expand Down
61 changes: 61 additions & 0 deletions arch/parisc/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ typedef u16 compat_nlink_t;
typedef u16 compat_ipc_pid_t;
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t;
typedef s32 compat_key_t;
typedef s32 compat_timer_t;

typedef s32 compat_int_t;
Expand Down Expand Up @@ -188,6 +189,66 @@ typedef struct compat_siginfo {
#define COMPAT_OFF_T_MAX 0x7fffffff
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL

struct compat_ipc64_perm {
compat_key_t key;
__compat_uid_t uid;
__compat_gid_t gid;
__compat_uid_t cuid;
__compat_gid_t cgid;
unsigned short int __pad1;
compat_mode_t mode;
unsigned short int __pad2;
unsigned short int seq;
unsigned int __pad3;
unsigned long __unused1; /* yes they really are 64bit pads */
unsigned long __unused2;
};

struct compat_semid64_ds {
struct compat_ipc64_perm sem_perm;
compat_time_t sem_otime;
unsigned int __unused1;
compat_time_t sem_ctime;
unsigned int __unused2;
compat_ulong_t sem_nsems;
compat_ulong_t __unused3;
compat_ulong_t __unused4;
};

struct compat_msqid64_ds {
struct compat_ipc64_perm msg_perm;
unsigned int __unused1;
compat_time_t msg_stime;
unsigned int __unused2;
compat_time_t msg_rtime;
unsigned int __unused3;
compat_time_t msg_ctime;
compat_ulong_t msg_cbytes;
compat_ulong_t msg_qnum;
compat_ulong_t msg_qbytes;
compat_pid_t msg_lspid;
compat_pid_t msg_lrpid;
compat_ulong_t __unused4;
compat_ulong_t __unused5;
};

struct compat_shmid64_ds {
struct compat_ipc64_perm shm_perm;
unsigned int __unused1;
compat_time_t shm_atime;
unsigned int __unused2;
compat_time_t shm_dtime;
unsigned int __unused3;
compat_time_t shm_ctime;
unsigned int __unused4;
compat_size_t shm_segsz;
compat_pid_t shm_cpid;
compat_pid_t shm_lpid;
compat_ulong_t shm_nattch;
compat_ulong_t __unused5;
compat_ulong_t __unused6;
};

/*
* A pointer passed in from user mode. This should not
* be used for syscall parameters, just declare them
Expand Down
50 changes: 0 additions & 50 deletions arch/parisc/include/asm/compat_rt_sigframe.h

This file was deleted.

2 changes: 1 addition & 1 deletion arch/parisc/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ typedef unsigned long elf_greg_t;
#define ELF_PLATFORM ("PARISC\0")

#define SET_PERSONALITY(ex) \
current->personality = PER_LINUX; \
set_personality((current->personality & ~PER_MASK) | PER_LINUX); \
current->thread.map_base = DEFAULT_MAP_BASE; \
current->thread.task_size = DEFAULT_TASK_SIZE \

Expand Down
4 changes: 2 additions & 2 deletions arch/parisc/include/asm/floppy.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ static int fd_request_irq(void)
{
if(can_use_virtual_dma)
return request_irq(FLOPPY_IRQ, floppy_hardint,
IRQF_DISABLED, "floppy", NULL);
0, "floppy", NULL);
else
return request_irq(FLOPPY_IRQ, floppy_interrupt,
IRQF_DISABLED, "floppy", NULL);
0, "floppy", NULL);
}

static unsigned long dma_mem_alloc(unsigned long size)
Expand Down
7 changes: 3 additions & 4 deletions arch/parisc/include/asm/mmzone.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#ifndef _PARISC_MMZONE_H
#define _PARISC_MMZONE_H

#define MAX_PHYSMEM_RANGES 8 /* Fix the size for now (current known max is 3) */

#ifdef CONFIG_DISCONTIGMEM

#define MAX_PHYSMEM_RANGES 8 /* Fix the size for now (current known max is 3) */
extern int npmem_ranges;

struct node_map_data {
Expand Down Expand Up @@ -44,7 +45,7 @@ static inline int pfn_to_nid(unsigned long pfn)
return 0;

i = pfn >> PFNNID_SHIFT;
BUG_ON(i >= sizeof(pfnnid_map) / sizeof(pfnnid_map[0]));
BUG_ON(i >= ARRAY_SIZE(pfnnid_map));
r = pfnnid_map[i];
BUG_ON(r == 0xff);

Expand All @@ -60,7 +61,5 @@ static inline int pfn_valid(int pfn)
return 0;
}

#else /* !CONFIG_DISCONTIGMEM */
#define MAX_PHYSMEM_RANGES 1
#endif
#endif /* _PARISC_MMZONE_H */
20 changes: 16 additions & 4 deletions arch/parisc/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,27 @@
#include <asm/types.h>
#include <asm/cache.h>

#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
#define copy_page(to,from) copy_user_page_asm((void *)(to), (void *)(from))
#define clear_page(page) clear_page_asm((void *)(page))
#define copy_page(to, from) copy_page_asm((void *)(to), (void *)(from))

struct page;

void copy_user_page_asm(void *to, void *from);
void clear_page_asm(void *page);
void copy_page_asm(void *to, void *from);
void clear_user_page(void *vto, unsigned long vaddr, struct page *pg);
void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
struct page *pg);
void clear_user_page(void *page, unsigned long vaddr, struct page *pg);

/* #define CONFIG_PARISC_TMPALIAS */

#ifdef CONFIG_PARISC_TMPALIAS
void clear_user_highpage(struct page *page, unsigned long vaddr);
#define clear_user_highpage clear_user_highpage
struct vm_area_struct;
void copy_user_highpage(struct page *to, struct page *from,
unsigned long vaddr, struct vm_area_struct *vma);
#define __HAVE_ARCH_COPY_USER_HIGHPAGE
#endif

/*
* These are used to make use of C type-checking..
Expand Down
13 changes: 10 additions & 3 deletions arch/parisc/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@

#include <linux/bitops.h>
#include <linux/spinlock.h>
#include <linux/mm_types.h>
#include <asm/processor.h>
#include <asm/cache.h>

struct vm_area_struct;

/*
* kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
* memory. For the return value to be meaningful, ADDR must be >=
Expand All @@ -40,7 +39,14 @@ struct vm_area_struct;
do{ \
*(pteptr) = (pteval); \
} while(0)
#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)

extern void purge_tlb_entries(struct mm_struct *, unsigned long);

#define set_pte_at(mm, addr, ptep, pteval) \
do { \
set_pte(ptep, pteval); \
purge_tlb_entries(mm, addr); \
} while (0)

#endif /* !__ASSEMBLY__ */

Expand Down Expand Up @@ -466,6 +472,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
old = pte_val(*ptep);
new = pte_val(pte_wrprotect(__pte (old)));
} while (cmpxchg((unsigned long *) ptep, old, new) != old);
purge_tlb_entries(mm, addr);
#else
pte_t old_pte = *ptep;
set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
Expand Down
4 changes: 0 additions & 4 deletions arch/parisc/include/asm/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

#include <uapi/asm/signal.h>


#define _NSIG 64
/* bits-per-word, where word apparently means 'long' not 'int' */
#define _NSIG_BPW BITS_PER_LONG
#define _NSIG_WORDS (_NSIG / _NSIG_BPW)

# ifndef __ASSEMBLY__
#ifdef CONFIG_64BIT
#else
#endif

/* Most things should be clean enough to redefine this at will, if care
is taken to make libc match. */
Expand Down
2 changes: 2 additions & 0 deletions arch/parisc/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
#define __ARCH_WANT_SYS_SIGNAL
#define __ARCH_WANT_SYS_TIME
#define __ARCH_WANT_COMPAT_SYS_TIME
#define __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL
#define __ARCH_WANT_SYS_UTIME
#define __ARCH_WANT_SYS_WAITPID
#define __ARCH_WANT_SYS_SOCKETCALL
Expand All @@ -166,6 +167,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_COMPAT_SYS_SENDFILE

#endif /* __ASSEMBLY__ */

Expand Down
6 changes: 5 additions & 1 deletion arch/parisc/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,12 @@
#define __NR_syncfs (__NR_Linux + 327)
#define __NR_setns (__NR_Linux + 328)
#define __NR_sendmmsg (__NR_Linux + 329)
#define __NR_process_vm_readv (__NR_Linux + 330)
#define __NR_process_vm_writev (__NR_Linux + 331)
#define __NR_kcmp (__NR_Linux + 332)
#define __NR_finit_module (__NR_Linux + 333)

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


#define __IGNORE_select /* newselect */
Expand Down
Loading

0 comments on commit 5f32ed1

Please sign in to comment.