Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1309557

Re: [PATCH v6 20/21] all: s390: make compat wrappers the generic solution

From Yury Norov <ynorov@caviumnetworks.com>
Newsgroups linux.kernel
Subject Re: [PATCH v6 20/21] all: s390: make compat wrappers the generic solution
Date 2016-01-14 19:20 +0100
Message-ID <qQUF4-2np-11@gated-at.bofh.it> (permalink)
References <qQTSG-1KH-7@gated-at.bofh.it> <qQTSG-1KH-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jan 14, 2016 at 08:23:17PM +0300, Yury Norov wrote:
> The problem that makes us to use wrappers is that some compat
> architectures allows user code to access top halves of registers.
> This is not a problem for syscalls that are already handled by compat
> code, or for that who has types of the same size in kernel and
> userspace. In case of lp64/ilp32 the problem is in pointer types, long,
> unsigned long.
> 
> S390 folks already have the solution for it. In this patch,
> it is turned to be general, as arm64/ilp32 needs it too.
> 
> Build-tested on s390.
> 
> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> ---

[...]

> +#ifndef __SC_COMPAT_CAST
> +#define __SC_COMPAT_CAST(t, a)	((t)(long) ((t)(-1) < 0 ? (s32)(a) : (u32)(a)))
> +#endif

It should be like:
#define __SC_COMPAT_CAST(t, a)	((t) ((t)(-1) < 0 ? (s64)(s32)(a) : (u64)(u32)(a)))

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC5 PATCH v6 00/21] ILP32 for ARM64 Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 16/21] arm64: signal32: move ilp32 and aarch32 common code to separated file Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 09/21] arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64 Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 05/21] arm64: compat: change config dependences to aarch32 Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 19/21] arm64:ilp32: add ARM64_ILP32 to Kconfig Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 15/21] arm64: signal: share lp64 signal routines to ilp32 Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 08/21] arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat) Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 18/21] arm64:ilp32: add vdso-ilp32 and use for signal return Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 13/21] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 02/21] arm64: ensure the kernel is compiled for LP64 Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 04/21] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 07/21] thread: move thread bits accessors to separated file Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 10/21] arm64: introduce binfmt_elf32.c Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 17/21] arm64: ilp32: introduce ilp32-specific handlers for sigframe Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 12/21] arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32 Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  [PATCH v6 11/21] arm64: ilp32: introduce binfmt_ilp32.c Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 18:30 +0100
  Re: [PATCH v6 20/21] all: s390: make compat wrappers the generic  solution Yury Norov <ynorov@caviumnetworks.com> - 2016-01-14 19:20 +0100
  Re: [PATCH v6 20/21] all: s390: make compat wrappers the generic  solution Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-01-15 13:50 +0100
    Re: [PATCH v6 20/21] all: s390: make compat wrappers the generic  solution Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-01-20 09:20 +0100
      Re: [PATCH v6 20/21] all: s390: make compat wrappers the generic  solution Yury Norov <ynorov@caviumnetworks.com> - 2016-01-20 13:20 +0100
  Re: [RFC5 PATCH v6 00/21] ILP32 for ARM64 "Zhangjian (Bamvor)" <bamvor.zhangjian@huawei.com> - 2016-01-18 14:20 +0100
    Re: [RFC5 PATCH v6 00/21] ILP32 for ARM64 Andreas Schwab <schwab@suse.de> - 2016-01-18 14:30 +0100
      Re: [RFC5 PATCH v6 00/21] ILP32 for ARM64 Bamvor Zhang Jian <bamvor.zhangjian@linaro.org> - 2016-01-18 14:50 +0100

csiph-web