Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avx xor illegal instruction #13

Closed
LocutusOfBorg opened this issue Dec 24, 2017 · 6 comments
Closed

avx xor illegal instruction #13

LocutusOfBorg opened this issue Dec 24, 2017 · 6 comments

Comments

@LocutusOfBorg
Copy link
Contributor

Hello, seems that we are getting illegal instructions on Xen CPUs, when libb2 is built with fat mode on.
this is how libb2 is built [1] and this is the assembly strace

│0x7ffff39b900a <blake2b_init_avx+10> vpxor %xmm0,%xmm0,%xmm0 │
│0x7ffff39b900e <blake2b_init_avx+14> sub $0x48,%rsp │
│0x7ffff39b9012 <blake2b_init_avx+18> mov $0x101,%eax │
│0x7ffff39b9017 <blake2b_init_avx+23> vmovaps %xmm0,(%rsp) │

AVX XOR is not available there

see the complete bug report here [2].
Do you have any clue?

[1] https://buildd.debian.org/status/fetch.php?pkg=libb2&arch=amd64&ver=0.97-4&stamp=1507640440&raw=0

[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884958

@LocutusOfBorg LocutusOfBorg changed the title avx illegal instruction avx xor illegal instruction Dec 24, 2017
@sneves
Copy link
Member

sneves commented Dec 25, 2017

The CPU clearly reports being capable of AVX, so the most likely culprit is that the kernel itself does not support saving and restoring the entire AVX context.

I already do this check for WIndows, but incorrectly assumed that Linux would always do the right thing.

@sneves
Copy link
Member

sneves commented Dec 25, 2017

Commit 60ea749 should have fixed this, but I have currently no way of testing this.

@LocutusOfBorg
Copy link
Contributor Author

I pushed the fix on debian/experimental, and requested for feedbacks.

I packaged the latest git master to avoid the three patches I was bringing :)

@LocutusOfBorg
Copy link
Contributor Author

builds ongoing there, https://buildd.debian.org/status/package.php?p=libb2&suite=experimental

thanks a lot for the quick "fix" :)

@sneves
Copy link
Member

sneves commented Mar 27, 2018

I'm going to assume this resolved the issue.

@sneves sneves closed this as completed Mar 27, 2018
@LocutusOfBorg
Copy link
Contributor Author

yes, it is now building correctly everywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants