This avoids a SIGILL when running these tests on QEMU (which
defaults to a basic amd64 CPU without SSE4.2).
This commit also tests the table-based implementations in addition to
testing the hw-accelerated crc32 versions.
Differential D28395
tests/sys/kern/crc32: Check for SSE4.2 before using it arichardson on Jan 28 2021, 10:05 AM. Authored by Tags None Referenced Files
Subscribers
Details This avoids a SIGILL when running these tests on QEMU (which This commit also tests the table-based implementations in addition to
Diff Detail
Event TimelineComment Actions I think the idea here is that CRC32 is part of SSE4.2, which is part of the base feature set of amd64. If you're hitting SIGILL in QEMU in amd64 mode, that suggests QEMU's amd64 emulation is somewhat invalid. However, it's certainly optional on at least some early models of i386. I would suggest:
Comment Actions I think QEMU provides a basic amd64 CPU by default which does not include any newer features (wikipedia suggests SSE4.2 was introduced ~2008). There are probably some flags to enable newer features. I'll try rewriting the test to check the non-accelerated functions and the accelerated ones only if available. Comment Actions Oh, right, amd64 dates to ~2000. I guess only SSE and SSE2 are core amd64 features. Mea culpa.
These tests are intended for the accelerated ones. If you want to add non-accelerated tests, cool, but I think they should be distinct and unconditional. Your existing change mostly LGTM, though please fix the style nits before committing.
Comment Actions Apply review suggestions, noticed that SSE4.2 appears broken for the trailing bytes case.
Comment Actions Turns out the bug was that I messed up the size being passed to the SSE4.2 version. It does work correctly. Comment Actions Oh, ok! That's a pleasant outcome.
|