]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
FPU init: allocate initial state from UMA to ensure alignment
authorvangyzen <vangyzen@FreeBSD.org>
Fri, 12 Jun 2020 21:17:56 +0000 (21:17 +0000)
committervangyzen <vangyzen@FreeBSD.org>
Fri, 12 Jun 2020 21:17:56 +0000 (21:17 +0000)
commit754af14f972870ad1cf3cc64e0bce8ee5f999617
tree3d881a66d85b812995eda38a41086b5df9e37317
parent13341723a90faf64fe0201a985c88393c07f496b
FPU init: allocate initial state from UMA to ensure alignment

The Intel Instruction Set Reference says this about the XSAVE instruction:

    Use of a destination operand not aligned to 64-byte boundary
    (in either 64-bit or 32-bit modes) results in a general-protection
    (#GP) exception.

This alignment happens naturally when all malloc buckets are powers
of two.  However, this change is necessary on some systems when
certain non-power-of-two (and non-multiple of 64) malloc buckets
are defined.

Reviewed by: cem; kib; earlier version by jhb
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D25098
sys/amd64/amd64/fpu.c
sys/i386/i386/npx.c