Commit eb5249b1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull parisc architecture updates from Helge Deller:

 - A fix to make modules on 32-bit parisc architecture work again

 - Drop ip_fast_csum() inline assembly to avoid unaligned memory
   accesses

 - Allow to build kernel without 32-bit VDSO

 - Reference leak fix in error path in LED driver

* tag 'parisc-for-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: led: fix reference leak on failed device registration
  module.lds.S: Fix modules on 32-bit parisc architecture
  parisc: Allow to build without VDSO32
  parisc: Include 32-bit VDSO only when building for 32-bit or compat mode
  parisc: Allow to disable COMPAT mode on 64-bit kernel
  parisc: Fix default stack size when COMPAT=n
  parisc: Fix signal code to depend on CONFIG_COMPAT instead of CONFIG_64BIT
  parisc: is_compat_task() shall return false for COMPAT=n
  parisc: Avoid compat syscalls when COMPAT=n
  parisc: _llseek syscall is only available for 32-bit userspace
  parisc: Drop ip_fast_csum() inline assembly implementation
  parisc: update outdated comments for renamed ccio_alloc_consistent()
parents 9055c645 707610bc
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1127,6 +1127,13 @@ config ARCH_WANTS_MODULES_DATA_IN_VMALLOC
	  For architectures like powerpc/32 which have constraints on module
	  allocation and need to allocate module data outside of module area.

config ARCH_WANTS_MODULES_TEXT_SECTIONS
	bool
	help
	  For architectures like 32-bit parisc which require that functions in
	  modules have to keep code in own text sections (-ffunction-sections)
	  and to avoid merging all text into one big text section,

config ARCH_WANTS_EXECMEM_LATE
	bool
	help
+6 −1
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ config PARISC
	select HAVE_FUNCTION_GRAPH_TRACER
	select HAVE_SYSCALL_TRACEPOINTS
	select ARCH_WANT_FRAME_POINTERS
	select ARCH_WANTS_MODULES_TEXT_SECTIONS if !64BIT
	select ARCH_HAS_CPU_CACHE_ALIASING
	select ARCH_HAS_DMA_ALLOC if PA11
	select ARCH_HAS_DMA_OPS
@@ -130,6 +131,9 @@ config GENERIC_BUG
config GENERIC_BUG_RELATIVE_POINTERS
	bool

config GENERIC_CSUM
	def_bool y

config GENERIC_HWEIGHT
	bool
	default y
@@ -354,7 +358,8 @@ config ARCH_SPARSEMEM_DEFAULT
source "kernel/Kconfig.hz"

config COMPAT
	def_bool y
	bool "Kernel support for 32-bit binaries"
	default 64BIT
	depends on 64BIT

config AUDIT_ARCH
+4 −2
Original line number Diff line number Diff line
@@ -176,10 +176,12 @@ prepare: vdso_prepare
vdso_prepare: prepare0
	$(if $(CONFIG_64BIT),$(Q)$(MAKE) \
		$(build)=arch/parisc/kernel/vdso64 include/generated/vdso64-offsets.h)
	$(Q)$(MAKE) $(build)=arch/parisc/kernel/vdso32 include/generated/vdso32-offsets.h
	$(if $(CONFIG_PA11)$(CONFIG_COMPAT),$(Q)$(MAKE) \
		$(build)=arch/parisc/kernel/vdso32 include/generated/vdso32-offsets.h)
endif

vdso-install-y			+= arch/parisc/kernel/vdso32/vdso32.so
vdso-install-$(CONFIG_PA11)	+= arch/parisc/kernel/vdso32/vdso32.so
vdso-install-$(CONFIG_COMPAT)	+= arch/parisc/kernel/vdso32/vdso32.so
vdso-install-$(CONFIG_64BIT)	+= arch/parisc/kernel/vdso64/vdso64.so

install: KBUILD_IMAGE := vmlinux
+2 −87
Original line number Diff line number Diff line
@@ -4,73 +4,7 @@

#include <linux/in6.h>

/*
 * computes the checksum of a memory block at buff, length len,
 * and adds in "sum" (32-bit)
 *
 * returns a 32-bit number suitable for feeding into itself
 * or csum_tcpudp_magic
 *
 * this function must be called with even lengths, except
 * for the last fragment, which may be odd
 *
 * it's best to have buff aligned on a 32-bit boundary
 */
extern __wsum csum_partial(const void *, int, __wsum);

/*
 *	Optimized for IP headers, which always checksum on 4 octet boundaries.
 *
 *	Written by Randolph Chung <tausq@debian.org>, and then mucked with by
 *	LaMont Jones <lamont@debian.org>
 */
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
{
	unsigned int sum;
	unsigned long t0, t1, t2;

	__asm__ __volatile__ (
"	ldws,ma		4(%1), %0\n"
"	addib,<=	-4, %2, 2f\n"
"\n"
"	ldws		4(%1), %4\n"
"	ldws		8(%1), %5\n"
"	add		%0, %4, %0\n"
"	ldws,ma		12(%1), %3\n"
"	addc		%0, %5, %0\n"
"	addc		%0, %3, %0\n"
"1:	ldws,ma		4(%1), %3\n"
"	addib,>		-1, %2, 1b\n"
"	addc		%0, %3, %0\n"
"\n"
"	extru		%0, 31, 16, %4\n"
"	extru		%0, 15, 16, %5\n"
"	addc		%4, %5, %0\n"
"	extru		%0, 15, 16, %5\n"
"	add		%0, %5, %0\n"
"	subi		-1, %0, %0\n"
"2:\n"
	: "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (t0), "=r" (t1), "=r" (t2)
	: "1" (iph), "2" (ihl)
	: "memory");

	return (__force __sum16)sum;
}

/*
 *	Fold a partial checksum
 */
static inline __sum16 csum_fold(__wsum csum)
{
	u32 sum = (__force u32)csum;
	/* add the swapped two 16-bit halves of sum,
	   a possible carry from adding the two 16-bit halves,
	   will carry from the lower half into the upper half,
	   giving us the correct sum in the upper half. */
	sum += (sum << 16) + (sum >> 16);
	return (__force __sum16)(~sum >> 16);
}
 
#define csum_tcpudp_nofold csum_tcpudp_nofold
static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
					__u32 len, __u8 proto,
					__wsum sum)
@@ -85,26 +19,7 @@ static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
	return sum;
}

/*
 * computes the checksum of the TCP/UDP pseudo-header
 * returns a 16-bit checksum, already complemented
 */
static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
					__u32 len, __u8 proto,
					__wsum sum)
{
	return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
}

/*
 * this routine is used for miscellaneous IP-like checksums, mainly
 * in icmp.c
 */
static inline __sum16 ip_compute_csum(const void *buf, int len)
{
	 return csum_fold (csum_partial(buf, len, 0));
}

#include <asm-generic/checksum.h>

#define _HAVE_ARCH_IPV6_CSUM
static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ typedef compat_ulong_t compat_elf_gregset_t[COMPAT_ELF_NGREG];

static inline int __is_compat_task(struct task_struct *t)
{
	return test_tsk_thread_flag(t, TIF_32BIT);
	return IS_ENABLED(CONFIG_COMPAT) && test_tsk_thread_flag(t, TIF_32BIT);
}

static inline int is_compat_task(void)
Loading