From owner-svn-src-head@freebsd.org Fri Sep 8 15:04:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 283E3E1CAB3 for ; Fri, 8 Sep 2017 15:04:50 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from bat.oak.relay.mailchannels.net (bat.oak.relay.mailchannels.net [23.83.215.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB37182C31 for ; Fri, 8 Sep 2017 15:04:49 +0000 (UTC) (envelope-from ian@freebsd.org) X-Sender-Id: _forwarded-from|73.78.92.27 Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id ED3DA2008A8 for ; Fri, 8 Sep 2017 14:56:46 +0000 (UTC) Received: from outbound1a.eu.mailhop.org (unknown [100.96.134.127]) (Authenticated sender: duocircle) by relay.mailchannels.net (Postfix) with ESMTPA id 4C203200F61 for ; Fri, 8 Sep 2017 14:56:46 +0000 (UTC) X-Sender-Id: _forwarded-from|73.78.92.27 Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [172.20.63.30]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.9.14); Fri, 08 Sep 2017 14:56:46 +0000 X-MC-Relay: Junk X-MailChannels-SenderId: _forwarded-from|73.78.92.27 X-MailChannels-Auth-Id: duocircle X-Reign-Celery: 6d6e61982e5c05df_1504882606746_1108520393 X-MC-Loop-Signature: 1504882606746:3878035952 X-MC-Ingress-Time: 1504882606745 X-MHO-User: ec16db91-94a5-11e7-83af-a91f44540cb3 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id ec16db91-94a5-11e7-83af-a91f44540cb3; Fri, 08 Sep 2017 14:56:42 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v88Euc4u001239; Fri, 8 Sep 2017 08:56:38 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1504882598.32063.3.camel@freebsd.org> Subject: Re: svn commit: r323254 - head/sys/compat/freebsd32 From: Ian Lepore To: John Baldwin , Maxim Sobolev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 08 Sep 2017 08:56:38 -0600 In-Reply-To: <6d00a409-2be8-fc15-b68f-993d97366aab@FreeBSD.org> References: <201709070429.v874Tvom033960@repo.freebsd.org> <6d00a409-2be8-fc15-b68f-993d97366aab@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Sep 2017 15:04:50 -0000 On Fri, 2017-09-08 at 08:14 -0400, John Baldwin wrote: > On 9/7/17 12:29 AM, Maxim Sobolev wrote: > >=20 > > Author: sobomax > > Date: Thu Sep=A0=A07 04:29:57 2017 > > New Revision: 323254 > > URL: https://svnweb.freebsd.org/changeset/base/323254 > >=20 > > Log: > > =A0 In the recvmsg32() system call iterate over returned structure(s) > > =A0 and convert any messages of types SCM_BINTIME, SCM_TIMESTAMP, > > =A0 SCM_REALTIME and SCM_MONOTONIC from 64-bit to its 32-bit > > =A0 representation. Otherwise we either run out of user-supplied > > =A0 buffer to copy those out resulting in the MSG_CTRUNC or simply > > =A0 return values that the userland 32-bit code is not going > > =A0 to parse correctly. This fixes at least two regression tests > > =A0 failing to function properly in 32-bit compat mode: > > =A0=A0 > > =A0=A0=A0=A0=A0=A0tools/regression/sockets/udp_pingpong > > =A0=A0=A0=A0=A0=A0tools/regression/sockets/unix_cmsg > > =A0=A0 > > =A0 PR:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0kern/222039 > > =A0 MFC after: 30 days > Is this correct on !amd64?=A0=A0Other 32-bit platforms use a 64-bit tim= e_t > (note the time32_t type defined earlier in freebsd32.h).=A0=A0struct bi= ntime32 > should use time32_t for the seconds field, not uint32_t.=A0=A0I think t= hat > will be sufficient to make this correct on !amd64 (it also means that > bintime32 =3D=3D bintime on !amd64 so you could perhaps use a simpler B= T_CP > for !amd64, but the existing one is probably ok). >=20 The existing one now does *(uint64_t *) on a value that's only aligned to a 32-bit boundary. =A0That will work in practice because only i386 has a 32-bit time_t that will use this code, and it's not a strict- alignment platform. =A0It may still cause compiler warnings about alignment. -- Ian