Message ID | 1440158630-29620-1-git-send-email-a.hajda@samsung.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Hans Verkuil |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1ZSl3Z-0000C2-GN; Fri, 21 Aug 2015 14:04:25 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.76/mailfrontend-8) with esmtp id 1ZSl3X-00071F-k6; Fri, 21 Aug 2015 14:04:25 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752102AbbHUMEG (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Fri, 21 Aug 2015 08:04:06 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:10878 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbbHUMEF (ORCPT <rfc822;linux-media@vger.kernel.org>); Fri, 21 Aug 2015 08:04:05 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NTF00784LIQSR10@mailout2.w1.samsung.com> for linux-media@vger.kernel.org; Fri, 21 Aug 2015 13:04:02 +0100 (BST) X-AuditID: cbfec7f4-f79c56d0000012ee-9a-55d713b1e29b Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 1B.F3.04846.1B317D55; Fri, 21 Aug 2015 13:04:02 +0100 (BST) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NTF004C5LIKQF00@eusync4.samsung.com>; Fri, 21 Aug 2015 13:04:01 +0100 (BST) From: Andrzej Hajda <a.hajda@samsung.com> To: Hans Verkuil <hans.verkuil@cisco.com> Cc: linux-media@vger.kernel.org, Andrzej Hajda <a.hajda@samsung.com> Subject: [PATCH] v4l2-compat-ioctl32: fix struct v4l2_event32 alignment Date: Fri, 21 Aug 2015 14:03:50 +0200 Message-id: <1440158630-29620-1-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <55D70787.2080508@xs4all.nl> References: <55D70787.2080508@xs4all.nl> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGJMWRmVeSWpSXmKPExsVy+t/xa7qbhK+HGhydwWhxa905VoslP3cx WfRs2MrqwOwx5fdGVo++LasYPT5vkgtgjuKySUnNySxLLdK3S+DK6Nu8hr3gMEfFnYMH2RsY 29i7GDk5JARMJL6dPMIEYYtJXLi3nq2LkYtDSGApo8SOtavZIZwmJolHLR2sIFVsApoSfzff ZAOxRYDsb9O3MYPYzAIuEjN/LgWzhQXcJVZMvssCYrMIqEps2H0fbAOvgLPE1iMrWCC2yUmc PDYZbCYn0JwLW3+A1QgJaEj0btrHOIGRdwEjwypG0dTS5ILipPRcQ73ixNzi0rx0veT83E2M kND4soNx8TGrQ4wCHIxKPLwzIq+FCrEmlhVX5h5ilOBgVhLhtX4BFOJNSaysSi3Kjy8qzUkt PsQozcGiJM47d9f7ECGB9MSS1OzU1ILUIpgsEwenVAMjpzK3Kbudd4NXxWa+T1uVvJZrM2kb fuc4a+QZbH/q063Lt6byXf00cSlnZwdfkXF9S3owm+NT+dxP6o0v7msKhmhMeCex/yqT3RnP Bo+d92f/sf5/+r6FSUXTrWOJBkWNMzaVXWyPPt18IrJnaz/ftPmPv7W9ElzOeShu67zwtYfK 3Jq008yUWIozEg21mIuKEwGTW+P/CQIAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2015.8.21.120016 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' HTML_NO_HTTP 0.1, MULTIPLE_RCPTS 0.1, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1200_1299 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, NO_URI_HTTPS 0, REFERENCES 0, SINGLE_URI_IN_BODY 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_HTML 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __REFERENCES 0, __SANE_MSGID 0, __SINGLE_URI_TEXT 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_IN_BODY 0, __URI_NO_WWW 0, __URI_NS ' |
Commit Message
Andrzej Hajda
Aug. 21, 2015, 12:03 p.m. UTC
Union v4l2_event::u is aligned to 8 bytes on arm32. On arm64 v4l2_event32::u
is aligned to 4 bytes. As a result structures v4l2_event and v4l2_event32 have
different sizes and VIDOC_DQEVENT ioctl does not work from arm32 apps running
on arm64 kernel. The patch fixes it. Using compat_s64 allows to retain 4 bytes
alignment on x86 architecture.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
Hi Hans,
Tested successfully on arm32 app / arm64 kernel.
Thanks for help.
Regards
Andrzej
---
drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 1 +
1 file changed, 1 insertion(+)
Comments
On 08/21/2015 02:03 PM, Andrzej Hajda wrote: > Union v4l2_event::u is aligned to 8 bytes on arm32. On arm64 v4l2_event32::u > is aligned to 4 bytes. As a result structures v4l2_event and v4l2_event32 have > different sizes and VIDOC_DQEVENT ioctl does not work from arm32 apps running > on arm64 kernel. The patch fixes it. Using compat_s64 allows to retain 4 bytes > alignment on x86 architecture. What about v4l2_standard32 and v4l2_ext_control32? I very strongly suspect that those will break for arm32 apps on an arm64 as well. I prefer a patch that fixes all three... Regards, Hans > > Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> > --- > Hi Hans, > > Tested successfully on arm32 app / arm64 kernel. > Thanks for help. > > Regards > Andrzej > --- > drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c > index af63543..52afffe 100644 > --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c > +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c > @@ -738,6 +738,7 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext > struct v4l2_event32 { > __u32 type; > union { > + compat_s64 value64; > __u8 data[64]; > } u; > __u32 pending; > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index af63543..52afffe 100644 --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -738,6 +738,7 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext struct v4l2_event32 { __u32 type; union { + compat_s64 value64; __u8 data[64]; } u; __u32 pending;