[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160114181143.GA11048@yury-N73SV>
Date: Thu, 14 Jan 2016 21:11:43 +0300
From: Yury Norov <ynorov@...iumnetworks.com>
To: <arnd@...db.de>, <catalin.marinas@....com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
CC: <schwidefsky@...ibm.com>, <heiko.carstens@...ibm.com>,
<pinskia@...il.com>, <Prasun.Kapoor@...iumnetworks.com>,
<schwab@...e.de>, <Nathan_Lynch@...tor.com>, <agraf@...e.de>,
<klimov.linux@...il.com>, <broonie@...nel.org>,
<jan.dakinevich@...il.com>, <joseph@...esourcery.com>,
<christoph.muellner@...obroma-systems.com>
Subject: Re: [PATCH v6 20/21] all: s390: make compat wrappers the generic
solution
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@...iumnetworks.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)))
Powered by blists - more mailing lists