From c8837434e8bfd08abf3b596dbaeffe4a8b59a284 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 4 Aug 2010 17:30:21 -0700 Subject: sparc64: Add missing ID to parport probing code. SunBlade-2500 has 'parallel' device node with compatible property "pnpALI,1533,3" so add that to the ID table. Reported-by: Mikael Pettersson Tested-by: Mikael Pettersson Signed-off-by: David S. Miller --- arch/sparc/include/asm/parport.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/sparc/include') diff --git a/arch/sparc/include/asm/parport.h b/arch/sparc/include/asm/parport.h index 4f7afa0..aa4c826 100644 --- a/arch/sparc/include/asm/parport.h +++ b/arch/sparc/include/asm/parport.h @@ -228,6 +228,10 @@ static const struct of_device_id ecpp_match[] = { .name = "parallel", .compatible = "ns87317-ecpp", }, + { + .name = "parallel", + .compatible = "pnpALI,1533,3", + }, {}, }; -- cgit v1.1 From b11287e8c5b2797b86351f6db0fcd9ff99b20bab Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 8 Aug 2010 22:03:59 -0700 Subject: sparc64: Fix perf_arch_get_caller_regs(). After b0f82b81fe6bbcf78d478071f33e44554726bc81 ("perf: Drop the skip argument from perf_arch_fetch_regs_caller") the build broke on sparc64 due to the lack of a module symbol export of __perf_arch_fetch_caller_regs. But that assembler helper can actually be complete eliminated now that the semantics of this interface have been greatly simplified. Signed-off-by: David S. Miller --- arch/sparc/include/asm/perf_event.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'arch/sparc/include') diff --git a/arch/sparc/include/asm/perf_event.h b/arch/sparc/include/asm/perf_event.h index 74c4e0c..727af70 100644 --- a/arch/sparc/include/asm/perf_event.h +++ b/arch/sparc/include/asm/perf_event.h @@ -10,11 +10,26 @@ extern void set_perf_event_pending(void); extern void init_hw_perf_events(void); -extern void -__perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip); - -#define perf_arch_fetch_caller_regs(pt_regs, ip) \ - __perf_arch_fetch_caller_regs(pt_regs, ip, 1); +#define perf_arch_fetch_caller_regs(regs, ip) \ +do { \ + unsigned long _pstate, _asi, _pil, _i7, _fp; \ + __asm__ __volatile__("rdpr %%pstate, %0\n\t" \ + "rd %%asi, %1\n\t" \ + "rdpr %%pil, %2\n\t" \ + "mov %%i7, %3\n\t" \ + "mov %%i6, %4\n\t" \ + : "=r" (_pstate), \ + "=r" (_asi), \ + "=r" (_pil), \ + "=r" (_i7), \ + "=r" (_fp)); \ + (regs)->tstate = (_pstate << 8) | \ + (_asi << 24) | (_pil << 20); \ + (regs)->tpc = (ip); \ + (regs)->tnpc = (regs)->tpc + 4; \ + (regs)->u_regs[UREG_I6] = _fp; \ + (regs)->u_regs[UREG_I7] = _i7; \ +} while (0) #else static inline void init_hw_perf_events(void) { } #endif -- cgit v1.1 From 4cb6066af9ee58ddba58a63cc77b324ac21add75 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 9 Aug 2010 00:45:46 -0700 Subject: sparc: Kill user copy check code. For whatever reason GCC isn't able to figure things out in the control flow (in particular when min() and max() expressions are involved) on sparc as well as it can on x86. So lots of useless incorrect user copy warnings get spewed and the full-on compile failure mode of the user copy checks were never usable on sparc at all. People can debug these kinds of problems on x86. Signed-off-by: David S. Miller --- arch/sparc/include/asm/uaccess_32.h | 15 --------------- arch/sparc/include/asm/uaccess_64.h | 23 +++++------------------ 2 files changed, 5 insertions(+), 33 deletions(-) (limited to 'arch/sparc/include') diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h index 25f1d10..8303ac4 100644 --- a/arch/sparc/include/asm/uaccess_32.h +++ b/arch/sparc/include/asm/uaccess_32.h @@ -260,23 +260,8 @@ static inline unsigned long __copy_to_user(void __user *to, const void *from, un return __copy_user(to, (__force void __user *) from, n); } -extern void copy_from_user_overflow(void) -#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS - __compiletime_error("copy_from_user() buffer size is not provably correct") -#else - __compiletime_warning("copy_from_user() buffer size is not provably correct") -#endif -; - static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) { - int sz = __compiletime_object_size(to); - - if (unlikely(sz != -1 && sz < n)) { - copy_from_user_overflow(); - return n; - } - if (n && __access_ok((unsigned long) from, n)) return __copy_user((__force void __user *) to, from, n); else diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h index 2406788..3e1449f 100644 --- a/arch/sparc/include/asm/uaccess_64.h +++ b/arch/sparc/include/asm/uaccess_64.h @@ -205,14 +205,6 @@ __asm__ __volatile__( \ extern int __get_user_bad(void); -extern void copy_from_user_overflow(void) -#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS - __compiletime_error("copy_from_user() buffer size is not provably correct") -#else - __compiletime_warning("copy_from_user() buffer size is not provably correct") -#endif -; - extern unsigned long __must_check ___copy_from_user(void *to, const void __user *from, unsigned long size); @@ -221,16 +213,11 @@ extern unsigned long copy_from_user_fixup(void *to, const void __user *from, static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long size) { - int sz = __compiletime_object_size(to); - unsigned long ret = size; - - if (likely(sz == -1 || sz >= size)) { - ret = ___copy_from_user(to, from, size); - if (unlikely(ret)) - ret = copy_from_user_fixup(to, from, size); - } else { - copy_from_user_overflow(); - } + unsigned long ret = ___copy_from_user(to, from, size); + + if (unlikely(ret)) + ret = copy_from_user_fixup(to, from, size); + return ret; } #define __copy_from_user copy_from_user -- cgit v1.1