Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Check if xsave is enabled by OS before calling xgetbv in XmmYmmStateSupport #8939

Merged
merged 2 commits into from
Jan 14, 2017

Conversation

cesarblum
Copy link

#8903

It appears that OS X does not enable xsave on older processors (such as the Core 2 Duo in my late 2010 Macbook Air), leading to the process being killed with SIGILL when XmmYmmStateSupport gets called.

This is also causing failures on Travis test runs on OS X for Kestrel (e.g. https://travis-ci.org/aspnet/KestrelHttpServer/jobs/191433640#L1195).

@janvorli

: "eax", "edx" /* registers that are clobbered*/
__asm(" mov $1, %%eax\n" \
" cpuid\n" \
" and $0x18000000, %%ecx\n" /* check for xsave feature set and that it is enabled by the OS */ \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nit - if you do xor %%eax, %%eax right after the cpuid and at line 61 do jne end, you can get rid of the jmp and xor after xgetbv.

@cesarblum cesarblum force-pushed the cesarbs/cpuid-xsave branch from 8e70605 to 0c92960 Compare January 13, 2017 19:43
@cesarblum
Copy link
Author

Updated.

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@janvorli janvorli merged commit 590ff45 into master Jan 14, 2017
@cesarblum cesarblum deleted the cesarbs/cpuid-xsave branch January 14, 2017 00:41
manofstick pushed a commit to manofstick/coreclr that referenced this pull request Jan 16, 2017
…upport (dotnet#8939)

* Check if xsave is enabled by OS before calling xgetbv in XmmYmmStateSupport. Fix #8903

* Add ebx to clobbered registers.
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…upport (dotnet/coreclr#8939)

* Check if xsave is enabled by OS before calling xgetbv in XmmYmmStateSupport. Fix dotnet/coreclr#8903

* Add ebx to clobbered registers.


Commit migrated from dotnet/coreclr@590ff45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants