svn commit: r323923 - in head: lib/libufs sbin/dumpfs sbin/fsck_ffs sbin/fsdb sbin/newfs sys/kern sys/libkern sys/sys sys/ufs/ffs
Conrad Meyer
cem at freebsd.org
Fri Sep 22 14:42:20 UTC 2017
On Fri, Sep 22, 2017 at 5:45 AM, Kirk McKusick <mckusick at freebsd.org> wrote:
> Author: mckusick
> Date: Fri Sep 22 12:45:15 2017
> New Revision: 323923
> URL: https://svnweb.freebsd.org/changeset/base/323923
>
> Log:
> Continuing efforts to provide hardening of FFS, this change adds a
> check hash to cylinder groups. If a check hash fails when a cylinder
> group is read, no further allocations are attempted in that cylinder
> group until it has been fixed by fsck. This avoids a class of
> filesystem panics related to corrupted cylinder group maps. The
> hash is done using crc32c.
>
> ...
>
> Modified: head/sys/libkern/crc32.c
> ==============================================================================
> --- head/sys/libkern/crc32.c Fri Sep 22 12:07:03 2017 (r323922)
> +++ head/sys/libkern/crc32.c Fri Sep 22 12:45:15 2017 (r323923)
> @@ -759,6 +762,7 @@ calculate_crc32c(uint32_t crc32c,
> const unsigned char *buffer,
> unsigned int length)
> {
> +#ifdef _KERNEL
> #if defined(__amd64__) || defined(__i386__)
> if ((cpu_feature2 & CPUID2_SSE42) != 0) {
> return (sse42_crc32c(crc32c, buffer, length));
> @@ -776,6 +780,7 @@ calculate_crc32c(uint32_t crc32c,
> return (armv8_crc32c(crc32c, buffer, length));
> } else
> #endif
> +#endif /* _KERNEL */
> if (length < 4) {
> return (singletable_crc32c(crc32c, buffer, length));
> } else {
Userspace x86 ought to be able to use the SSE-enhanced implementation,
too. It will just need a cpuid check, and can skip the FPU context
manipulation.
Best,
Conrad
More information about the svn-src-head
mailing list