From nobody Tue Apr 4 06:25:39 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PrHnp4sfcz432rL; Tue, 4 Apr 2023 06:25:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PrHnp4MW0z3HRq; Tue, 4 Apr 2023 06:25:50 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680589550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ttBG96wIjZJ1xOCATdkSR5LrI6Xai/22CpoF6nlSbN8=; b=rl/wXX+uTPDvkKB6b/75v8IVx3uGg+EtfePWFOzEXebadqMNRWd+N+h7CzM75IMQKByEHX Xkt5hKhPEtGVoeoae8RefXNt7WdznmtwGlD6/C8jcq3iluNed6HUNSS91c++6cdf/HUOE5 /zYtSPnaqx3jxdwJ+iqKQd5puRb6gqT70KfeDpUgQspBWtJ7JgMi8ZjVIywNE8+Vc07kFh k94tW3C6e0xE5jaleBeOHKSYiepo5jVemS7I3Gy5DJgAo+41FKLsIm/8kD+boY3VgU9JQG Ec9M52HyOuLXcI2kFHRZpCu2vacKOHk6QR2LoldB/Mxl0AOstSDO70WioSy/Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680589550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ttBG96wIjZJ1xOCATdkSR5LrI6Xai/22CpoF6nlSbN8=; b=A3iF2hj8jsryQuYEFzcV/SB7jT3wBjU42SzusAkp5Txb3Kf9hl7g3yiEM1vvdEcsRDN+Vw LafGSgWcb+Lu2FXT4Z7QZWNO2h8767jEmqKeqhI0D3HYfOG/qx7mBAX9JAae/82HSCinZ5 eOqyWSCq2l/2JSQpPECAGhrkAApo6ERPchc6ohqcuMfpZhJFUk8fiX4uJ7QrntSTcScyE0 iNfOw9Et53Vu5ZxZLyQU5kTJkAhs8TdnaQu7jF/psO6bTXgUN/SQYXeBDcoaUXyAbVCmLL DunDPGMxmW44n7e7DYpofwnvo6rlezwPPRVFon2YQ6VRUSdasw59tpulMaX2hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680589550; a=rsa-sha256; cv=none; b=HXFJqsvEdE3khR9bI06IpwiL3tF5gq56bvZ74RVg/MndTK2yTaeRjqoz3YOUiyXEG3ra6n xn7Fyx4rF3uyLZdr66OjgI+5HWywQ2XwAhKYs5O36oVtxxL6coRsHHjAHcswT9GzbWob0N 0c7oIyrWbiqE+1A+fCZrsK05H+5ta+ilKw0ppsp7llbvR9kL7o7ZVMoKtmy6EF433AeRQR GbbKrQFkgzyAQnncgudZ0UajX5g5hWiksK6sDe3OFsAd58LV2JxnoQoiM/NNh+pj6jRKIa d/SHkTUB2VQe3v9q8epsYUmMghEeQB5xnHb2tVyfUu2jcvTp5xE8xiPN8chREg== Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4PrHnp3JtfzmQw; Tue, 4 Apr 2023 06:25:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f170.google.com with SMTP id n14so30599794qta.10; Mon, 03 Apr 2023 23:25:50 -0700 (PDT) X-Gm-Message-State: AAQBX9dJVSkX2LnBngVNndzxGEiAvgGWOhLjU8QCn/LGOf02yGF9ECWq 5/hBaPJ3em+ICnkaNyc+3RXeCH1xY36uDcfX7/4= X-Google-Smtp-Source: AKy350byg6Qw1SWy5OPoIR311e+34A16+LcTJAawJ3kb5v6CAtfLLjTa+dQ1N43HuIrEfCAHdBQdiH0d7Gc0lg0NhWY= X-Received: by 2002:ac8:7f93:0:b0:3e3:8172:ff23 with SMTP id z19-20020ac87f93000000b003e38172ff23mr391558qtj.13.1680589549922; Mon, 03 Apr 2023 23:25:49 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202304031513.333FD6qw014903@gitrepo.freebsd.org> In-Reply-To: <202304031513.333FD6qw014903@gitrepo.freebsd.org> From: Kyle Evans Date: Tue, 4 Apr 2023 01:25:39 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 2a58b312b62f - main - zfs: merge openzfs/zfs@431083f75 To: Martin Matuska , Andrew Turner Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N On Mon, Apr 3, 2023 at 10:13=E2=80=AFAM Martin Matuska wro= te: > > The branch main has been updated by mm: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D2a58b312b62f908ec92311d1bd= 8536dbaeb8e55b > > commit 2a58b312b62f908ec92311d1bd8536dbaeb8e55b > Merge: b98fbf3781df 431083f75bdd > Author: Martin Matuska > AuthorDate: 2023-04-03 14:49:30 +0000 > Commit: Martin Matuska > CommitDate: 2023-04-03 14:49:30 +0000 > > zfs: merge openzfs/zfs@431083f75 > > Notable upstream pull request merges: > [... snip ...] > #13741 SHA2 reworking and API for iterating over multiple implement= ations > [... snip ...] This one broke ZFS on aarch64, because kfpu_* are basically stubbed out but should be using fpu_kern(9). I tried the below patch (https://people.freebsd.org/~kevans/zfs-vfp.diff), but it doesn't work. It seems to take a data abort while trying to fetch curthread in kfpu_end() specifically in blake2. It looks like the blake2 implementation is probably clobbering x18, so pcpup is completely bogus and it goes downhill from there. It's late and I don't know off-hand how to cope with that, maybe Andy will have a better idea. Thanks, Kyle Evans --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_aarch64.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/simd_aarch64.h @@ -44,13 +44,23 @@ #define _FREEBSD_SIMD_AARCH64_H #include +#include #include +#include #include +#include #define kfpu_allowed() 1 #define kfpu_initialize(tsk) do {} while (0) -#define kfpu_begin() do {} while (0) -#define kfpu_end() do {} while (0) +#define kfpu_begin() do { \ + if (__predict_false(!is_fpu_kern_thread(0))) \ + fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); \ +} while(0) + +#define kfpu_end() do { \ + if (__predict_false(curthread->td_pcb->pcb_fpflags & PCB_FP_NOSAVE)) \ + fpu_kern_leave(curthread, NULL); \ +} while(0) #define kfpu_init() (0) #define kfpu_fini() do {} while (0)