From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 11:51:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2ED7106564A; Sun, 16 Nov 2008 11:51:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 512578FC1A; Sun, 16 Nov 2008 11:51:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1L1gA0-000PGw-6l; Sun, 16 Nov 2008 13:51:24 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id mAGBpLLd024248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 16 Nov 2008 13:51:21 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id mAGBpKd8004111; Sun, 16 Nov 2008 13:51:20 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id mAGBpKhL004109; Sun, 16 Nov 2008 13:51:20 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 16 Nov 2008 13:51:20 +0200 From: Kostik Belousov To: Doug Ambrisko Message-ID: <20081116115120.GC2037@deviant.kiev.zoral.com.ua> References: <200811142105.mAEL5jsL001886@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GPJrCs/72TxItFYR" Content-Disposition: inline In-Reply-To: <200811142105.mAEL5jsL001886@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1L1gA0-000PGw-6l da89b4840acbf8c58fcec5f045c34f73 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184974 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 16 Nov 2008 11:51:25 -0000 --GPJrCs/72TxItFYR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 14, 2008 at 09:05:45PM +0000, Doug Ambrisko wrote: > Author: ambrisko > Date: Fri Nov 14 21:05:45 2008 > New Revision: 184974 > URL: http://svn.freebsd.org/changeset/base/184974 >=20 > Log: > When running a 32bit app. on amd64, ensure the bits above 32bit > are zero for the copyout. Confirmed by LSI. >=20 > Modified: > head/sys/dev/mfi/mfi.c >=20 > Modified: head/sys/dev/mfi/mfi.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/mfi/mfi.c Fri Nov 14 18:09:19 2008 (r184973) > +++ head/sys/dev/mfi/mfi.c Fri Nov 14 21:05:45 2008 (r184974) > @@ -2130,6 +2130,14 @@ mfi_ioctl(struct cdev *dev, u_long cmd,=20 > ->mfi_frame.raw[ioc->mfi_sense_off], > &sense_ptr.sense_ptr_data[0], > sizeof(sense_ptr.sense_ptr_data)); > +#ifdef __amd64__ > + if (cmd !=3D MFI_CMD) { > + /* > + * not 64bit native so zero out any address > + * over 32bit */ > + sense_ptr.high =3D 0; > + } > +#endif > error =3D copyout(cm->cm_sense, sense_ptr.user_space, > ioc->mfi_sense_len); > if (error !=3D 0) { > @@ -2353,6 +2361,13 @@ mfi_linux_ioctl_int(struct cdev *dev, u_ > ->lioc_frame.raw[l_ioc.lioc_sense_off], > &sense_ptr.sense_ptr_data[0], > sizeof(sense_ptr.sense_ptr_data)); > +#ifdef __amd64__ > + /* > + * only 32bit Linux support so zero out any > + * address over 32bit > + */ > + sense_ptr.high =3D 0; > +#endif > error =3D copyout(cm->cm_sense, sense_ptr.user_space, > l_ioc.lioc_sense_len); > if (error !=3D 0) { Would it make sense to perform this cut slightly more generically, by checking whether the current process is 32bit ? We still have not grew the easy to check flag or attribute of the image, but usual practice is to compare p_sysent with corresponding sysvec, like if (td->td_proc->p_sysent =3D=3D &ia32_freebsd_sysvec) or if (td->td_proc->p_sysent =3D=3D &elf_linux_sysvec) --GPJrCs/72TxItFYR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkgCTgACgkQC3+MBN1Mb4ilSgCcC7rlFS2UrHNAP3Cxwitk5+/0 qc4AoPIXURK4hD+H2KXYnYSdVyvLNqEt =dnux -----END PGP SIGNATURE----- --GPJrCs/72TxItFYR--