Date: Thu, 9 May 2013 17:25:29 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250415 - head/sys/amd64/amd64 Message-ID: <201305091725.r49HPTOr060454@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Thu May 9 17:25:29 2013 New Revision: 250415 URL: http://svnweb.freebsd.org/changeset/base/250415 Log: Correct the type for the literal used on the left side of the shift up to 63 bit positions. Do not fill the save area and do not set the saved bit in the xstate bit vector for the state which is not marked as enabled in xsave_mask. Reported and tested by: Jim Ohlstein <jim@ohlste.in> MFC after: 3 days Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Thu May 9 17:07:30 2013 (r250414) +++ head/sys/amd64/amd64/fpu.c Thu May 9 17:25:29 2013 (r250415) @@ -687,8 +687,8 @@ fpugetregs(struct thread *td) offsetof(struct xstate_hdr, xstate_bv)); max_ext_n = flsl(xsave_mask); for (i = 0; i < max_ext_n; i++) { - bit = 1 << i; - if ((*xstate_bv & bit) != 0) + bit = 1ULL << i; + if ((xsave_mask & bit) == 0 || (*xstate_bv & bit) != 0) continue; bcopy((char *)fpu_initialstate + xsave_area_desc[i].offset,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305091725.r49HPTOr060454>