[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <adb0c5f790dc408887f9d98548373919@huawei.com>
Date: Thu, 2 Nov 2023 13:01:09 +0000
From: "Gonglei (Arei)" <arei.gonglei@...wei.com>
To: Halil Pasic <pasic@...ux.ibm.com>
CC: Herbert Xu <herbert@...dor.apana.org.au>,
"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
Marc Hartmayer <mhartmay@...ux.ibm.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"pizhenwei@...edance.com" <pizhenwei@...edance.com>,
Cornelia Huck <cohuck@...hat.com>
Subject: RE: [PATCH] crypto: virtio-crypto: call finalize with bh disabled
Ping Herbert.
Thanks.
> -----Original Message-----
> From: Gonglei (Arei)
> Sent: Wednesday, September 27, 2023 5:18 PM
> To: 'Halil Pasic' <pasic@...ux.ibm.com>
> Cc: Herbert Xu <herbert@...dor.apana.org.au>; linux-crypto@...r.kernel.org;
> Marc Hartmayer <mhartmay@...ux.ibm.com>; Michael S. Tsirkin
> <mst@...hat.com>; Jason Wang <jasowang@...hat.com>;
> virtualization@...ts.linux-foundation.org; linux-kernel@...r.kernel.org;
> pizhenwei@...edance.com; Cornelia Huck <cohuck@...hat.com>
> Subject: RE: [PATCH] crypto: virtio-crypto: call finalize with bh disabled
>
>
>
> > -----Original Message-----
> > From: Halil Pasic [mailto:pasic@...ux.ibm.com]
> > Sent: Wednesday, September 27, 2023 12:42 AM
> > To: Gonglei (Arei) <arei.gonglei@...wei.com>
> > Cc: Herbert Xu <herbert@...dor.apana.org.au>;
> > linux-crypto@...r.kernel.org; Marc Hartmayer <mhartmay@...ux.ibm.com>;
> > Michael S. Tsirkin <mst@...hat.com>; Jason Wang
> <jasowang@...hat.com>;
> > virtualization@...ts.linux-foundation.org;
> > linux-kernel@...r.kernel.org; pizhenwei@...edance.com; Halil Pasic
> > <pasic@...ux.ibm.com>; Cornelia Huck <cohuck@...hat.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
>
Powered by blists - more mailing lists