Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17c330f9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: Fix clock event multiplier printf format.
  sparc64: Use clock{source,events}_calc_mult_shift().
  sparc64: Use free_bootmem_late() in mdesc_lmb_free().
  sparc: Add alignment and emulation fault perf events.
  sparc64: Add syscall tracepoint support.
  sparc: Stop trying to be so fancy and use __builtin_{memcpy,memset}()
  sparc: Use __builtin_object_size() to validate the buffer size for copy_from_user()
  sparc64: Add some missing __kprobes annotations to kernel fault paths.
  sparc64: Use kprobes_built_in() to avoid ifdefs in fault_64.c
  sparc: Validate that kprobe address is 4-byte aligned.
  sparc64: Don't specify IRQF_SHARED for LDC interrupts.
  sparc64: Fix stack debugging IRQ stack regression.
  sparc64: Fix overly strict range type matching for PCI devices.
parents 48e902f0 7466bd3c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ config SPARC64
	select HAVE_SYSCALL_WRAPPERS
	select HAVE_DYNAMIC_FTRACE
	select HAVE_FTRACE_MCOUNT_RECORD
	select HAVE_SYSCALL_TRACEPOINTS
	select USE_GENERIC_SMP_HELPERS if SMP
	select RTC_DRV_CMOS
	select RTC_DRV_BQ4802
+14 −0
Original line number Diff line number Diff line
@@ -33,4 +33,18 @@ config FRAME_POINTER
	depends on MCOUNT
	default y

config DEBUG_STRICT_USER_COPY_CHECKS
	bool "Strict copy size checks"
	depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
	---help---
	  Enabling this option turns a certain set of sanity checks for user
	  copy operations into compile time failures.

	  The copy_from_user() etc checks are there to help test if there
	  are sufficient security checks on the length argument of
	  the copy operation, by having gcc prove that the argument is
	  within bounds.

	  If unsure, or if you run an older (pre 4.4) gcc, say N.

endmenu
+2 −76
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@
#ifdef __KERNEL__

extern void __memmove(void *,const void *,__kernel_size_t);
extern __kernel_size_t __memcpy(void *,const void *,__kernel_size_t);
extern __kernel_size_t __memset(void *,int,__kernel_size_t);

#ifndef EXPORT_SYMTAB_STROPS

@@ -32,82 +30,10 @@ extern __kernel_size_t __memset(void *,int,__kernel_size_t);
})

#define __HAVE_ARCH_MEMCPY

static inline void *__constant_memcpy(void *to, const void *from, __kernel_size_t n)
{
	extern void __copy_1page(void *, const void *);

	if(n <= 32) {
		__builtin_memcpy(to, from, n);
	} else if (((unsigned int) to & 7) != 0) {
		/* Destination is not aligned on the double-word boundary */
		__memcpy(to, from, n);
	} else {
		switch(n) {
		case PAGE_SIZE:
			__copy_1page(to, from);
			break;
		default:
			__memcpy(to, from, n);
			break;
		}
	}
	return to;
}

static inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_size_t n)
{
	__memcpy(to, from, n);
	return to;
}

#undef memcpy
#define memcpy(t, f, n) \
(__builtin_constant_p(n) ? \
 __constant_memcpy((t),(f),(n)) : \
 __nonconstant_memcpy((t),(f),(n)))
#define memcpy(t, f, n) __builtin_memcpy(t, f, n)

#define __HAVE_ARCH_MEMSET

static inline void *__constant_c_and_count_memset(void *s, char c, __kernel_size_t count)
{
	extern void bzero_1page(void *);
	extern __kernel_size_t __bzero(void *, __kernel_size_t);

	if(!c) {
		if(count == PAGE_SIZE)
			bzero_1page(s);
		else
			__bzero(s, count);
	} else {
		__memset(s, c, count);
	}
	return s;
}

static inline void *__constant_c_memset(void *s, char c, __kernel_size_t count)
{
	extern __kernel_size_t __bzero(void *, __kernel_size_t);

	if(!c)
		__bzero(s, count);
	else
		__memset(s, c, count);
	return s;
}

static inline void *__nonconstant_memset(void *s, char c, __kernel_size_t count)
{
	__memset(s, c, count);
	return s;
}

#undef memset
#define memset(s, c, count) \
(__builtin_constant_p(c) ? (__builtin_constant_p(count) ? \
                            __constant_c_and_count_memset((s), (c), (count)) : \
                            __constant_c_memset((s), (c), (count))) \
                          : __nonconstant_memset((s), (c), (count)))
#define memset(s, c, count) __builtin_memset(s, c, count)

#define __HAVE_ARCH_MEMSCAN

+2 −23
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@

#include <asm/asi.h>

extern void *__memset(void *,int,__kernel_size_t);

#ifndef EXPORT_SYMTAB_STROPS

/* First the mem*() things. */
@@ -24,29 +22,10 @@ extern void *__memset(void *,int,__kernel_size_t);
extern void *memmove(void *, const void *, __kernel_size_t);

#define __HAVE_ARCH_MEMCPY
extern void *memcpy(void *, const void *, __kernel_size_t);
#define memcpy(t, f, n) __builtin_memcpy(t, f, n)

#define __HAVE_ARCH_MEMSET
extern void *__builtin_memset(void *,int,__kernel_size_t);

static inline void *__constant_memset(void *s, int c, __kernel_size_t count)
{
	extern __kernel_size_t __bzero(void *, __kernel_size_t);

	if (!c) {
		__bzero(s, count);
		return s;
	} else
		return __memset(s, c, count);
}

#undef memset
#define memset(s, c, count) \
((__builtin_constant_p(count) && (count) <= 32) ? \
 __builtin_memset((s), (c), (count)) : \
 (__builtin_constant_p(c) ? \
  __constant_memset((s), (c), (count)) : \
  __memset((s), (c), (count))))
#define memset(s, c, count) __builtin_memset(s, c, count)

#define __HAVE_ARCH_MEMSCAN

+2 −0
Original line number Diff line number Diff line
@@ -227,6 +227,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
/* flag bit 8 is available */
#define TIF_SECCOMP		9	/* secure computing */
#define TIF_SYSCALL_AUDIT	10	/* syscall auditing active */
#define TIF_SYSCALL_TRACEPOINT	11	/* syscall tracepoint instrumentation */
/* flag bit 11 is available */
/* NOTE: Thread flags >= 12 should be ones we have no interest
 *       in using in assembly, else we can't use the mask as
@@ -246,6 +247,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
#define _TIF_32BIT		(1<<TIF_32BIT)
#define _TIF_SECCOMP		(1<<TIF_SECCOMP)
#define _TIF_SYSCALL_AUDIT	(1<<TIF_SYSCALL_AUDIT)
#define _TIF_SYSCALL_TRACEPOINT	(1<<TIF_SYSCALL_TRACEPOINT)
#define _TIF_ABI_PENDING	(1<<TIF_ABI_PENDING)
#define _TIF_POLLING_NRFLAG	(1<<TIF_POLLING_NRFLAG)
#define _TIF_FREEZE		(1<<TIF_FREEZE)
Loading