From owner-svn-src-all@freebsd.org Fri Sep 22 14:42:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69482E00488; Fri, 22 Sep 2017 14:42:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f182.google.com (mail-yw0-f182.google.com [209.85.161.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E20C6ED15; Fri, 22 Sep 2017 14:42:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f182.google.com with SMTP id v72so886624ywa.3; Fri, 22 Sep 2017 07:42:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=DtgvmPKGkj+iwcVa0M3bvihXuZzAY/p6VPm4ou5+8N4=; b=kfb+S3pcsngw9FGA/ZN3TNrUyQJnb1arg5gKrIpoyylcMUOMYhUtdfCWFFmnyPmvD6 22l/rC2w8yc4gnYg9iLiQut9O8vmtrcLjTWavg+A/sW5JGq7At4ePkLXgWlCCGRn1KGJ 14XefmnoFZKwJqFBvtM1GgPSUYTBs6e1ed9WrJjxkr45kQeQsDCyKwoKkIAI9NgoH0Vd UrCimjfbSmpWkgeaCZYKQOp8l81jP9IyPf4MtuD3eucFq5R6IAAF+FZum94ObkVMCiTN jkaFFC1jlx17HcfOvbg1ItX1x5RrsRUrfzuPrEr9fW5+rR2MBJSJsTMT72cZbyXGd8US jVTQ== X-Gm-Message-State: AHPjjUinl53sD1EKl/Byr2IDLd+hyKS4pSS1I/zB74T1PLiFzYhXNZK+ c1WtBjRCajyoVnGMQc/Mm4WX0Ftu X-Received: by 10.13.235.197 with SMTP id u188mr3787530ywe.349.1506090859608; Fri, 22 Sep 2017 07:34:19 -0700 (PDT) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by smtp.gmail.com with ESMTPSA id p125sm1509759ywb.29.2017.09.22.07.34.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Sep 2017 07:34:19 -0700 (PDT) Received: by mail-io0-f181.google.com with SMTP id g32so3489747ioj.2; Fri, 22 Sep 2017 07:34:19 -0700 (PDT) X-Google-Smtp-Source: AOwi7QClKTzWbVUPznc9ts098PKAW5Ljwh83VnuwzCWPaImyetB9S8bDX+QfsSwQkfFfE/LsAegzD329b7pkRVjJ5IE= X-Received: by 10.107.97.5 with SMTP id v5mr8803452iob.68.1506090858862; Fri, 22 Sep 2017 07:34:18 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.137.79 with HTTP; Fri, 22 Sep 2017 07:34:18 -0700 (PDT) In-Reply-To: <201709221245.v8MCjFPv043387@repo.freebsd.org> References: <201709221245.v8MCjFPv043387@repo.freebsd.org> From: Conrad Meyer Date: Fri, 22 Sep 2017 07:34:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: 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 To: Kirk McKusick Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Sep 2017 14:42:20 -0000 On Fri, Sep 22, 2017 at 5:45 AM, Kirk McKusick 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