Commit 148b00b6 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/signal32: Fix sigset_t conversion when copying to user
  powerpc: Fix atomic_xxx_return barrier semantics
  powerpc: Remove buggy 9-year-old test for binutils < 2.12.1
  powerpc/book3e-64: Fix debug support for userspace
  powerpc: Remove extraneous CONFIG_PPC_ADV_DEBUG_REGS define
  powerpc: Revert show_regs() define for readability
  powerpc/ps3: Fix SMP lockdep boot warning
  powerpc/ps3: Fix lost SMP IPIs
  powerpc: Add hvcall.h include to book3s_hv.c
  powerpc/trace: Add a dummy stack frame for trace_hardirqs_off
  powerpc: Copy down exception vectors after feature fixups
  powerpc: panic if we can't instantiate RTAS
  powerpc/4xx: Fix typos in kexec config dependencies
  powerpc/fsl: MCU_MPC8349EMITX wants I2C built-in, modular won't do...
  powerpc/fsl_udc_core: Fix dumb typo
  carma-fpga: Missed switch from of_register_platform_driver()
  powerpc: Fix build breakage in jump_label.c
parents e36d5058 a313f4c5
...@@ -345,7 +345,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE ...@@ -345,7 +345,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE
config KEXEC config KEXEC
bool "kexec system call (EXPERIMENTAL)" bool "kexec system call (EXPERIMENTAL)"
depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP && !47x)) && EXPERIMENTAL depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP && !PPC_47x)) && EXPERIMENTAL
help help
kexec is a system call that implements the ability to shutdown your kexec is a system call that implements the ability to shutdown your
current kernel, and to start another kernel. It is like a reboot current kernel, and to start another kernel. It is like a reboot
......
...@@ -255,12 +255,6 @@ checkbin: ...@@ -255,12 +255,6 @@ checkbin:
echo 'disable kernel modules' ; \ echo 'disable kernel modules' ; \
false ; \ false ; \
fi fi
@if ! /bin/echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; then \
echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' ; \
echo 'correctly with old versions of binutils.' ; \
echo '*** Please upgrade your binutils to 2.12.1 or newer' ; \
false ; \
fi
CLEAN_FILES += $(TOUT) CLEAN_FILES += $(TOUT)
...@@ -49,13 +49,13 @@ static __inline__ int atomic_add_return(int a, atomic_t *v) ...@@ -49,13 +49,13 @@ static __inline__ int atomic_add_return(int a, atomic_t *v)
int t; int t;
__asm__ __volatile__( __asm__ __volatile__(
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: lwarx %0,0,%2 # atomic_add_return\n\ "1: lwarx %0,0,%2 # atomic_add_return\n\
add %0,%1,%0\n" add %0,%1,%0\n"
PPC405_ERR77(0,%2) PPC405_ERR77(0,%2)
" stwcx. %0,0,%2 \n\ " stwcx. %0,0,%2 \n\
bne- 1b" bne- 1b"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
: "=&r" (t) : "=&r" (t)
: "r" (a), "r" (&v->counter) : "r" (a), "r" (&v->counter)
: "cc", "memory"); : "cc", "memory");
...@@ -85,13 +85,13 @@ static __inline__ int atomic_sub_return(int a, atomic_t *v) ...@@ -85,13 +85,13 @@ static __inline__ int atomic_sub_return(int a, atomic_t *v)
int t; int t;
__asm__ __volatile__( __asm__ __volatile__(
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: lwarx %0,0,%2 # atomic_sub_return\n\ "1: lwarx %0,0,%2 # atomic_sub_return\n\
subf %0,%1,%0\n" subf %0,%1,%0\n"
PPC405_ERR77(0,%2) PPC405_ERR77(0,%2)
" stwcx. %0,0,%2 \n\ " stwcx. %0,0,%2 \n\
bne- 1b" bne- 1b"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
: "=&r" (t) : "=&r" (t)
: "r" (a), "r" (&v->counter) : "r" (a), "r" (&v->counter)
: "cc", "memory"); : "cc", "memory");
...@@ -119,13 +119,13 @@ static __inline__ int atomic_inc_return(atomic_t *v) ...@@ -119,13 +119,13 @@ static __inline__ int atomic_inc_return(atomic_t *v)
int t; int t;
__asm__ __volatile__( __asm__ __volatile__(
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: lwarx %0,0,%1 # atomic_inc_return\n\ "1: lwarx %0,0,%1 # atomic_inc_return\n\
addic %0,%0,1\n" addic %0,%0,1\n"
PPC405_ERR77(0,%1) PPC405_ERR77(0,%1)
" stwcx. %0,0,%1 \n\ " stwcx. %0,0,%1 \n\
bne- 1b" bne- 1b"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
: "=&r" (t) : "=&r" (t)
: "r" (&v->counter) : "r" (&v->counter)
: "cc", "xer", "memory"); : "cc", "xer", "memory");
...@@ -163,13 +163,13 @@ static __inline__ int atomic_dec_return(atomic_t *v) ...@@ -163,13 +163,13 @@ static __inline__ int atomic_dec_return(atomic_t *v)
int t; int t;
__asm__ __volatile__( __asm__ __volatile__(
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: lwarx %0,0,%1 # atomic_dec_return\n\ "1: lwarx %0,0,%1 # atomic_dec_return\n\
addic %0,%0,-1\n" addic %0,%0,-1\n"
PPC405_ERR77(0,%1) PPC405_ERR77(0,%1)
" stwcx. %0,0,%1\n\ " stwcx. %0,0,%1\n\
bne- 1b" bne- 1b"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
: "=&r" (t) : "=&r" (t)
: "r" (&v->counter) : "r" (&v->counter)
: "cc", "xer", "memory"); : "cc", "xer", "memory");
...@@ -194,7 +194,7 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u) ...@@ -194,7 +194,7 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
int t; int t;
__asm__ __volatile__ ( __asm__ __volatile__ (
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: lwarx %0,0,%1 # __atomic_add_unless\n\ "1: lwarx %0,0,%1 # __atomic_add_unless\n\
cmpw 0,%0,%3 \n\ cmpw 0,%0,%3 \n\
beq- 2f \n\ beq- 2f \n\
...@@ -202,7 +202,7 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u) ...@@ -202,7 +202,7 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
PPC405_ERR77(0,%2) PPC405_ERR77(0,%2)
" stwcx. %0,0,%1 \n\ " stwcx. %0,0,%1 \n\
bne- 1b \n" bne- 1b \n"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
" subf %0,%2,%0 \n\ " subf %0,%2,%0 \n\
2:" 2:"
: "=&r" (t) : "=&r" (t)
...@@ -226,7 +226,7 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v) ...@@ -226,7 +226,7 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
int t; int t;
__asm__ __volatile__( __asm__ __volatile__(
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ "1: lwarx %0,0,%1 # atomic_dec_if_positive\n\
cmpwi %0,1\n\ cmpwi %0,1\n\
addi %0,%0,-1\n\ addi %0,%0,-1\n\
...@@ -234,7 +234,7 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v) ...@@ -234,7 +234,7 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
PPC405_ERR77(0,%1) PPC405_ERR77(0,%1)
" stwcx. %0,0,%1\n\ " stwcx. %0,0,%1\n\
bne- 1b" bne- 1b"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
"\n\ "\n\
2:" : "=&b" (t) 2:" : "=&b" (t)
: "r" (&v->counter) : "r" (&v->counter)
...@@ -285,12 +285,12 @@ static __inline__ long atomic64_add_return(long a, atomic64_t *v) ...@@ -285,12 +285,12 @@ static __inline__ long atomic64_add_return(long a, atomic64_t *v)
long t; long t;
__asm__ __volatile__( __asm__ __volatile__(
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: ldarx %0,0,%2 # atomic64_add_return\n\ "1: ldarx %0,0,%2 # atomic64_add_return\n\
add %0,%1,%0\n\ add %0,%1,%0\n\
stdcx. %0,0,%2 \n\ stdcx. %0,0,%2 \n\
bne- 1b" bne- 1b"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
: "=&r" (t) : "=&r" (t)
: "r" (a), "r" (&v->counter) : "r" (a), "r" (&v->counter)
: "cc", "memory"); : "cc", "memory");
...@@ -319,12 +319,12 @@ static __inline__ long atomic64_sub_return(long a, atomic64_t *v) ...@@ -319,12 +319,12 @@ static __inline__ long atomic64_sub_return(long a, atomic64_t *v)
long t; long t;
__asm__ __volatile__( __asm__ __volatile__(
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: ldarx %0,0,%2 # atomic64_sub_return\n\ "1: ldarx %0,0,%2 # atomic64_sub_return\n\
subf %0,%1,%0\n\ subf %0,%1,%0\n\
stdcx. %0,0,%2 \n\ stdcx. %0,0,%2 \n\
bne- 1b" bne- 1b"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
: "=&r" (t) : "=&r" (t)
: "r" (a), "r" (&v->counter) : "r" (a), "r" (&v->counter)
: "cc", "memory"); : "cc", "memory");
...@@ -351,12 +351,12 @@ static __inline__ long atomic64_inc_return(atomic64_t *v) ...@@ -351,12 +351,12 @@ static __inline__ long atomic64_inc_return(atomic64_t *v)
long t; long t;
__asm__ __volatile__( __asm__ __volatile__(
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: ldarx %0,0,%1 # atomic64_inc_return\n\ "1: ldarx %0,0,%1 # atomic64_inc_return\n\
addic %0,%0,1\n\ addic %0,%0,1\n\
stdcx. %0,0,%1 \n\ stdcx. %0,0,%1 \n\
bne- 1b" bne- 1b"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
: "=&r" (t) : "=&r" (t)
: "r" (&v->counter) : "r" (&v->counter)
: "cc", "xer", "memory"); : "cc", "xer", "memory");
...@@ -393,12 +393,12 @@ static __inline__ long atomic64_dec_return(atomic64_t *v) ...@@ -393,12 +393,12 @@ static __inline__ long atomic64_dec_return(atomic64_t *v)
long t; long t;
__asm__ __volatile__( __asm__ __volatile__(
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: ldarx %0,0,%1 # atomic64_dec_return\n\ "1: ldarx %0,0,%1 # atomic64_dec_return\n\
addic %0,%0,-1\n\ addic %0,%0,-1\n\
stdcx. %0,0,%1\n\ stdcx. %0,0,%1\n\
bne- 1b" bne- 1b"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
: "=&r" (t) : "=&r" (t)
: "r" (&v->counter) : "r" (&v->counter)
: "cc", "xer", "memory"); : "cc", "xer", "memory");
...@@ -418,13 +418,13 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v) ...@@ -418,13 +418,13 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v)
long t; long t;
__asm__ __volatile__( __asm__ __volatile__(
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: ldarx %0,0,%1 # atomic64_dec_if_positive\n\ "1: ldarx %0,0,%1 # atomic64_dec_if_positive\n\
addic. %0,%0,-1\n\ addic. %0,%0,-1\n\
blt- 2f\n\ blt- 2f\n\
stdcx. %0,0,%1\n\ stdcx. %0,0,%1\n\
bne- 1b" bne- 1b"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
"\n\ "\n\
2:" : "=&r" (t) 2:" : "=&r" (t)
: "r" (&v->counter) : "r" (&v->counter)
...@@ -450,14 +450,14 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) ...@@ -450,14 +450,14 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
long t; long t;
__asm__ __volatile__ ( __asm__ __volatile__ (
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: ldarx %0,0,%1 # __atomic_add_unless\n\ "1: ldarx %0,0,%1 # __atomic_add_unless\n\
cmpd 0,%0,%3 \n\ cmpd 0,%0,%3 \n\
beq- 2f \n\ beq- 2f \n\
add %0,%2,%0 \n" add %0,%2,%0 \n"
" stdcx. %0,0,%1 \n\ " stdcx. %0,0,%1 \n\
bne- 1b \n" bne- 1b \n"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
" subf %0,%2,%0 \n\ " subf %0,%2,%0 \n\
2:" 2:"
: "=&r" (t) : "=&r" (t)
......
...@@ -124,14 +124,14 @@ static __inline__ unsigned long fn( \ ...@@ -124,14 +124,14 @@ static __inline__ unsigned long fn( \
return (old & mask); \ return (old & mask); \
} }
DEFINE_TESTOP(test_and_set_bits, or, PPC_RELEASE_BARRIER, DEFINE_TESTOP(test_and_set_bits, or, PPC_ATOMIC_ENTRY_BARRIER,
PPC_ACQUIRE_BARRIER, 0) PPC_ATOMIC_EXIT_BARRIER, 0)
DEFINE_TESTOP(test_and_set_bits_lock, or, "", DEFINE_TESTOP(test_and_set_bits_lock, or, "",
PPC_ACQUIRE_BARRIER, 1) PPC_ACQUIRE_BARRIER, 1)
DEFINE_TESTOP(test_and_clear_bits, andc, PPC_RELEASE_BARRIER, DEFINE_TESTOP(test_and_clear_bits, andc, PPC_ATOMIC_ENTRY_BARRIER,
PPC_ACQUIRE_BARRIER, 0) PPC_ATOMIC_EXIT_BARRIER, 0)
DEFINE_TESTOP(test_and_change_bits, xor, PPC_RELEASE_BARRIER, DEFINE_TESTOP(test_and_change_bits, xor, PPC_ATOMIC_ENTRY_BARRIER,
PPC_ACQUIRE_BARRIER, 0) PPC_ATOMIC_EXIT_BARRIER, 0)
static __inline__ int test_and_set_bit(unsigned long nr, static __inline__ int test_and_set_bit(unsigned long nr,
volatile unsigned long *addr) volatile unsigned long *addr)
......
...@@ -11,12 +11,13 @@ ...@@ -11,12 +11,13 @@
#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
__asm__ __volatile ( \ __asm__ __volatile ( \
PPC_RELEASE_BARRIER \ PPC_ATOMIC_ENTRY_BARRIER \
"1: lwarx %0,0,%2\n" \ "1: lwarx %0,0,%2\n" \
insn \ insn \
PPC405_ERR77(0, %2) \ PPC405_ERR77(0, %2) \
"2: stwcx. %1,0,%2\n" \ "2: stwcx. %1,0,%2\n" \
"bne- 1b\n" \ "bne- 1b\n" \
PPC_ATOMIC_EXIT_BARRIER \
"li %1,0\n" \ "li %1,0\n" \
"3: .section .fixup,\"ax\"\n" \ "3: .section .fixup,\"ax\"\n" \
"4: li %1,%3\n" \ "4: li %1,%3\n" \
...@@ -92,14 +93,14 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, ...@@ -92,14 +93,14 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
return -EFAULT; return -EFAULT;
__asm__ __volatile__ ( __asm__ __volatile__ (
PPC_RELEASE_BARRIER PPC_ATOMIC_ENTRY_BARRIER
"1: lwarx %1,0,%3 # futex_atomic_cmpxchg_inatomic\n\ "1: lwarx %1,0,%3 # futex_atomic_cmpxchg_inatomic\n\
cmpw 0,%1,%4\n\ cmpw 0,%1,%4\n\
bne- 3f\n" bne- 3f\n"
PPC405_ERR77(0,%3) PPC405_ERR77(0,%3)
"2: stwcx. %5,0,%3\n\ "2: stwcx. %5,0,%3\n\
bne- 1b\n" bne- 1b\n"
PPC_ACQUIRE_BARRIER PPC_ATOMIC_EXIT_BARRIER
"3: .section .fixup,\"ax\"\n\ "3: .section .fixup,\"ax\"\n\
4: li %0,%6\n\ 4: li %0,%6\n\
b 3b\n\ b 3b\n\
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define MSR_ MSR_ME | MSR_CE #define MSR_ MSR_ME | MSR_CE
#define MSR_KERNEL MSR_ | MSR_64BIT #define MSR_KERNEL MSR_ | MSR_64BIT
#define MSR_USER32 MSR_ | MSR_PR | MSR_EE | MSR_DE #define MSR_USER32 MSR_ | MSR_PR | MSR_EE
#define MSR_USER64 MSR_USER32 | MSR_64BIT #define MSR_USER64 MSR_USER32 | MSR_64BIT
#elif defined (CONFIG_40x) #elif defined (CONFIG_40x)
#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR|MSR_CE) #define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR|MSR_CE)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#ifdef __powerpc64__ #ifdef __powerpc64__
extern char _end[]; extern char __end_interrupts[];
static inline int in_kernel_text(unsigned long addr) static inline int in_kernel_text(unsigned long addr)
{ {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup; extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;
extern void do_lwsync_fixups(unsigned long value, void *fixup_start, extern void do_lwsync_fixups(unsigned long value, void *fixup_start,
void *fixup_end); void *fixup_end);
extern void do_final_fixups(void);
static inline void eieio(void) static inline void eieio(void)
{ {
...@@ -43,9 +44,13 @@ static inline void isync(void) ...@@ -43,9 +44,13 @@ static inline void isync(void)
MAKE_LWSYNC_SECTION_ENTRY(97, __lwsync_fixup); MAKE_LWSYNC_SECTION_ENTRY(97, __lwsync_fixup);
#define PPC_ACQUIRE_BARRIER "\n" stringify_in_c(__PPC_ACQUIRE_BARRIER) #define PPC_ACQUIRE_BARRIER "\n" stringify_in_c(__PPC_ACQUIRE_BARRIER)
#define PPC_RELEASE_BARRIER stringify_in_c(LWSYNC) "\n" #define PPC_RELEASE_BARRIER stringify_in_c(LWSYNC) "\n"
#define PPC_ATOMIC_ENTRY_BARRIER "\n" stringify_in_c(LWSYNC) "\n"
#define PPC_ATOMIC_EXIT_BARRIER "\n" stringify_in_c(sync) "\n"
#else #else
#define PPC_ACQUIRE_BARRIER #define PPC_ACQUIRE_BARRIER
#define PPC_RELEASE_BARRIER #define PPC_RELEASE_BARRIER
#define PPC_ATOMIC_ENTRY_BARRIER
#define PPC_ATOMIC_EXIT_BARRIER
#endif #endif
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -215,7 +215,22 @@ reenable_mmu: /* re-enable mmu so we can */ ...@@ -215,7 +215,22 @@ reenable_mmu: /* re-enable mmu so we can */
stw r9,8(r1) stw r9,8(r1)
stw r11,12(r1) stw r11,12(r1)
stw r3,ORIG_GPR3(r1) stw r3,ORIG_GPR3(r1)
/*
* The trace_hardirqs_off will use CALLER_ADDR0 and CALLER_ADDR1.
* If from user mode there is only one stack frame on the stack, and
* accessing CALLER_ADDR1 will cause oops. So we need create a dummy
* stack frame to make trace_hardirqs_off happy.
*/
andi. r12,r12,MSR_PR
beq 11f
stwu r1,-16(r1)
bl trace_hardirqs_off
addi r1,r1,16
b 12f
11:
bl trace_hardirqs_off bl trace_hardirqs_off
12:
lwz r0,GPR0(r1) lwz r0,GPR0(r1)
lwz r3,ORIG_GPR3(r1) lwz r3,ORIG_GPR3(r1)
lwz r4,GPR4(r1) lwz r4,GPR4(r1)
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/jump_label.h> #include <linux/jump_label.h>
#include <asm/code-patching.h> #include <asm/code-patching.h>
#ifdef HAVE_JUMP_LABEL
void arch_jump_label_transform(struct jump_entry *entry, void arch_jump_label_transform(struct jump_entry *entry,
enum jump_label_type type) enum jump_label_type type)
{ {
...@@ -21,3 +22,4 @@ void arch_jump_label_transform(struct jump_entry *entry, ...@@ -21,3 +22,4 @@ void arch_jump_label_transform(struct jump_entry *entry,
else else
patch_instruction(addr, PPC_INST_NOP); patch_instruction(addr, PPC_INST_NOP);
} }
#endif
...@@ -132,7 +132,6 @@ static void kvm_patch_ins_b(u32 *inst, int addr) ...@@ -132,7 +132,6 @@ static void kvm_patch_ins_b(u32 *inst, int addr)
/* On relocatable kernels interrupts handlers and our code /* On relocatable kernels interrupts handlers and our code
can be in different regions, so we don't patch them */ can be in different regions, so we don't patch them */
extern u32 __end_interrupts;
if ((ulong)inst < (ulong)&__end_interrupts) if ((ulong)inst < (ulong)&__end_interrupts)
return; return;
#endif #endif
......
...@@ -738,7 +738,7 @@ relocate_new_kernel: ...@@ -738,7 +738,7 @@ relocate_new_kernel:
mr r5, r31 mr r5, r31
li r0, 0 li r0, 0
#elif defined(CONFIG_44x) && !defined(CONFIG_47x) #elif defined(CONFIG_44x) && !defined(CONFIG_PPC_47x)
/* /*
* Code for setting up 1:1 mapping for PPC440x for KEXEC * Code for setting up 1:1 mapping for PPC440x for KEXEC
......
...@@ -486,28 +486,6 @@ struct task_struct *__switch_to(struct task_struct *prev, ...@@ -486,28 +486,6 @@ struct task_struct *__switch_to(struct task_struct *prev,
new_thread = &new->thread; new_thread = &new->thread;
old_thread = &current->thread; old_thread = &current->thread;
#if defined(CONFIG_PPC_BOOK3E_64)
/* XXX Current Book3E code doesn't deal with kernel side DBCR0,
* we always hold the user values, so we set it now.
*
* However, we ensure the kernel MSR:DE is appropriately cleared too
* to avoid spurrious single step exceptions in the kernel.
*
* This will have to change to merge with the ppc32 code at some point,
* but I don't like much what ppc32 is doing today so there's some
* thinking needed there
*/
if ((new_thread->dbcr0 | old_thread->dbcr0) & DBCR0_IDM) {
u32 dbcr0;
mtmsr(mfmsr() & ~MSR_DE);
isync();
dbcr0 = mfspr(SPRN_DBCR0);
dbcr0 = (dbcr0 & DBCR0_EDM) | new_thread->dbcr0;
mtspr(SPRN_DBCR0, dbcr0);
}
#endif /* CONFIG_PPC64_BOOK3E */
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
/* /*
* Collect processor utilization data per process * Collect processor utilization data per process
...@@ -657,7 +635,7 @@ void show_regs(struct pt_regs * regs) ...@@ -657,7 +635,7 @@ void show_regs(struct pt_regs * regs)
if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR)) if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
printk("CFAR: "REG"\n", regs->orig_gpr3); printk("CFAR: "REG"\n", regs->orig_gpr3);
if (trap == 0x300 || trap == 0x600) if (trap == 0x300 || trap == 0x600)
#ifdef CONFIG_PPC_ADV_DEBUG_REGS #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr); printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr);
#else #else
printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr); printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr);
......
...@@ -1579,10 +1579,8 @@ static void __init prom_instantiate_rtas(void) ...@@ -1579,10 +1579,8 @@ static void __init prom_instantiate_rtas(void)
return; return;
base = alloc_down(size, PAGE_SIZE, 0); base = alloc_down(size, PAGE_SIZE, 0);
if (base == 0) { if (base == 0)
prom_printf("RTAS allocation failed !\n"); prom_panic("Could not allocate memory for RTAS\n");
return;
}
rtas_inst = call_prom("open", 1, 1, ADDR("/rtas")); rtas_inst = call_prom("open", 1, 1, ADDR("/rtas"));
if (!IHANDLE_VALID(rtas_inst)) { if (!IHANDLE_VALID(rtas_inst)) {
......
...@@ -107,6 +107,8 @@ notrace unsigned long __init early_init(unsigned long dt_ptr) ...@@ -107,6 +107,8 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
PTRRELOC(&__start___lwsync_fixup), PTRRELOC(&__start___lwsync_fixup),
PTRRELOC(&__stop___lwsync_fixup)); PTRRELOC(&__stop___lwsync_fixup));
do_final_fixups();
return KERNELBASE + offset; return KERNELBASE + offset;
} }
......
...@@ -359,6 +359,7 @@ void __init setup_system(void) ...@@ -359,6 +359,7 @@ void __init setup_system(void)
&__start___fw_ftr_fixup, &__stop___fw_ftr_fixup); &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup);
do_lwsync_fixups(cur_cpu_spec->cpu_features, do_lwsync_fixups(cur_cpu_spec->cpu_features,
&__start___lwsync_fixup, &__stop___lwsync_fixup); &__start___lwsync_fixup, &__stop___lwsync_fixup);
do_final_fixups();
/* /*
* Unflatten the device-tree passed by prom_init or kexec * Unflatten the device-tree passed by prom_init or kexec
......
...@@ -97,7 +97,7 @@ static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set) ...@@ -97,7 +97,7 @@ static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set)
compat_sigset_t cset; compat_sigset_t cset;
switch (_NSIG_WORDS) { switch (_NSIG_WORDS) {
case 4: cset.sig[5] = set->sig[3] & 0xffffffffull; case 4: cset.sig[6] = set->sig[3] & 0xffffffffull;
cset.sig[7] = set->sig[3] >> 32; cset.sig[7] = set->sig[3] >> 32;
case 3: cset.sig[4] = set->sig[2] & 0xffffffffull; case 3: cset.sig[4] = set->sig[2] & 0xffffffffull;
cset.sig[5] = set->sig[2] >> 32; cset.sig[5] = set->sig[2] >> 32;
......
...@@ -1298,14 +1298,12 @@ void __kprobes DebugException(struct pt_regs *regs, unsigned long debug_status) ...@@ -1298,14 +1298,12 @@ void __kprobes DebugException(struct pt_regs *regs, unsigned long debug_status)
if (user_mode(regs)) { if (user_mode(regs)) {
current->thread.dbcr0 &= ~DBCR0_IC; current->thread.dbcr0 &= ~DBCR0_IC;
#ifdef CONFIG_PPC_ADV_DEBUG_REGS
if (DBCR_ACTIVE_EVENTS(current->thread.dbcr0, if (DBCR_ACTIVE_EVENTS(current->thread.dbcr0,
current->thread.dbcr1)) current->thread.dbcr1))
regs->msr |= MSR_DE; regs->msr |= MSR_DE;
else else
/* Make sure the IDM bit is off */ /* Make sure the IDM bit is off */
current->thread.dbcr0 &= ~DBCR0_IDM; current->thread.dbcr0 &= ~DBCR0_IDM;
#endif
} }
_exception(SIGTRAP, regs, TRAP_TRACE, regs->nip); _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/cputhreads.h> #include <asm/cputhreads.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/hvcall.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/cputable.h> #include <asm/cputable.h>
#include <asm/code-patching.h> #include <asm/code-patching.h>
#include <asm/page.h>
#include <asm/sections.h>
struct fixup_entry { struct fixup_entry {
...@@ -128,6 +130,27 @@ void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end) ...@@ -128,6 +130,27 @@ void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end)
} }
} }
void do_final_fixups(void)
{
#if defined(CONFIG_PPC64) && defined(CONFIG_RELOCATABLE)
int *src, *dest;
unsigned long length;
if (PHYSICAL_START == 0)
return;
src = (int *)(KERNELBASE + PHYSICAL_START);
dest = (int *)KERNELBASE;
length = (__end_interrupts - _stext) / sizeof(int);
while (length--) {
patch_instruction(dest, *src);
src++;
dest++;
}
#endif
}
#ifdef CONFIG_FTR_FIXUP_SELFTEST #ifdef CONFIG_FTR_FIXUP_SELFTEST
#define check(x) \ #define check(x) \
......
...@@ -347,7 +347,7 @@ config SIMPLE_GPIO ...@@ -347,7 +347,7 @@ config SIMPLE_GPIO
config MCU_MPC8349EMITX config MCU_MPC8349EMITX
bool "MPC8349E-mITX MCU driver" bool "MPC8349E-mITX MCU driver"
depends on I2C && PPC_83xx depends on I2C=y && PPC_83xx
select GENERIC_GPIO select GENERIC_GPIO
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
help help
......
...@@ -88,6 +88,7 @@ struct ps3_private { ...@@ -88,6 +88,7 @@ struct ps3_private {
struct ps3_bmp bmp __attribute__ ((aligned (PS3_BMP_MINALIGN))); struct ps3_bmp bmp __attribute__ ((aligned (PS3_BMP_MINALIGN)));
u64 ppe_id; u64 ppe_id;
u64 thread_id; u64 thread_id;
unsigned long ipi_mask;
}; };
static DEFINE_PER_CPU(struct ps3_private, ps3_private); static DEFINE_PER_CPU(struct ps3_private, ps3_private);
...@@ -144,6 +145,10 @@ static void ps3_chip_unmask(struct irq_data *d) ...@@ -144,6 +145,10 @@ static void ps3_chip_unmask(struct irq_data *d)
static void ps3_chip_eoi(struct irq_data *d) static void ps3_chip_eoi(struct irq_data *d)
{ {
const struct ps3_private *pd = irq_data_get_irq_chip_data(d); const struct ps3_private *pd = irq_data_get_irq_chip_data(d);
/* non-IPIs are EOIed here. */
if (!test_bit(63 - d->irq, &pd->ipi_mask))
lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, d->irq); lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, d->irq);
} }
...@@ -691,6 +696,16 @@ void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq) ...@@ -691,6 +696,16 @@ void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq)
cpu, virq, pd->bmp.ipi_debug_brk_mask); cpu, virq, pd->bmp.ipi_debug_brk_mask);
} }
void __init ps3_register_ipi_irq(unsigned int cpu, unsigned int virq)
{
struct ps3_private *pd = &per_cpu(ps3_private, cpu);
set_bit(63 - virq, &pd->ipi_mask);
DBG("%s:%d: cpu %u, virq %u, ipi_mask %lxh\n", __func__, __LINE__,
cpu, virq, pd->ipi_mask);
}
static unsigned int ps3_get_irq(void) static unsigned int ps3_get_irq(void)
{ {
struct ps3_private *pd = &__get_cpu_var(ps3_private); struct ps3_private *pd = &__get_cpu_var(ps3_private);
...@@ -720,6 +735,12 @@ static unsigned int ps3_get_irq(void) ...@@ -720,6 +735,12 @@ static unsigned int ps3_get_irq(void)
BUG(); BUG();
} }
#endif #endif
/* IPIs are EOIed here. */
if (test_bit(63 - plug, &pd->ipi_mask))
lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, plug);
return plug; return plug;
} }
......
...@@ -43,6 +43,7 @@ void ps3_mm_shutdown(void); ...@@ -43,6 +43,7 @@ void ps3_mm_shutdown(void);
void ps3_init_IRQ(void); void ps3_init_IRQ(void);
void ps3_shutdown_IRQ(int cpu); void ps3_shutdown_IRQ(int cpu);
void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq); void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq);
void __init ps3_register_ipi_irq(unsigned int cpu, unsigned int virq);
/* smp */ /* smp */
......
...@@ -59,11 +59,9 @@ static void ps3_smp_message_pass(int cpu, int msg) ...@@ -59,11 +59,9 @@ static void ps3_smp_message_pass(int cpu, int msg)
static int ps3_smp_probe(void) static int ps3_smp_probe(void)
{ {
return 2; int cpu;
}
static void __init ps3_smp_setup_cpu(int cpu) for (cpu = 0; cpu < 2; cpu++) {
{
int result; int result;
unsigned int *virqs = per_cpu(ps3_ipi_virqs, cpu); unsigned int *virqs = per_cpu(ps3_ipi_virqs, cpu);
int i; int i;
...@@ -94,11 +92,16 @@ static void __init ps3_smp_setup_cpu(int cpu) ...@@ -94,11 +92,16 @@ static void __init ps3_smp_setup_cpu(int cpu)
if (result) if (result)
virqs[i] = NO_IRQ; virqs[i] = NO_IRQ;
else
ps3_register_ipi_irq(cpu, virqs[i]);
} }
ps3_register_ipi_debug_brk(cpu, virqs[PPC_MSG_DEBUGGER_BREAK]); ps3_register_ipi_debug_brk(cpu, virqs[PPC_MSG_DEBUGGER_BREAK]);
DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu); DBG(" <- %s:%d: (%d)\n", __func__, __LINE__, cpu);
}
return 2;
} }
void ps3_smp_cleanup_cpu(int cpu) void ps3_smp_cleanup_cpu(int cpu)
...@@ -121,7 +124,6 @@ static struct smp_ops_t ps3_smp_ops = { ...@@ -121,7 +124,6 @@ static struct smp_ops_t ps3_smp_ops = {
.probe = ps3_smp_probe, .probe = ps3_smp_probe,
.message_pass = ps3_smp_message_pass, .message_pass = ps3_smp_message_pass,
.kick_cpu = smp_generic_kick_cpu, .kick_cpu = smp_generic_kick_cpu,
.setup_cpu = ps3_smp_setup_cpu,
}; };
void smp_init_ps3(void) void smp_init_ps3(void)
......
...@@ -945,8 +945,7 @@ static int fpga_of_remove(struct platform_device *op) ...@@ -945,8 +945,7 @@ static int fpga_of_remove(struct platform_device *op)
/* CTL-CPLD Version Register */ /* CTL-CPLD Version Register */
#define CTL_CPLD_VERSION 0x2000 #define CTL_CPLD_VERSION 0x2000
static int fpga_of_probe(struct platform_device *op, static int fpga_of_probe(struct platform_device *op)
const struct of_device_id *match)
{ {
struct device_node *of_node = op->dev.of_node; struct device_node *of_node = op->dev.of_node;
struct device *this_device; struct device *this_device;
...@@ -1107,7 +1106,7 @@ static struct of_device_id fpga_of_match[] = { ...@@ -1107,7 +1106,7 @@ static struct of_device_id fpga_of_match[] = {
{}, {},
}; };
static struct of_platform_driver fpga_of_driver = { static struct platform_driver fpga_of_driver = {
.probe = fpga_of_probe, .probe = fpga_of_probe,
.remove = fpga_of_remove, .remove = fpga_of_remove,
.driver = { .driver = {
...@@ -1124,12 +1123,12 @@ static struct of_platform_driver fpga_of_driver = { ...@@ -1124,12 +1123,12 @@ static struct of_platform_driver fpga_of_driver = {
static int __init fpga_init(void) static int __init fpga_init(void)
{ {
led_trigger_register_simple("fpga", &ledtrig_fpga); led_trigger_register_simple("fpga", &ledtrig_fpga);
return of_register_platform_driver(&fpga_of_driver); return platform_driver_register(&fpga_of_driver);
} }
static void __exit fpga_exit(void) static void __exit fpga_exit(void)
{ {
of_unregister_platform_driver(&fpga_of_driver); platform_driver_unregister(&fpga_of_driver);
led_trigger_unregister_simple(ledtrig_fpga); led_trigger_unregister_simple(ledtrig_fpga);
} }
......
...@@ -1249,8 +1249,7 @@ static bool dma_filter(struct dma_chan *chan, void *data) ...@@ -1249,8 +1249,7 @@ static bool dma_filter(struct dma_chan *chan, void *data)
return true; return true;
} }
static int data_of_probe(struct platform_device *op, static int data_of_probe(struct platform_device *op)
const struct of_device_id *match)
{ {
struct device_node *of_node = op->dev.of_node; struct device_node *of_node = op->dev.of_node;
struct device *this_device; struct device *this_device;
...@@ -1401,7 +1400,7 @@ static struct of_device_id data_of_match[] = { ...@@ -1401,7 +1400,7 @@ static struct of_device_id data_of_match[] = {
{}, {},
}; };
static struct of_platform_driver data_of_driver = { static struct platform_driver data_of_driver = {
.probe = data_of_probe, .probe = data_of_probe,
.remove = data_of_remove, .remove = data_of_remove,
.driver = { .driver = {
...@@ -1417,12 +1416,12 @@ static struct of_platform_driver data_of_driver = { ...@@ -1417,12 +1416,12 @@ static struct of_platform_driver data_of_driver = {
static int __init data_init(void) static int __init data_init(void)
{ {
return of_register_platform_driver(&data_of_driver); return platform_driver_register(&data_of_driver);
} }
static void __exit data_exit(void) static void __exit data_exit(void)
{ {
of_unregister_platform_driver(&data_of_driver); platform_driver_unregister(&data_of_driver);
} }
MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>"); MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>");
......
...@@ -1717,7 +1717,7 @@ static void dtd_complete_irq(struct fsl_udc *udc) ...@@ -1717,7 +1717,7 @@ static void dtd_complete_irq(struct fsl_udc *udc)
static inline enum usb_device_speed portscx_device_speed(u32 reg) static inline enum usb_device_speed portscx_device_speed(u32 reg)
{ {
switch (speed & PORTSCX_PORT_SPEED_MASK) { switch (reg & PORTSCX_PORT_SPEED_MASK) {
case PORTSCX_PORT_SPEED_HIGH: case PORTSCX_PORT_SPEED_HIGH:
return USB_SPEED_HIGH; return USB_SPEED_HIGH;
case PORTSCX_PORT_SPEED_FULL: case PORTSCX_PORT_SPEED_FULL:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment