From nobody Fri Dec 29 23:08:57 2023 X-Original-To: dev-commits-src-all@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 4T21K62bHpz55TCM; Fri, 29 Dec 2023 23:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T21K574QBz4Gcc; Fri, 29 Dec 2023 23:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703891338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcHZlt+u4Xwarfh0lRBDkfBG4XI9IxDapdEmuxsMRhc=; b=AbZFkLd5RVeWeGSU7w4hBfgcCHs83N5ROv7TKwhs8dwzoqpRVX+u1WB6Cwc79e9v5FxRaJ yLxYMBJI2Tg1u8uQDltjNXm1twN9NRuaBpUBitqXKOKq+xesPle6rcUGaqLcfrK+6IIYiG RUFUwrp5PSeTTkLqN4FrsmM3iNI/d23AagI0LaImsQHSkWoj636JSM+eBYqNucegIWtcC/ WAQGwKivjjELLBeJAMK3MIrkOnL6Lss0BuSncjbuYaB1vF217Q+9OvzWz5XSH7IGw1mBw6 S9Kp2StOqaLbchb56mcK5dZ2vccI6XJn9ZkkIWmVK1zY9EIxotbUVuOGobjNeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703891338; a=rsa-sha256; cv=none; b=K32wQiDyne9fHuUXhZ8C/BscdorL3pRCkgFZFkspW3m4N/MdbypOfyNAQMDpb+jC6T8Mqm 6MYjoanfmZX128FjCMiG3hAzV90o5mmVUv/K7DhvZGSCDQKbIXMIUtV+ZAYN+08Gxv7Ah+ Tpue964lwkTwsrRbbHj0BCcc7niVmW+tSicE5Gx/S8IvJaL+jpyy21OgFaXmhhtHNjZLlA GgDtFYwWuEYeRnUHUbgudqtMSAoiVlQNxl/EaSvVimYIaOcML+sKLEB5vQ38LdHCAy/40n BdnukmqnusVuut7RbFmRAyptjeqaGrFf7SufzXZCFNd703LZNtPWGE+8MCyhkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703891338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcHZlt+u4Xwarfh0lRBDkfBG4XI9IxDapdEmuxsMRhc=; b=fM+zXOheJ1zMbM1kl04CXJvU/N4KAvsSIB5oxLLRynUovtJRyxItO+Yk/tQ+VlINWdu5eT P9AyS33NX7SR/zQunYhIRg3Nn8ma3oHOPSOSzsEs0om2r1E073ITR7KRTjweJwcZJOzMeV QKFwo7LVuxTnENhJHRFRBrYqJ5NA/t/8WlcdMK7TnAEytnkp+uHKgf56fG6N4TlyHWe+ae KzU27QNb3rWc0MMGME4aBHX4BDd/3cruHS4ov1YZ/PWJDCVqiCOEkdiXruMnDnC6Irwox2 85NS+drvnzxhtK3PkQKrW9KgkWOYYEnQYQZ77uMfbSunt1dNrmOi7UusY/bkog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T21K56BJcz9ft; Fri, 29 Dec 2023 23:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BTN8v8w075629; Fri, 29 Dec 2023 23:08:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BTN8vfo075626; Fri, 29 Dec 2023 23:08:57 GMT (envelope-from git) Date: Fri, 29 Dec 2023 23:08:57 GMT Message-Id: <202312292308.3BTN8vfo075626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7945b99a003f - stable/14 - armv8_crypto: Remove dieing flag and rw lock List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7945b99a003fec545140532662412696e93f1ae1 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7945b99a003fec545140532662412696e93f1ae1 commit 7945b99a003fec545140532662412696e93f1ae1 Author: John Baldwin AuthorDate: 2023-08-28 23:23:43 +0000 Commit: John Baldwin CommitDate: 2023-12-29 21:49:42 +0000 armv8_crypto: Remove dieing flag and rw lock crypto_unregister_all already disables new sessions and waits for existing sessions to be destroyed before returning. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D41579 (cherry picked from commit fdd51760c278302773edbd2466d35b35b865f5d9) --- sys/crypto/armv8/armv8_crypto.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/sys/crypto/armv8/armv8_crypto.c b/sys/crypto/armv8/armv8_crypto.c index a8d88c31edc0..fd1d845c29b0 100644 --- a/sys/crypto/armv8/armv8_crypto.c +++ b/sys/crypto/armv8/armv8_crypto.c @@ -44,12 +44,10 @@ #include #include #include -#include #include #include #include #include -#include #include #include @@ -62,9 +60,7 @@ #include struct armv8_crypto_softc { - int dieing; int32_t cid; - struct rwlock lock; bool has_pmul; }; @@ -119,7 +115,6 @@ armv8_crypto_attach(device_t dev) uint64_t reg; sc = device_get_softc(dev); - sc->dieing = 0; reg = READ_SPECIALREG(id_aa64isar0_el1); @@ -133,8 +128,6 @@ armv8_crypto_attach(device_t dev) return (ENOMEM); } - rw_init(&sc->lock, "armv8crypto"); - return (0); } @@ -145,13 +138,8 @@ armv8_crypto_detach(device_t dev) sc = device_get_softc(dev); - rw_wlock(&sc->lock); - sc->dieing = 1; - rw_wunlock(&sc->lock); crypto_unregister_all(sc->cid); - rw_destroy(&sc->lock); - return (0); } @@ -273,21 +261,12 @@ static int armv8_crypto_newsession(device_t dev, crypto_session_t cses, const struct crypto_session_params *csp) { - struct armv8_crypto_softc *sc; struct armv8_crypto_session *ses; int error; - sc = device_get_softc(dev); - rw_wlock(&sc->lock); - if (sc->dieing) { - rw_wunlock(&sc->lock); - return (EINVAL); - } - ses = crypto_get_driver_session(cses); error = armv8_crypto_cipher_setup(ses, csp, csp->csp_cipher_key, csp->csp_cipher_klen); - rw_wunlock(&sc->lock); return (error); }