Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp358078rdb; Thu, 2 Nov 2023 06:01:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlZtHIrj6owDxdVLOYtn0YOD8cyuER5Q/IZXRc+gu0KTrJ6i5jwXyL7q50rbLZf0vpsf0N X-Received: by 2002:a05:6a21:7802:b0:181:a52:6d1c with SMTP id be2-20020a056a21780200b001810a526d1cmr6507290pzc.39.1698930081437; Thu, 02 Nov 2023 06:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698930081; cv=none; d=google.com; s=arc-20160816; b=q1z+1Zs15nH4uO9y7opqhAvT7d3vaWuM87ue0rG7MRX9f3qfo51F/hPn3omQIJDWbk tWF/9XMMyu3VBdv/kLv8F9g8PiPBOZmEiJF/a+bA7KXFWvz/Rnma8yIRntkcoWpyMqYm L9JYZ7nHb+fX/g4A5BZlJTg2UT76SrK4jKv0tx7+2+Iv4ffWSzpx1uYv87b6TzItQBvO XlqGRPIerbFOLucLZQ6cZHEK8rcLQS7xchQkfzZAp2gjHQ2qTMhHGB8pxvqeGEmVafr+ POOIOYLXxOuo01zLcyXPRGKGw067a7H3gKGVxKm8YZtwNd2VpZ9AZtkcb1gHi3A+9sLE 5aQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=fiSblidQcsfmYGZWckTyJbXdKc80oTrNd9n2ZVAfBlI=; fh=R68EmAeCoxXr8BLhw8vOFaUn12ae+zt7q2wLJRh3Oss=; b=hQmCPwJn4IxP+ff68L7VOn/ASHn0qzIIQ5o73r/90TbTL+WtoDpOmC/iEnYrzQwl2+ jUqQKJX+ZeOOzwojdn2PmHSi4Ixhjr2nJxrX7e970muqo01u+BUZiNWOWyXto/mV1NJT xKrH1/11R1pxyBF2378c5q19fcS4Gu4CsT7+iifUZR2qxNjOD0PZGE4KntPQf35hl4l2 VJCXp6kbJihMp52m3BW7PBAywTskadTVhlieMlOy0/u+yZKrl8iODbWIAgoKgrzze3w6 HqZXB9QRx2wrVTQDShDxNbqtynMB1qAUFhzYG7rQozQSAlpt6PxXmuRz4pel83IsiJbc nfIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id w8-20020a63f508000000b005859c81f1f0si1784020pgh.137.2023.11.02.06.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 06:01:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 806088026B7C; Thu, 2 Nov 2023 06:01:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229992AbjKBNBQ convert rfc822-to-8bit (ORCPT + 99 others); Thu, 2 Nov 2023 09:01:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbjKBNBP (ORCPT ); Thu, 2 Nov 2023 09:01:15 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D127C112; Thu, 2 Nov 2023 06:01:11 -0700 (PDT) Received: from dggpemm500019.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SLkX16wDrzVm1M; Thu, 2 Nov 2023 21:01:05 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500019.china.huawei.com (7.185.36.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 2 Nov 2023 21:01:09 +0800 Received: from dggpemm500006.china.huawei.com ([7.185.36.236]) by dggpemm500006.china.huawei.com ([7.185.36.236]) with mapi id 15.01.2507.031; Thu, 2 Nov 2023 21:01:09 +0800 From: "Gonglei (Arei)" To: Halil Pasic CC: Herbert Xu , "linux-crypto@vger.kernel.org" , Marc Hartmayer , "Michael S. Tsirkin" , Jason Wang , "virtualization@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "pizhenwei@bytedance.com" , Cornelia Huck Subject: RE: [PATCH] crypto: virtio-crypto: call finalize with bh disabled Thread-Topic: [PATCH] crypto: virtio-crypto: call finalize with bh disabled Thread-Index: AdnvwZyqMOU4LXJLQHSIVFGYJFXR5QAk7LIAADLTkZAHGvVqsA== Date: Thu, 2 Nov 2023 13:01:09 +0000 Message-ID: References: <1914739e2de14ed396e5674aa2d4766c@huawei.com> <20230926184158.4ca2c0c3.pasic@linux.ibm.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.149.11] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 02 Nov 2023 06:01:16 -0700 (PDT) Ping Herbert. Thanks. > -----Original Message----- > From: Gonglei (Arei) > Sent: Wednesday, September 27, 2023 5:18 PM > To: 'Halil Pasic' > Cc: Herbert Xu ; linux-crypto@vger.kernel.org; > Marc Hartmayer ; Michael S. Tsirkin > ; Jason Wang ; > virtualization@lists.linux-foundation.org; linux-kernel@vger.kernel.org; > pizhenwei@bytedance.com; Cornelia Huck > Subject: RE: [PATCH] crypto: virtio-crypto: call finalize with bh disabled > > > > > -----Original Message----- > > From: Halil Pasic [mailto:pasic@linux.ibm.com] > > Sent: Wednesday, September 27, 2023 12:42 AM > > To: Gonglei (Arei) > > Cc: Herbert Xu ; > > linux-crypto@vger.kernel.org; Marc Hartmayer ; > > Michael S. Tsirkin ; Jason Wang > ; > > virtualization@lists.linux-foundation.org; > > linux-kernel@vger.kernel.org; pizhenwei@bytedance.com; Halil Pasic > > ; Cornelia Huck > > Subject: Re: [PATCH] crypto: virtio-crypto: call finalize with bh > > disabled > > > > [..] > > > --- a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c > > > +++ b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c > > > @@ -61,8 +61,9 @@ static void virtio_crypto_akcipher_finalize_req( > > > vc_akcipher_req->src_buf = NULL; > > > vc_akcipher_req->dst_buf = NULL; > > > virtcrypto_clear_request(&vc_akcipher_req->base); > > > - > > > + local_bh_disable(); > > > > > > crypto_finalize_akcipher_request(vc_akcipher_req->base.dataq->engine > > > , > > > req, err); > > > + local_bh_enable(); > > > > Thanks Gonglei! > > > > I did this a quick spin, and it does not seem to be sufficient on s390x. > > Which does not come as a surprise to me, because > > > > #define lockdep_assert_in_softirq() > > \ > > do > > { > > \ > > WARN_ON_ONCE(__lockdep_enabled && > > \ > > (!in_softirq() || in_irq() || in_nmi())); \ > > } while (0) > > > > will still warn because in_irq() still evaluates to true (your patch > > addresses the !in_softirq() part). > > > You are right. > > So I think the core of this question is: Can we call crypto_finalize_request() in > the upper half of the interrupt? > If so, maybe we should introduce a new function, such as > lockdep_assert_in_interrupt(). > > #define lockdep_assert_in_interrupt() \ > do { \ > WARN_ON_ONCE(__lockdep_enabled && !in_interrupt()); \ > } while (0) > > If not, why? > > Herbert, do you have any suggestions? Thanks. > > > Regards, > -Gonglei >