From owner-freebsd-hackers@FreeBSD.ORG Thu May 20 21:06:46 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37097106564A for ; Thu, 20 May 2010 21:06:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id C579A8FC22 for ; Thu, 20 May 2010 21:06:45 +0000 (UTC) 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 o4KL6jDW087575 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 May 2010 00:06:45 +0300 (EEST) (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.4/8.14.4) with ESMTP id o4KL6WpR072253; Fri, 21 May 2010 00:06:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o4KL6VX5072252; Fri, 21 May 2010 00:06:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 21 May 2010 00:06:31 +0300 From: Kostik Belousov To: bf1783@gmail.com Message-ID: <20100520210631.GI83316@deviant.kiev.zoral.com.ua> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+K5d9Dhw/eNQKwhM" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org Subject: Re: kernel usage of fxsave/fxrstor X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2010 21:06:46 -0000 --+K5d9Dhw/eNQKwhM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 20, 2010 at 01:41:22PM -0400, b. f. wrote: > I'm wondering why we equate cpu_fxsr and hw_instruction_sse in our > kernel, when several families of Intel and AMD processors have > fxsave/fxrstor, but not sse, and various documents from both companies > suggest that fxsave/fxrstor is faster than fsave/fnsave/frstor, even > when only saving the fpu/mmx state, and ought to be used for context > switches and calls and returns from interrupt and exception handlers > (e.g.. Sections 8.1.11, 10.5, and 11.6.5 of the Intel 64 and IA-32 > Software Developers' Manual, Volume 1: >=20 > http://www.intel.com/Assets/PDF/manual/253665.pdf >=20 > ). What are the several families ? I am aware only of Pentium II that did have FXSAVE implemented, but not SSE. I am not even sure that all Pentium IIs have it, or only the later models. It is funny that I disposed my 2CPU Pentium II machine several weeks ago. I do not consider it worth an effort trying to optimize for some Pentiums II in 2010. >=20 >=20 > As far as I can tell from a cursory check, Linux draws a distinction > between cpu_has_fxsr, and cpu_has_xmm/xmm2, and uses fxsave/fxrstor on > all processors that have the feature, regardless of whether they have > sse. Shouldn't we do the same? Was this overlooked in the initial > sse commits? Or are the Intel assertions that the newer instructions > are faster incorrect? Or was the extra handling needed for the > different semantics of the newer instructions, and/or concerns over > FreeBSD-SA-06:14.fpu.asc/CVE-2006-1056 responsible for their > suppression in pre-sse processors, even though safe methods of using > them was suggested: >=20 > http://security.freebsd.org/advisories/FreeBSD-SA-06:14-amd.txt ? >=20 > (Note that I'm not asking about setting the CR4.OSFXSR bit when sse > isn't needed or present, just using the newer fxsave/fxrstor when they > are present.) >=20 > Regards, > b. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" --+K5d9Dhw/eNQKwhM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkv1pFcACgkQC3+MBN1Mb4hlkgCfaGY50BEoZk8dFzYUnKbioeJz Q04AoIzQQgkDe8K4rDWc6ZZ3Qqh/mWRa =7SUo -----END PGP SIGNATURE----- --+K5d9Dhw/eNQKwhM--