NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/50332: AVX instructions don't work but OSXSAVE flag is set
The following reply was made to PR kern/50332; it has been noted by GNATS.
From: tg%gmplib.org@localhost (=?utf-8?Q?Torbj=C3=B6rn?= Granlund)
To: gnats-bugs%NetBSD.org@localhost
Cc: kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Subject: Re: kern/50332: AVX instructions don't work but OSXSAVE flag is set
Date: Tue, 13 Oct 2015 09:09:44 +0200
--=-=-=
If this is a bug in NetBSD, it's also a bug on this Linux:
Linux eternium 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) x86_64 GNU/Linux
on a:
model name : Intel(R) Core(TM)2 Duo CPU E8600 @ 3.33GHz
CPU.
This CPU does not support AVX.
Nothing I see says that OSXSAVE implies that AVX instructions are
implemented and working. According to:
https://software.intel.com/en-us/blogs/2011/04/14/is-avx-enabled/
the AVX flag (bit 28) also needs to be asserted.
The test case demos a real bug, please don't dismiss it because a CPU
without AVX cannot execute AVX instructions.
In practice, one of course also tests for AVX. I modified the testcase
to do that in order to clarify things. Attached.
This does not fail on Linux, FreeBSD, OpenBSD, etc. It does fail on
NetBSD. Let me be clear: To see this AVX error, one needs a computer
with AVX hardware.
I've reproduced this on an Intel haswell system, an AMD bulldozer
system, and an AMD piledriver system. All these systems run some
version of NetBSD 7.0 as Dom0, either a prerelease or the release.
I've also reproduced it under NetBSD 6.1.x and NetBSD 7.0 in a DomU. On
the same machines, Linux and FreeBSD DomUs run the testcase fine.
--=-=-=
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=osxsave.c
Content-Transfer-Encoding: base64
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICB1bnNpZ25lZCBpbnQgZWF4LCBlYngs
IGVkeCwgZWN4OwoKICBfX2FzbV9fICgiY3B1aWQiIDogIj1hIiAoZWF4KSwgIj1iIiAoZWJ4KSwg
Ij1kIiAoZWR4KSwgIj1jIiAoZWN4KSA6ICIwIiAoMSkpOwogIGlmICgoZWN4ID4+IDI3KSAmIDEp
IHsKICAgIHByaW50ZigiT1MgY2xhaW1zIEFWWCBpcyBzdXBwb3J0ZWRcbiIpOwoKICAgIHByaW50
ZigiVGVzdGluZyBhbiBBVlggaW5zdHJ1Y3Rpb24uLi4iKTsgZmZsdXNoKHN0ZG91dCk7CiAgICBf
X2FzbV9fIHZvbGF0aWxlICgiLmJ5dGUgMHhjNSwweGViLDB4MTAsMHhkOSIpOwogICAgcHJpbnRm
KCJpdCBzZWVtcyB0byBoYXZlIHdvcmtlZFxuIik7CiAgfQoKICByZXR1cm4gMDsKfQo=
--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
=20=20
--=20
Torbj=C3=B6rn
Please encrypt, key id 0xC8601622
--=-=-=--
Home |
Main Index |
Thread Index |
Old Index