From: "Gonglei (Arei)" <arei.gonglei@huawei.com>
To: Halil Pasic <pasic@linux.ibm.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
Marc Hartmayer <mhartmay@linux.ibm.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"pizhenwei@bytedance.com" <pizhenwei@bytedance.com>,
Cornelia Huck <cohuck@redhat.com>
Subject: RE: [PATCH] crypto: virtio-crypto: call finalize with bh disabled
Date: Thu, 2 Nov 2023 13:01:09 +0000 [thread overview]
Message-ID: <adb0c5f790dc408887f9d98548373919@huawei.com> (raw)
In-Reply-To: 20230926184158.4ca2c0c3.pasic@linux.ibm.com
Ping Herbert.
Thanks.
> -----Original Message-----
> From: Gonglei (Arei)
> Sent: Wednesday, September 27, 2023 5:18 PM
> To: 'Halil Pasic' <pasic@linux.ibm.com>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>; linux-crypto@vger.kernel.org;
> Marc Hartmayer <mhartmay@linux.ibm.com>; Michael S. Tsirkin
> <mst@redhat.com>; Jason Wang <jasowang@redhat.com>;
> virtualization@lists.linux-foundation.org; linux-kernel@vger.kernel.org;
> pizhenwei@bytedance.com; Cornelia Huck <cohuck@redhat.com>
> 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) <arei.gonglei@huawei.com>
> > Cc: Herbert Xu <herbert@gondor.apana.org.au>;
> > linux-crypto@vger.kernel.org; Marc Hartmayer <mhartmay@linux.ibm.com>;
> > Michael S. Tsirkin <mst@redhat.com>; Jason Wang
> <jasowang@redhat.com>;
> > virtualization@lists.linux-foundation.org;
> > linux-kernel@vger.kernel.org; pizhenwei@bytedance.com; Halil Pasic
> > <pasic@linux.ibm.com>; Cornelia Huck <cohuck@redhat.com>
> > 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
>
next prev parent reply other threads:[~2023-11-02 13:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 15:07 [PATCH] crypto: virtio-crypto: call finalize with bh disabled Gonglei (Arei)
2023-09-26 16:41 ` Halil Pasic
2023-09-26 17:13 ` Michael S. Tsirkin
2023-09-27 9:24 ` Gonglei (Arei)
2023-09-27 13:25 ` Halil Pasic
2023-09-28 1:24 ` zhenwei pi
2023-09-28 2:03 ` Gonglei (Arei)
2023-09-27 9:36 ` Halil Pasic
2023-09-27 9:17 ` Gonglei (Arei)
2023-09-27 10:08 ` Cornelia Huck
2023-09-27 11:25 ` Halil Pasic
2023-09-27 12:12 ` Cornelia Huck
2023-09-27 13:11 ` Halil Pasic
2023-09-27 17:11 ` Halil Pasic
2023-11-02 13:01 ` Gonglei (Arei) [this message]
2023-11-06 10:08 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=adb0c5f790dc408887f9d98548373919@huawei.com \
--to=arei.gonglei@huawei.com \
--cc=cohuck@redhat.com \
--cc=herbert@gondor.apana.org.au \
--cc=jasowang@redhat.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhartmay@linux.ibm.com \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pizhenwei@bytedance.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox