Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6: (23 commits)
  parisc: move dereference_function_descriptor to process.c
  parisc: Move kernel Elf_Fdesc define to <asm/elf.h>
  parisc: fix build when ARCH_HAS_KMAP
  parisc: fix "make tar-pkg"
  parisc: drivers: fix warnings
  parisc: select BUG always
  parisc: asm/pdc.h should include asm/page.h
  parisc: led: remove proc_dir_entry::owner
  parisc: fix macro expansion in atomic.h
  parisc: iosapic: fix build breakage
  parisc: oops_enter()/oops_exit() in die()
  parisc: document light weight syscall ABI
  parisc: blink all or loadavg LEDs on oops
  parisc: add ftrace (function and graph tracer) functionality
  parisc: simplify sys_clone()
  parisc: add LATENCYTOP_SUPPORT and CONFIG_STACKTRACE_SUPPORT
  parisc: allow to build with 16k default kernel page size
  parisc: expose 32/64-bit capabilities in cpuinfo
  parisc: use constants instead of numbers in assembly
  parisc: fix usage of 32bit PTE page table entries on 32bit kernels
  ...
  • Loading branch information
torvalds committed Apr 3, 2009
2 parents bad6a5c + b609308 commit 3ba113d
Show file tree
Hide file tree
Showing 34 changed files with 540 additions and 122 deletions.
10 changes: 10 additions & 0 deletions arch/parisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ config PARISC
def_bool y
select HAVE_IDE
select HAVE_OPROFILE
select HAVE_FUNCTION_TRACER if 64BIT
select HAVE_FUNCTION_GRAPH_TRACER if 64BIT
select HAVE_FUNCTION_TRACE_MCOUNT_TEST if 64BIT
select RTC_CLASS
select RTC_DRV_GENERIC
select INIT_ALL_POSSIBLE
select BUG
help
The PA-RISC microprocessor is designed by Hewlett-Packard and used
in many of their workstations & servers (HP9000 700 and 800 series,
Expand Down Expand Up @@ -75,6 +79,9 @@ config GENERIC_HARDIRQS
config GENERIC_IRQ_PROBE
def_bool y

config HAVE_LATENCYTOP_SUPPORT
def_bool y

config IRQ_PER_CPU
bool
default y
Expand All @@ -83,6 +90,9 @@ config IRQ_PER_CPU
config PM
bool

config STACKTRACE_SUPPORT
def_bool y

config ISA_DMA_API
bool

Expand Down
4 changes: 3 additions & 1 deletion arch/parisc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ cflags-y += -mdisable-fpregs

# Without this, "ld -r" results in .text sections that are too big
# (> 0x40000) for branches to reach stubs.
cflags-y += -ffunction-sections
ifndef CONFIG_FUNCTION_TRACER
cflags-y += -ffunction-sections
endif

# select which processor to optimise for
cflags-$(CONFIG_PA7100) += -march=1.1 -mschedule=7100
Expand Down
18 changes: 9 additions & 9 deletions arch/parisc/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Since "a" is usually an address, use one spinlock per cacheline.
*/
# define ATOMIC_HASH_SIZE 4
# define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
# define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))

extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;

Expand Down Expand Up @@ -222,13 +222,13 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)

#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)

#define atomic_add(i,v) ((void)(__atomic_add_return( ((int)i),(v))))
#define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)i),(v))))
#define atomic_add(i,v) ((void)(__atomic_add_return( ((int)(i)),(v))))
#define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)(i)),(v))))
#define atomic_inc(v) ((void)(__atomic_add_return( 1,(v))))
#define atomic_dec(v) ((void)(__atomic_add_return( -1,(v))))

#define atomic_add_return(i,v) (__atomic_add_return( ((int)i),(v)))
#define atomic_sub_return(i,v) (__atomic_add_return(-((int)i),(v)))
#define atomic_add_return(i,v) (__atomic_add_return( ((int)(i)),(v)))
#define atomic_sub_return(i,v) (__atomic_add_return(-((int)(i)),(v)))
#define atomic_inc_return(v) (__atomic_add_return( 1,(v)))
#define atomic_dec_return(v) (__atomic_add_return( -1,(v)))

Expand Down Expand Up @@ -289,13 +289,13 @@ atomic64_read(const atomic64_t *v)
return v->counter;
}

#define atomic64_add(i,v) ((void)(__atomic64_add_return( ((s64)i),(v))))
#define atomic64_sub(i,v) ((void)(__atomic64_add_return(-((s64)i),(v))))
#define atomic64_add(i,v) ((void)(__atomic64_add_return( ((s64)(i)),(v))))
#define atomic64_sub(i,v) ((void)(__atomic64_add_return(-((s64)(i)),(v))))
#define atomic64_inc(v) ((void)(__atomic64_add_return( 1,(v))))
#define atomic64_dec(v) ((void)(__atomic64_add_return( -1,(v))))

#define atomic64_add_return(i,v) (__atomic64_add_return( ((s64)i),(v)))
#define atomic64_sub_return(i,v) (__atomic64_add_return(-((s64)i),(v)))
#define atomic64_add_return(i,v) (__atomic64_add_return( ((s64)(i)),(v)))
#define atomic64_sub_return(i,v) (__atomic64_add_return(-((s64)(i)),(v)))
#define atomic64_inc_return(v) (__atomic64_add_return( 1,(v)))
#define atomic64_dec_return(v) (__atomic64_add_return( -1,(v)))

Expand Down
3 changes: 3 additions & 0 deletions arch/parisc/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ void mark_rodata_ro(void);

#ifdef CONFIG_PA8X00
/* Only pa8800, pa8900 needs this */

#include <asm/kmap_types.h>

#define ARCH_HAS_KMAP

void kunmap_parisc(void *addr);
Expand Down
10 changes: 10 additions & 0 deletions arch/parisc/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ typedef struct elf64_fdesc {
__u64 gp;
} Elf64_Fdesc;

#ifdef __KERNEL__

#ifdef CONFIG_64BIT
#define Elf_Fdesc Elf64_Fdesc
#else
#define Elf_Fdesc Elf32_Fdesc
#endif /*CONFIG_64BIT*/

#endif /*__KERNEL__*/

/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */

#define PT_HP_TLS (PT_LOOS + 0x0)
Expand Down
25 changes: 25 additions & 0 deletions arch/parisc/include/asm/ftrace.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef _ASM_PARISC_FTRACE_H
#define _ASM_PARISC_FTRACE_H

#ifndef __ASSEMBLY__
extern void mcount(void);

/*
* Stack of return addresses for functions of a thread.
* Used in struct thread_info
*/
struct ftrace_ret_stack {
unsigned long ret;
unsigned long func;
unsigned long long calltime;
};

/*
* Primary handler of a function return.
* It relays on ftrace_return_to_handler.
* Defined in entry.S
*/
extern void return_to_handler(void);
#endif /* __ASSEMBLY__ */

#endif /* _ASM_PARISC_FTRACE_H */
13 changes: 2 additions & 11 deletions arch/parisc/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,7 @@ void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
*/
#define STRICT_MM_TYPECHECKS
#ifdef STRICT_MM_TYPECHECKS
typedef struct { unsigned long pte;
#if !defined(CONFIG_64BIT)
unsigned long future_flags;
/* XXX: it's possible to remove future_flags and change BITS_PER_PTE_ENTRY
to 2, but then strangely the identical 32bit kernel boots on a
c3000(pa20), but not any longer on a 715(pa11).
Still investigating... HelgeD.
*/
#endif
} pte_t; /* either 32 or 64bit */
typedef struct { unsigned long pte; } pte_t; /* either 32 or 64bit */

/* NOTE: even on 64 bits, these entries are __u32 because we allocate
* the pmd and pgd in ZONE_DMA (i.e. under 4GB) */
Expand Down Expand Up @@ -111,7 +102,7 @@ extern int npmem_ranges;
#define BITS_PER_PMD_ENTRY 2
#define BITS_PER_PGD_ENTRY 2
#else
#define BITS_PER_PTE_ENTRY 3
#define BITS_PER_PTE_ENTRY 2
#define BITS_PER_PMD_ENTRY 2
#define BITS_PER_PGD_ENTRY BITS_PER_PMD_ENTRY
#endif
Expand Down
4 changes: 4 additions & 0 deletions arch/parisc/include/asm/pdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#define PDC_MODEL_CPU_ID 6 /* returns cpu-id (only newer machines!) */
#define PDC_MODEL_CAPABILITIES 7 /* returns OS32/OS64-flags */
/* Values for PDC_MODEL_CAPABILITIES non-equivalent virtual aliasing support */
#define PDC_MODEL_OS64 (1 << 0)
#define PDC_MODEL_OS32 (1 << 1)
#define PDC_MODEL_IOPDIR_FDC (1 << 2)
#define PDC_MODEL_NVA_MASK (3 << 4)
#define PDC_MODEL_NVA_SUPPORTED (0 << 4)
Expand Down Expand Up @@ -341,6 +343,8 @@

#ifdef __KERNEL__

#include <asm/page.h> /* for __PAGE_OFFSET */

extern int pdc_type;

/* Values for pdc_type */
Expand Down
15 changes: 10 additions & 5 deletions arch/parisc/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@
printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e))

/* This is the size of the initially mapped kernel memory */
#ifdef CONFIG_64BIT
#define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */
#else
#define KERNEL_INITIAL_ORDER 23 /* 0 to 1<<23 = 8MB */
#endif
#define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER)

#if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB)
Expand Down Expand Up @@ -91,16 +87,25 @@

/* Definitions for 1st level */
#define PGDIR_SHIFT (PMD_SHIFT + BITS_PER_PMD)
#if (PGDIR_SHIFT + PAGE_SHIFT + PGD_ORDER - BITS_PER_PGD_ENTRY) > BITS_PER_LONG
#define BITS_PER_PGD (BITS_PER_LONG - PGDIR_SHIFT)
#else
#define BITS_PER_PGD (PAGE_SHIFT + PGD_ORDER - BITS_PER_PGD_ENTRY)
#endif
#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
#define PGDIR_MASK (~(PGDIR_SIZE-1))
#define PTRS_PER_PGD (1UL << BITS_PER_PGD)
#define USER_PTRS_PER_PGD PTRS_PER_PGD

#ifdef CONFIG_64BIT
#define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD)
#define MAX_ADDRESS (1UL << MAX_ADDRBITS)

#define SPACEID_SHIFT (MAX_ADDRBITS - 32)
#else
#define MAX_ADDRBITS (BITS_PER_LONG)
#define MAX_ADDRESS (1UL << MAX_ADDRBITS)
#define SPACEID_SHIFT 0
#endif

/* This calculates the number of initial pages we need for the initial
* page tables */
Expand Down
3 changes: 2 additions & 1 deletion arch/parisc/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ extern void smp_send_reschedule(int cpu);
extern void smp_send_all_nop(void);

extern void arch_send_call_function_single_ipi(int cpu);
extern void arch_send_call_function_ipi(cpumask_t mask);
extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
#define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask

#endif /* !ASSEMBLY */

Expand Down
15 changes: 15 additions & 0 deletions arch/parisc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,25 @@ obj-y := cache.o pacache.o setup.o traps.o time.o irq.o \
process.o processor.o pdc_cons.o pdc_chassis.o unwind.o \
topology.o

ifdef CONFIG_FUNCTION_TRACER
# Do not profile debug and lowlevel utilities
CFLAGS_REMOVE_ftrace.o = -pg
CFLAGS_REMOVE_cache.o = -pg
CFLAGS_REMOVE_irq.o = -pg
CFLAGS_REMOVE_pacache.o = -pg
CFLAGS_REMOVE_perf.o = -pg
CFLAGS_REMOVE_traps.o = -pg
CFLAGS_REMOVE_unaligned.o = -pg
CFLAGS_REMOVE_unwind.o = -pg
endif

obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_PA11) += pci-dma.o
obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_MODULES) += module.o
obj-$(CONFIG_64BIT) += binfmt_elf32.o sys_parisc32.o signal32.o
obj-$(CONFIG_STACKTRACE)+= stacktrace.o
# only supported for PCX-W/U in 64-bit mode at the moment
obj-$(CONFIG_64BIT) += perf.o perf_asm.o
obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o
obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
60 changes: 48 additions & 12 deletions arch/parisc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,18 @@
STREG \pte,0(\ptep)
.endm

/* bitshift difference between a PFN (based on kernel's PAGE_SIZE)
* to a CPU TLB 4k PFN (4k => 12 bits to shift) */
#define PAGE_ADD_SHIFT (PAGE_SHIFT-12)

/* Drop prot bits and convert to page addr for iitlbt and idtlbt */
.macro convert_for_tlb_insert20 pte
extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\
64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte
depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\
(63-58)+PAGE_ADD_SHIFT,\pte
.endm

/* Convert the pte and prot to tlb insertion values. How
* this happens is quite subtle, read below */
.macro make_insert_tlb spc,pte,prot
Expand Down Expand Up @@ -544,8 +556,7 @@
depi 1,12,1,\prot

/* Drop prot bits and convert to page addr for iitlbt and idtlbt */
extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte
depdi _PAGE_SIZE_ENCODING_DEFAULT,63,63-58,\pte
convert_for_tlb_insert20 \pte
.endm

/* Identical macro to make_insert_tlb above, except it
Expand All @@ -563,8 +574,8 @@

/* Get rid of prot bits and convert to page addr for iitlba */

depi _PAGE_SIZE_ENCODING_DEFAULT,31,ASM_PFN_PTE_SHIFT,\pte
extru \pte,24,25,\pte
depi 0,31,ASM_PFN_PTE_SHIFT,\pte
SHRREG \pte,(ASM_PFN_PTE_SHIFT-(31-26)),\pte
.endm

/* This is for ILP32 PA2.0 only. The TLB insertion needs
Expand Down Expand Up @@ -1244,10 +1255,9 @@ nadtlb_check_flush_20w:
depdi,z 7,7,3,prot
depdi 1,10,1,prot

/* Get rid of prot bits and convert to page addr for idtlbt */
/* Drop prot bits from pte and convert to page addr for idtlbt */
convert_for_tlb_insert20 pte

depdi 0,63,12,pte
extrd,u pte,56,52,pte
idtlbt pte,prot

rfir
Expand Down Expand Up @@ -1337,8 +1347,8 @@ nadtlb_check_flush_11:

/* Get rid of prot bits and convert to page addr for idtlba */

depi 0,31,12,pte
extru pte,24,25,pte
depi 0,31,ASM_PFN_PTE_SHIFT,pte
SHRREG pte,(ASM_PFN_PTE_SHIFT-(31-26)),pte

mfsp %sr1,t0 /* Save sr1 so we can use it in tlb inserts */
mtsp spc,%sr1
Expand Down Expand Up @@ -1403,10 +1413,9 @@ nadtlb_check_flush_20:
depdi,z 7,7,3,prot
depdi 1,10,1,prot

/* Get rid of prot bits and convert to page addr for idtlbt */
/* Drop prot bits from pte and convert to page addr for idtlbt */
convert_for_tlb_insert20 pte

depdi 0,63,12,pte
extrd,u pte,56,32,pte
idtlbt pte,prot

rfir
Expand Down Expand Up @@ -2176,6 +2185,33 @@ syscall_do_resched:
ENDPROC(syscall_exit)


#ifdef CONFIG_FUNCTION_TRACER
.import ftrace_function_trampoline,code
ENTRY(_mcount)
copy %r3, %arg2
b ftrace_function_trampoline
nop
ENDPROC(_mcount)

ENTRY(return_to_handler)
load32 return_trampoline, %rp
copy %ret0, %arg0
copy %ret1, %arg1
b ftrace_return_to_handler
nop
return_trampoline:
copy %ret0, %rp
copy %r23, %ret0
copy %r24, %ret1

.globl ftrace_stub
ftrace_stub:
bv %r0(%rp)
nop
ENDPROC(return_to_handler)
#endif /* CONFIG_FUNCTION_TRACER */


get_register:
/*
* get_register is used by the non access tlb miss handlers to
Expand Down
6 changes: 5 additions & 1 deletion arch/parisc/kernel/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,11 @@ int pdc_model_capabilities(unsigned long *capabilities)
pdc_result[0] = 0; /* preset zero (call may not be implemented!) */
retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0);
convert_to_wide(pdc_result);
*capabilities = pdc_result[0];
if (retval == PDC_OK) {
*capabilities = pdc_result[0];
} else {
*capabilities = PDC_MODEL_OS32;
}
spin_unlock_irqrestore(&pdc_lock, flags);

return retval;
Expand Down
Loading

0 comments on commit 3ba113d

Please sign in to comment.