From: Serban Constantinescu <Serban.Constantinescu@arm.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kernel-team@android.com" <kernel-team@android.com>,
"arve@android.com" <arve@android.com>,
"john.stultz@linaro.org" <john.stultz@linaro.org>,
Dave Butcher <Dave.Butcher@arm.com>
Subject: Re: [PATCH 1/2] staging: android: ashmem: fix ashmem pin/unpin interface
Date: Fri, 01 Feb 2013 16:55:01 +0000 [thread overview]
Message-ID: <510BF365.2010609@arm.com> (raw)
In-Reply-To: <20130201161836.GA29021@kroah.com>
Hi Greg,
On 01/02/13 16:18, Greg KH wrote:
> On Fri, Feb 01, 2013 at 04:08:00PM +0000, Serban Constantinescu wrote:
>> The values exchanged between kernel and userspace through struct
>> ashmem_pin should be of type size_t. This change won't affect the
>> existing interface but will stand as the basis of 64bit compat layer.
>
> How do you define size_t with a 64bit kernel and a 32bit userspace
> properly? Doesn't this change open up a bunch of problems?
The current ashmem pin/unpin kernel interface uses __u32 to specify the
memory region and length in bytes. However these values should be of
type size_t so that they are able to represent the whole range of
possible values when compiled for a 64bit platform.
Android API uses ashmem driver through libcutils, from where I attach
the following snippet:
<aosp>/system/core/libcutils/ashmem-dev.c
75 int ashmem_pin_region(int fd, size_t offset, size_t len)
76 {
77 struct ashmem_pin pin = { offset, len };
78 return ioctl(fd, ASHMEM_PIN, &pin);
79 }
The kernel changes inline with the userspace usage and do not affect
existing 32bit Android (we have exported the new kernel header, rebuilt
and tested the interface with success).
However this change will affect any 64bit userspace using the current
faulty interface, but there is none that we know of.
Thanks,
Serban Constantinescu
`
next prev parent reply other threads:[~2013-02-01 16:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-01 16:07 [PATCH 0/2] staging: android: ashmem: add 32bit compat support Serban Constantinescu
2013-02-01 16:08 ` [PATCH 1/2] staging: android: ashmem: fix ashmem pin/unpin interface Serban Constantinescu
2013-02-01 16:18 ` Greg KH
2013-02-01 16:55 ` Serban Constantinescu [this message]
2013-02-04 1:41 ` Greg KH
2013-02-04 10:54 ` Serban Constantinescu
2013-02-01 16:08 ` [PATCH 2/2] staging: android: ashmem: Add support for 32bit ashmem calls in a 64bit kernel Serban Constantinescu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=510BF365.2010609@arm.com \
--to=serban.constantinescu@arm.com \
--cc=Dave.Butcher@arm.com \
--cc=arve@android.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.stultz@linaro.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).