Re: [PATCH] crypto: virtio-crypto: call finalize with bh disabled

2023-09-27 Thread Halil Pasic
On Tue, 26 Sep 2023 18:41:58 +0200 Halil Pasic wrote: > > + 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 s

Re: [PATCH] crypto: virtio-crypto: call finalize with bh disabled

2023-09-27 Thread Halil Pasic
On Wed, 27 Sep 2023 09:24:09 + "Gonglei (Arei)" wrote: > > On a related note, config change callback is also handled incorrectly in > > this > > driver, it takes a mutex from interrupt context. > > Good catch. Will fix it. Thanks Gonglei! Sorry I first misunderstood this as a problem

Re: [PATCH] crypto: virtio-crypto: call finalize with bh disabled

2023-09-27 Thread Halil Pasic
On Wed, 27 Sep 2023 14:12:19 +0200 Cornelia Huck wrote: > On Wed, Sep 27 2023, Halil Pasic wrote: > > > On Wed, 27 Sep 2023 12:08:43 +0200 > > Cornelia Huck wrote: > > > >> > On the other hand virtio_airq_handler() calls vring_interrupt() wi

Re: [PATCH] crypto: virtio-crypto: call finalize with bh disabled

2023-09-27 Thread Halil Pasic
On Wed, 27 Sep 2023 12:08:43 +0200 Cornelia Huck wrote: > > On the other hand virtio_airq_handler() calls vring_interrupt() with > > interrupts enabled. (While vring_interrupt() is called in a (read) > > critical section in virtio_airq_handler() we use read_lock() and > > not read_lock_irqsave()

Re: [PATCH] crypto: virtio-crypto: call finalize with bh disabled

2023-09-27 Thread Halil Pasic
On Tue, 26 Sep 2023 13:13:51 -0400 "Michael S. Tsirkin" wrote: > > On the other hand virtio_airq_handler() calls vring_interrupt() with > > interrupts enabled. (While vring_interrupt() is called in a (read) > > critical section in virtio_airq_handler() we use read_lock() and > > not

Re: [PATCH] crypto: virtio-crypto: call finalize with bh disabled

2023-09-26 Thread Halil Pasic
[..] > --- 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; >

Re: virtcrypto_dataq_callback calls crypto_finalize_request() from irq context

2023-09-24 Thread Halil Pasic
On Sun, 24 Sep 2023 11:56:25 + "Gonglei (Arei)" wrote: > Hi Halil, > > Commit 4058cf08945 introduced a check for detecting crypto completion > function > called with enable BH, and indeed the virtio-crypto driver didn't disable BH, > which needs > a patch to fix it. > > P.S.: >

BUG: virtcrypto_dataq_callback calls crypto_finalize_request() from irq context

2023-09-22 Thread Halil Pasic
Hi Gonglei! Our CI has found that virtio-crypto does not honor the requirement of crypto_finalize_request() being called in softirq context which is asserted in that function via lockdep_assert_in_softirq() since commit 4058cf08945c ("crypto: engine - check if BH is disabled during completion").

Re: [PATCH V5 6/9] virtio-ccw: implement synchronize_cbs()

2022-05-24 Thread Halil Pasic
s called via virtio_ccw_int_handler(), a per > device rwlock is introduced ans used in the synchronization method. > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Marc Zyngier > Cc: Halil Pasic > Cc: Cornelia Huck > Cc: Vineeth

Re: [PATCH V5 0/9] rework on the IRQ hardening of virtio

2022-05-24 Thread Halil Pasic
On Mon, 23 May 2022 10:53:23 +0200 Halil Pasic wrote: > On Wed, 18 May 2022 11:59:42 +0800 > Jason Wang wrote: > > > Hi All: > > Sorry for being slow on this one. I'm pretty much under water. Will try > to get some regression-testing done till tomorrow end of d

Re: [PATCH V5 0/9] rework on the IRQ hardening of virtio

2022-05-23 Thread Halil Pasic
On Wed, 18 May 2022 11:59:42 +0800 Jason Wang wrote: > Hi All: Sorry for being slow on this one. I'm pretty much under water. Will try to get some regression-testing done till tomorrow end of day. Regards, Halil ___ Virtualization mailing list

Re: [PATCH V4 0/9] rework on the IRQ hardening of virtio

2022-05-16 Thread Halil Pasic
On Thu, 12 May 2022 11:31:08 +0800 Jason Wang wrote: > > > It looks to me we need to use write_lock_irq()/write_unlock_irq() to > > > do the synchronization. > > > > > > And we probably need to keep the > > > read_lock_irqsave()/read_lock_irqrestore() logic since I can see the > > >

Re: [PATCH V4 0/9] rework on the IRQ hardening of virtio

2022-05-11 Thread Halil Pasic
On Wed, 11 May 2022 10:22:59 +0800 Jason Wang wrote: > >CPU0 > > > > lock(>irq_lock); > > > > lock(>irq_lock); > > > > *** DEADLOCK *** > > It looks to me we need to use write_lock_irq()/write_unlock_irq() to > do the synchronization. > > And we probably need to

Re: [PATCH V4 8/9] virtio: harden vring IRQ

2022-05-11 Thread Halil Pasic
On Wed, 11 May 2022 17:27:44 +0800 Jason Wang wrote: > On Wed, May 11, 2022 at 4:44 PM Cornelia Huck wrote: > > > > On Wed, May 11 2022, Jason Wang wrote: > > > > > On Tue, May 10, 2022 at 7:32 PM Michael S. Tsirkin > > > wrote: > > >> > > >> On Sat, May 07, 2022 at 03:19:53PM +0800,

Re: [PATCH V3 6/9] virtio-ccw: implement synchronize_cbs()

2022-04-27 Thread Halil Pasic
t; > On Mon, Apr 25, 2022 at 11:35:41PM -0400, Michael S. Tsirkin wrote: > >> >> > > > >> >> > > > On Tue, Apr 26, 2022 at 04:29:11AM +0200, Halil Pasic wrote: > >> >> > > > > On Mon, 25 Apr 2022 09:59:55 -0400 > >&g

Re: [PATCH V3 6/9] virtio-ccw: implement synchronize_cbs()

2022-04-25 Thread Halil Pasic
ynchronization > >> method. > >> > >> Cc: Thomas Gleixner > >> Cc: Peter Zijlstra > >> Cc: "Paul E. McKenney" > >> Cc: Marc Zyngier > >> Cc: Halil Pasic > >> Cc: Cornelia Huck > >> Signed-off-by: Jason W

Re: [PATCH V3 6/9] virtio-ccw: implement synchronize_cbs()

2022-04-25 Thread Halil Pasic
t is called via virtio_ccw_int_handler(), a per > > >> device spinlock for irq is introduced ans used in the synchronization > > >> method. > > >> > > >> Cc: Thomas Gleixner > > >> Cc: Peter Zijlstra > > >> Cc: "

Re: [PATCH V2 4/5] virtio-pci: implement synchronize_vqs()

2022-04-12 Thread Halil Pasic
On Tue, 12 Apr 2022 10:24:35 +0800 Jason Wang wrote: > > Regarding the question "are we safe against notifications before > > indicators have been registered" I think we really need to think about > > something like Secure Execution. We don't have, and we are unlikely > > to have in hardware

Re: [PATCH V2 4/5] virtio-pci: implement synchronize_vqs()

2022-04-11 Thread Halil Pasic
On Mon, 11 Apr 2022 16:27:41 +0200 Cornelia Huck wrote: > On Mon, Apr 11 2022, Jason Wang wrote: > > > On Sun, Apr 10, 2022 at 3:51 PM Michael S. Tsirkin wrote: > > > >> > >> On Fri, Apr 08, 2022 at 03:03:07PM +0200, Halil Pasic wrote: >

Re: [PATCH V2 4/5] virtio-pci: implement synchronize_vqs()

2022-04-08 Thread Halil Pasic
On Wed, 06 Apr 2022 15:04:32 +0200 Cornelia Huck wrote: > On Wed, Apr 06 2022, "Michael S. Tsirkin" wrote: > > > On Wed, Apr 06, 2022 at 04:35:37PM +0800, Jason Wang wrote: > >> This patch implements PCI version of synchronize_vqs(). > >> > >> Cc: Thomas Gleixner > >> Cc: Peter Zijlstra >

Re: [PATCH] virtio: acknowledge all features before access

2022-01-18 Thread Halil Pasic
ll, so I'm very happy to see us moving away from that. > > Cc: sta...@vger.kernel.org > Fixes: 404123c2db79 ("virtio: allow drivers to validate features") > Fixes: 2f9a174f918e ("virtio: write back F_VERSION_1 before validate") > Cc: "Halil Pasic"

Re: [PATCH] virtio: acknowledge all features before access

2022-01-18 Thread Halil Pasic
es once unless we are clearing any > features when validating. > > Cc: sta...@vger.kernel.org > Fixes: 404123c2db79 ("virtio: allow drivers to validate features") > Fixes: 2f9a174f918e ("virtio: write back F_VERSION_1 before validate") > Cc: "Halil Pasic"

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-24 Thread Halil Pasic
On Wed, 24 Nov 2021 10:33:28 +0800 Jason Wang wrote: > > > > Let's see how far we can get. But yes, maybe we were too aggressive in > > > > breaking things by default, a warning might be a better choice for a > > > > couple of cycles. > > > > Ok, considering we saw the issues with balloons I

Re: [PATCH 1/2] vhost/vsock: fix incorrect used length reported to the guest

2021-11-23 Thread Halil Pasic
est > buffers (they are all "out" buffers), without writing anything, > so we must pass 0 as "used length" to comply virtio spec. > > Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko") > Cc: sta...@vger.kernel.org > Reported-by: Halil Pasic > Sugge

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-23 Thread Halil Pasic
On Tue, 23 Nov 2021 07:17:05 -0500 "Michael S. Tsirkin" wrote: > On Mon, Nov 22, 2021 at 02:50:03PM +0100, Halil Pasic wrote: > > On Mon, 22 Nov 2021 14:25:26 +0800 > > Jason Wang wrote: > > > > > On Mon, Nov 22, 2021 at 1:49 PM Halil Pasic wrote: &

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-22 Thread Halil Pasic
On Mon, 22 Nov 2021 14:25:26 +0800 Jason Wang wrote: > I think the fixes are: > > 1) fixing the vhost vsock > 2) use suppress_used_validation=true to let vsock driver to validate > the in buffer length > 3) probably a new feature so the driver can only enable the validation > when the feature

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-22 Thread Halil Pasic
On Mon, 22 Nov 2021 12:08:22 +0100 Stefano Garzarella wrote: > On Mon, Nov 22, 2021 at 08:55:24AM +0100, Stefano Garzarella wrote: > >On Mon, Nov 22, 2021 at 02:25:26PM +0800, Jason Wang wrote: > >>On Mon, Nov 22, 2021 at 1:49 PM Halil Pasic wrote: > >>> >

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-22 Thread Halil Pasic
On Mon, 22 Nov 2021 14:25:26 +0800 Jason Wang wrote: > On Mon, Nov 22, 2021 at 1:49 PM Halil Pasic wrote: > > > > On Mon, 22 Nov 2021 06:35:18 +0100 > > Halil Pasic wrote: > > > > > > I think it should be a common issue, looking at >

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-21 Thread Halil Pasic
On Mon, 22 Nov 2021 06:35:18 +0100 Halil Pasic wrote: > > I think it should be a common issue, looking at > > vhost_vsock_handle_tx_kick(), it did: > > > > len += sizeof(pkt->hdr); > > vhost_add_used(vq, head, len); > > > > which looks like a vi

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-21 Thread Halil Pasic
On Mon, 22 Nov 2021 11:51:09 +0800 Jason Wang wrote: > On Fri, Nov 19, 2021 at 11:10 PM Halil Pasic wrote: > > > > On Wed, 27 Oct 2021 10:21:04 +0800 > > Jason Wang wrote: > > > > > This patch validate the used buffer length provided by the device > &g

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-19 Thread Halil Pasic
On Wed, 27 Oct 2021 10:21:04 +0800 Jason Wang wrote: > This patch validate the used buffer length provided by the device > before trying to use it. This is done by record the in buffer length > in a new field in desc_state structure during virtqueue_add(), then we > can fail the

Re: [PATCH v3 1/1] virtio: write back F_VERSION_1 before validate

2021-10-13 Thread Halil Pasic
On Wed, 13 Oct 2021 08:24:53 -0400 "Michael S. Tsirkin" wrote: > > > OK this looks good! How about a QEMU patch to make it spec compliant on > > > BE? > > > > Who is going to do that? Halil? you? Conny? > > Halil said he'll do it... Right, Halil? I can do it but not right away. Maybe in a

[PATCH v3 1/1] virtio: write back F_VERSION_1 before validate

2021-10-10 Thread Halil Pasic
, so at least that's not a regression. No devices except virtio net and virtio blk seem to be affected. Long term the right thing to do is to fix the hypervisors. Cc: #v4.11 Signed-off-by: Halil Pasic Fixes: 82e89ea077b9 ("virtio-blk: Add validation for block size in config space") Fi

Re: [PATCH v2 1/1] virtio: write back F_VERSION_1 before validate

2021-10-08 Thread Halil Pasic
On Fri, 8 Oct 2021 09:05:03 -0400 "Michael S. Tsirkin" wrote: > On Fri, Oct 08, 2021 at 02:34:22PM +0200, Halil Pasic wrote: > > The virtio specification virtio-v1.1-cs01 states: "Transitional devices > > MUST detect Legacy drivers by detecting that VIRTI

[PATCH v2 1/1] virtio: write back F_VERSION_1 before validate

2021-10-08 Thread Halil Pasic
atter renders virtio-blk unusable with DASD backing, because things simply don't work with the default. Cc: #v4.11 Signed-off-by: Halil Pasic Fixes: 82e89ea077b9 ("virtio-blk: Add validation for block size in config space") Fixes: fe36cbe0671e ("virtio_net: clear MTU wh

Re: [PATCH 1/1] virtio: write back F_VERSION_1 before validate

2021-10-07 Thread Halil Pasic
On Thu, 07 Oct 2021 17:25:52 +0200 Cornelia Huck wrote: > On Thu, Oct 07 2021, Halil Pasic wrote: > > > On Thu, 07 Oct 2021 13:52:24 +0200 > > Cornelia Huck wrote: > > > >> On Wed, Oct 06 2021, Halil Pasic wrote: > >> > >>

Re: [PATCH 1/1] virtio: write back F_VERSION_1 before validate

2021-10-07 Thread Halil Pasic
On Thu, 07 Oct 2021 13:52:24 +0200 Cornelia Huck wrote: > On Wed, Oct 06 2021, Halil Pasic wrote: > > > The virtio specification virtio-v1.1-cs01 states: Transitional devices > > MUST detect Legacy drivers by detecting that VIRTIO_F_VERSION_1 has not > > been ac

[PATCH 1/1] virtio: write back F_VERSION_1 before validate

2021-10-06 Thread Halil Pasic
negotiation is complete. However, we already have regression so let's try to address it. Signed-off-by: Halil Pasic Fixes: 82e89ea077b9 ("virtio-blk: Add validation for block size in config space") Fixes: fe36cbe0671e ("virtio_net: clear MTU when out of range") Reported-by

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Halil Pasic
On Tue, 05 Oct 2021 13:13:31 +0200 Cornelia Huck wrote: > On Tue, Oct 05 2021, Halil Pasic wrote: > > > On Mon, 4 Oct 2021 05:07:13 -0400 > > "Michael S. Tsirkin" wrote: > >> Well we established that we can know. Here's an alternative explanation:

Re: [virtio-dev] Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Halil Pasic
On Mon, 4 Oct 2021 16:01:12 -0400 "Michael S. Tsirkin" wrote: > > > > Ok, so what about something like > > > > "If FEATURES_OK is not set, the driver MAY change the set of features it > > accepts." > > > > in the device initialization section? > > Maybe "as long as". However Halil implied

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Halil Pasic
On Tue, 5 Oct 2021 03:53:17 -0400 "Michael S. Tsirkin" wrote: > > Wouldn't a call from transport code into virtio core > > be more handy? What I have in mind is stuff like vhost-user and vdpa. My > > understanding is, that for vhost setups where the config is outside qemu, > > we probably need a

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Halil Pasic
On Mon, 4 Oct 2021 05:07:13 -0400 "Michael S. Tsirkin" wrote: > On Mon, Oct 04, 2021 at 04:23:23AM +0200, Halil Pasic wrote: > > On Sat, 2 Oct 2021 14:13:37 -0400 > > "Michael S. Tsirkin" wrote: > > > > > > Anyone else have

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-05 Thread Halil Pasic
On Mon, 4 Oct 2021 09:11:04 -0400 "Michael S. Tsirkin" wrote: > > >> static inline bool virtio_access_is_big_endian(VirtIODevice *vdev) > > >> { > > >> #if defined(LEGACY_VIRTIO_IS_BIENDIAN) > > >> return virtio_is_big_endian(vdev); > > >> #elif defined(TARGET_WORDS_BIGENDIAN) > > >> if

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-04 Thread Halil Pasic
On Mon, 04 Oct 2021 09:01:42 +0200 Cornelia Huck wrote: > On Sat, Oct 02 2021, "Michael S. Tsirkin" wrote: > > > On Fri, Oct 01, 2021 at 05:18:46PM +0200, Cornelia Huck wrote: > >> I'd say we need a hack here so that we assume little-endian config space > >> if VERSION_1 has been offered; if

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-03 Thread Halil Pasic
isfies "only modern mode", or? For now I've deliberately omitted the has verify and the is big endian conditions so we have a better chance to see if something breaks (i.e. the approach does not work). I can add in those extra conditions later. ------8<-

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-02 Thread Halil Pasic
On Sat, 2 Oct 2021 14:20:47 -0400 "Michael S. Tsirkin" wrote: > > >From my perspective the problem is that the version of the device > > remains in limbo as long as the features have not yet been finalized, > > which means that the endianness of the config space remains in limbo as > > well.

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-01 Thread Halil Pasic
On Thu, 30 Sep 2021 13:31:04 +0200 Cornelia Huck wrote: > On Thu, Sep 30 2021, Halil Pasic wrote: > > > On Thu, 30 Sep 2021 11:28:23 +0200 > > Cornelia Huck wrote: > > > >> On Thu, Sep 30 2021, Halil Pasic wrote: > >> > >> &

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-10-01 Thread Halil Pasic
On Thu, 30 Sep 2021 07:12:21 -0400 "Michael S. Tsirkin" wrote: > On Thu, Sep 30, 2021 at 03:20:49AM +0200, Halil Pasic wrote: > > This patch fixes a regression introduced by commit 82e89ea077b9 > > ("virtio-blk: Add validation for block size in config space&qu

Re: [RFC PATCH 1/1] virtio: write back features before verify

2021-09-30 Thread Halil Pasic
On Thu, 30 Sep 2021 11:28:23 +0200 Cornelia Huck wrote: > On Thu, Sep 30 2021, Halil Pasic wrote: > > > This patch fixes a regression introduced by commit 82e89ea077b9 > > ("virtio-blk: Add validation for block size in config space") and > > enables simila

[RFC PATCH 1/1] virtio: write back features before verify

2021-09-29 Thread Halil Pasic
e out whether the device is transitional by rejecting _F_VERSION_1, then resetting it and proceeding according tho what we have figured out, hoping that the characteristics of the device didn't change. Signed-off-by: Halil Pasic Fixes: 82e89ea077b9 ("virtio-blk: Add validation for block siz

Re: [PATCH 1/1] virtio/s390: fix vritio-ccw device teardown

2021-09-21 Thread Halil Pasic
On Tue, 21 Sep 2021 15:31:03 +0200 Vineeth Vijayan wrote: > On Tue, 2021-09-21 at 05:25 +0200, Halil Pasic wrote: > > On Mon, 20 Sep 2021 12:07:23 +0200 > > Cornelia Huck wrote: > > > > > On Mon, Sep 20 2021, Vineeth Vijayan wrote: > > > > >

Re: [PATCH 1/1] virtio/s390: fix vritio-ccw device teardown

2021-09-20 Thread Halil Pasic
On Mon, 20 Sep 2021 12:07:23 +0200 Cornelia Huck wrote: > On Mon, Sep 20 2021, Vineeth Vijayan wrote: > > > On Mon, 2021-09-20 at 00:39 +0200, Halil Pasic wrote: > >> On Fri, 17 Sep 2021 10:40:20 +0200 > >> Cornelia Huck wrote: > >> > > ...s

Re: [PATCH 1/1] virtio/s390: fix vritio-ccw device teardown

2021-09-20 Thread Halil Pasic
On Mon, 20 Sep 2021 12:30:39 +0200 Cornelia Huck wrote: > On Mon, Sep 20 2021, Halil Pasic wrote: [..] > > Basically, the vcdev is supposed to be around while the ccw device is > online (with a tail end until references have been given up, of course.) > It embeds a virtio

Re: [PATCH 1/1] virtio/s390: fix vritio-ccw device teardown

2021-09-19 Thread Halil Pasic
On Fri, 17 Sep 2021 10:40:20 +0200 Cornelia Huck wrote: > On Thu, Sep 16 2021, Halil Pasic wrote: > > > On Thu, 16 Sep 2021 10:59:15 +0200 > > Cornelia Huck wrote: > > > >> > Since commit 48720ba56891 ("virtio/s390: use DMA memory for ccw I/O and &g

Re: [PATCH 1/1] virtio/s390: fix vritio-ccw device teardown

2021-09-16 Thread Halil Pasic
. > > > > To accomplish this let us take a reference on the ccw device before we > > allocate the dma_area and give it up after dma_area was freed. > > > > Signed-off-by: Halil Pasic > > Fixes: 48720ba56891 ("virtio/s390: use DMA memory for ccw I/O

Re: [PATCH 1/1] virtio/s390: fix vritio-ccw device teardown

2021-09-15 Thread Halil Pasic
s/vritio/virtio/ (subject) [..] On Wed, 15 Sep 2021 23:57:42 +0200 Halil Pasic wrote: > Since commit 48720ba56891 ("virtio/s390: use DMA memory for ccw I/O and > classic notifiers") we were supposed to make sure that > virtio_ccw_release_dev() completes be

[PATCH 1/1] virtio/s390: fix vritio-ccw device teardown

2021-09-15 Thread Halil Pasic
was freed. Signed-off-by: Halil Pasic Fixes: 48720ba56891 ("virtio/s390: use DMA memory for ccw I/O and classic notifiers") Reported-by: b...@redhat.com --- I'm not certain this is the only hot-unplug and teardonw related problem with virtio-ccw. Some things that are not perfectly clear

Re: [PATCH] virtio/s390: implement virtio-ccw revision 2 correctly

2021-02-16 Thread Halil Pasic
On Tue, 16 Feb 2021 11:39:07 +0100 Cornelia Huck wrote: > > > > Reviewed-by: Halil Pasic > > Thanks! > > I'll do a v2 with a tweaked commit message and cc:stable. Sounds good! ___ Virtualization mailing list Vi

Re: [PATCH] virtio/s390: implement virtio-ccw revision 2 correctly

2021-02-15 Thread Halil Pasic
ion < 1) > > + if (vcdev->revision < 2) > > return vcdev->dma_area->status; I don't think our faking of the status read (i.e. returning the old one) is contributing to spec compliance. Especially not if the inability to READ is not transient.

Re: [PATCH v11 0/2] s390: virtio: let arch validate VIRTIO features

2020-09-07 Thread Halil Pasic
On Mon, 7 Sep 2020 11:39:05 +0200 Pierre Morel wrote: > Hi all, > > The goal of the series is to give a chance to the architecture > to validate VIRTIO device features. Michael, is this going in via your tree? ___ Virtualization mailing list

Re: [PATCH v11 2/2] s390: virtio: PV needs VIRTIO I/O device protection

2020-09-07 Thread Halil Pasic
gured device we fail it (device status field), because attempting to drive it is a recipe for disaster. > > Signed-off-by: Pierre Morel > Reviewed-by: Cornelia Huck Reviewed-by: Halil Pasic ___ Virtualization mailing list Virtualization@li

Re: [PATCH v11 1/2] virtio: let arch advertise guest's memory access restrictions

2020-09-07 Thread Halil Pasic
t set. > > Signed-off-by: Pierre Morel > Reviewed-by: Cornelia Huck Reviewed-by: Halil Pasic [..] > > +config ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS > + bool > + help > + This option is selected if the architecture may need to enforce > + VIRTIO_F

Re: [PATCH v5 2/2] s390: virtio: PV needs VIRTIO I/O device protection

2020-07-09 Thread Halil Pasic
On Thu, 9 Jul 2020 16:51:04 +0200 Pierre Morel wrote: > > > On 2020-07-09 16:47, Halil Pasic wrote: > > On Thu, 9 Jul 2020 12:51:58 +0200 > > Pierre Morel wrote: > > > >>>> +int arch_validate_virtio_features(struct virtio_device *dev) > &g

Re: [PATCH v5 2/2] s390: virtio: PV needs VIRTIO I/O device protection

2020-07-09 Thread Halil Pasic
On Thu, 9 Jul 2020 12:51:58 +0200 Pierre Morel wrote: > >> +int arch_validate_virtio_features(struct virtio_device *dev) > >> +{ > >> + if (!is_prot_virt_guest()) > >> + return 0; > >> + > >> + if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1)) { > >> + dev_warn(>dev, "device

Re: [PATCH v5 1/2] virtio: let arch validate VIRTIO features

2020-07-09 Thread Halil Pasic
On Thu, 9 Jul 2020 10:39:18 +0200 Pierre Morel wrote: > An architecture may need to validate the VIRTIO devices features > based on architecture specifics. > > Signed-off-by: Pierre Morel > Reviewed-by: Cornelia Huck > Acked-by: Christian Borntraeger Ack

Re: [PATCH v5 2/2] s390: virtio: PV needs VIRTIO I/O device protection

2020-07-09 Thread Halil Pasic
gt; +"device must provide VIRTIO_F_IOMMU_PLATFORM\n"); > > "support for limited memory access required for protected > virtualization" > > ? > > Mentioning the feature flag is shorter i

Re: [PATCH v4 2/2] s390: virtio: PV needs VIRTIO I/O device protection

2020-07-07 Thread Halil Pasic
On Tue, 7 Jul 2020 12:38:17 +0200 Pierre Morel wrote: > > > On 2020-07-07 11:46, Cornelia Huck wrote: > > On Tue, 7 Jul 2020 10:44:37 +0200 > > Pierre Morel wrote: > > > >> S390, protecting the guest memory against unauthorized host access > >> needs to enforce VIRTIO I/O device protection

Re: [PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature

2020-06-19 Thread Halil Pasic
On Fri, 19 Jun 2020 11:20:51 +0200 Cornelia Huck wrote: > > > + if (arch_needs_virtio_iommu_platform(dev) && > > > + !virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM)) { > > > + dev_warn(>dev, > > > + "virtio: device must provide > > >

Re: [PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature

2020-06-17 Thread Halil Pasic
f preventing calamity, and the details can be changed any time, thus: Acked-by: Halil Pasic Regarding the interaction of architecture specific code with virtio core, I believe we could have made the interface more generic. One option is to introduce virtio_arch_finalize_features(), a hook that cou

Re: [PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature

2020-06-16 Thread Halil Pasic
On Tue, 16 Jun 2020 12:52:50 +0200 Pierre Morel wrote: > >> int virtio_finalize_features(struct virtio_device *dev) > >> { > >>int ret = dev->config->finalize_features(dev); > >> @@ -179,6 +184,10 @@ int virtio_finalize_features(struct virtio_device > >> *dev) > >>if

Re: [PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature

2020-06-16 Thread Halil Pasic
On Mon, 15 Jun 2020 14:39:24 +0200 Pierre Morel wrote: I find the subject (commit short) sub optimal. The 'arch' is already accepting devices 'without IOMMU feature'. What you are introducing is the ability to reject. > An architecture protecting the guest memory against unauthorized host >

Re: [PATCH] s390: protvirt: virtio: Refuse device without IOMMU

2020-06-15 Thread Halil Pasic
On Mon, 15 Jun 2020 11:01:55 +0800 Jason Wang wrote: > > hum, in between I found another way which seems to me much better: > > > > We already have the force_dma_unencrypted() function available which > > AFAIU is what we want for encrypted memory protection and is already > > used by power

Re: [PATCH] s390: protvirt: virtio: Refuse device without IOMMU

2020-06-10 Thread Halil Pasic
On Wed, 10 Jun 2020 15:11:51 +0200 Pierre Morel wrote: > Protected Virtualisation protects the memory of the guest and > do not allow a the host to access all of its memory. > > Let's refuse a VIRTIO device which does not use IOMMU > protected access. > Should we ever get a virtio-ccw device

Re: [PATCH] s390/virtio: remove unused pm callbacks

2020-06-04 Thread Halil Pasic
Cornelia Huck Reviewed-by: Halil Pasic > --- > drivers/s390/virtio/virtio_ccw.c | 26 -- > 1 file changed, 26 deletions(-) > > diff --git a/drivers/s390/virtio/virtio_ccw.c > b/drivers/s390/virtio/virtio_ccw.c > index 957889a42d2e..5730572b52cd 1

Re: [PATCH 0/2] virtio-blk: improve handling of DMA mapping failures

2020-03-03 Thread Halil Pasic
On Tue, 3 Mar 2020 09:49:21 -0500 "Michael S. Tsirkin" wrote: > On Tue, Mar 03, 2020 at 03:12:52PM +0100, Halil Pasic wrote: > > On Thu, 13 Feb 2020 13:37:26 +0100 > > Halil Pasic wrote: > > > > > Two patches are handling new edge cases introduced by

Re: [PATCH 0/2] virtio-blk: improve handling of DMA mapping failures

2020-03-03 Thread Halil Pasic
On Thu, 13 Feb 2020 13:37:26 +0100 Halil Pasic wrote: > Two patches are handling new edge cases introduced by doing DMA mappings > (which can fail) in virtio core. > > I stumbled upon this while stress testing I/O for Protected Virtual > Machines. I deliberately chose a ti

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-24 Thread Halil Pasic
On Fri, 21 Feb 2020 17:36:45 +0100 Christoph Hellwig wrote: > > By "legacy devices" I assume you mean pre-virtio-1.0 devices, that > > lack the F_VERSION_1 feature flag. Is that right? Because I don't > > see how being a legacy device or not relates to use of the DMA API. > > No. "legacy"

Re: [PATCH 1/2] mm: move force_dma_unencrypted() to mem_encrypt.h

2020-02-24 Thread Halil Pasic
On Mon, 24 Feb 2020 14:33:14 +1100 David Gibson wrote: > On Fri, Feb 21, 2020 at 07:07:02PM +0100, Halil Pasic wrote: > > On Fri, 21 Feb 2020 10:48:15 -0500 > > "Michael S. Tsirkin" wrote: > > > > > On Fri, Feb 21, 2020 at 02:06:39PM +0100, Halil Pasic

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-24 Thread Halil Pasic
On Mon, 24 Feb 2020 17:26:20 +0800 Jason Wang wrote: > That's better. > > How about attached? > > Thanks Thanks Jason! It does avoid the translation overhead in vhost. Tested-by: Halil Pasic Regarding the code, you fence it in virtio-net.c, but AFAIU this feature has rele

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-21 Thread Halil Pasic
On Fri, 21 Feb 2020 17:39:38 +0100 Christoph Hellwig wrote: > On Fri, Feb 21, 2020 at 03:33:40PM +0100, Halil Pasic wrote: > > > Hell no. This is a detail of the platform DMA direct implementation. > > > > I beg to differ. If it was a detail of the DMA direct implementa

Re: [PATCH 1/2] mm: move force_dma_unencrypted() to mem_encrypt.h

2020-02-21 Thread Halil Pasic
On Fri, 21 Feb 2020 10:48:15 -0500 "Michael S. Tsirkin" wrote: > On Fri, Feb 21, 2020 at 02:06:39PM +0100, Halil Pasic wrote: > > On Fri, 21 Feb 2020 14:27:27 +1100 > > David Gibson wrote: > > > > > On Thu, Feb 20, 2020 at 05:31:35PM +0100, Christoph Hel

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-21 Thread Halil Pasic
On Fri, 21 Feb 2020 10:56:45 -0500 "Michael S. Tsirkin" wrote: > On Fri, Feb 21, 2020 at 02:12:30PM +0100, Halil Pasic wrote: > > On Thu, 20 Feb 2020 15:55:14 -0500 > > "Michael S. Tsirkin" wrote: [..] > > > To summarize, the necessary conditions f

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-21 Thread Halil Pasic
On Fri, 21 Feb 2020 14:22:26 +0800 Jason Wang wrote: > > On 2020/2/21 上午12:06, Halil Pasic wrote: > > Currently if one intends to run a memory protection enabled VM with > > virtio devices and linux as the guest OS, one needs to specify the > > VIRTIO_F_IOMMU_PLATF

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-21 Thread Halil Pasic
On Thu, 20 Feb 2020 17:13:09 +0100 Christoph Hellwig wrote: > On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > > index 867c7ebd3f10..fafc8f924955 100644 > > --- a/drivers/virtio/vi

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-21 Thread Halil Pasic
On Thu, 20 Feb 2020 16:33:35 -0500 "Michael S. Tsirkin" wrote: > On Thu, Feb 20, 2020 at 05:06:04PM +0100, Halil Pasic wrote: > > For vhost-net the feature VIRTIO_F_IOMMU_PLATFORM has the following side > > effect The vhost code assumes it the addresses on the v

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-21 Thread Halil Pasic
On Thu, 20 Feb 2020 16:29:50 -0500 "Michael S. Tsirkin" wrote: > On Thu, Feb 20, 2020 at 05:06:04PM +0100, Halil Pasic wrote: > > * This usage is not congruent with standardised semantics of > > VIRTIO_F_IOMMU_PLATFORM. Guest memory protected is an orthogonal rea

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-21 Thread Halil Pasic
On Fri, 21 Feb 2020 11:41:57 +0800 Jason Wang wrote: > > I *think* what you are suggesting here is that virtio devices that > > have !F_IOMMU_PLATFORM should have their dma_ops set up so that the > > DMA API treats IOVA==PA, which will satisfy what the device expects. > > > Can this work for

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-21 Thread Halil Pasic
On Fri, 21 Feb 2020 13:59:15 +1100 David Gibson wrote: > On Thu, Feb 20, 2020 at 05:13:09PM +0100, Christoph Hellwig wrote: > > On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: > > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > &

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-21 Thread Halil Pasic
On Thu, 20 Feb 2020 15:55:14 -0500 "Michael S. Tsirkin" wrote: > On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: > > Currently the advanced guest memory protection technologies (AMD SEV, > > powerpc secure guest technology and

Re: [PATCH 1/2] mm: move force_dma_unencrypted() to mem_encrypt.h

2020-02-21 Thread Halil Pasic
On Fri, 21 Feb 2020 14:27:27 +1100 David Gibson wrote: > On Thu, Feb 20, 2020 at 05:31:35PM +0100, Christoph Hellwig wrote: > > On Thu, Feb 20, 2020 at 05:23:20PM +0100, Christian Borntraeger wrote: > > > >From a users perspective it makes absolutely perfect sense to use the > > > bounce buffers

[PATCH 1/2] mm: move force_dma_unencrypted() to mem_encrypt.h

2020-02-20 Thread Halil Pasic
.html#x1-416 (In the spec VIRTIO_F_IOMMU_PLATFORM is called VIRTIO_F_ACCESS_PLATFORM). Signed-off-by: Halil Pasic Tested-by: Ram Pai Tested-by: Michael Mueller --- include/linux/dma-direct.h | 9 - include/linux/mem_encrypt.h | 10 ++ 2 files changed, 10 insertions(+), 9

[PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-20 Thread Halil Pasic
B API".) On s390 this results in severe performance degradation (c.a. factor 10). BTW with ccw I/O there is (architecturally) no IOMMU, so the whole address translation makes no sense in the context of virtio-ccw. Halil Pasic (2): mm: move force_dma_unencrypted() to mem_encrypt.h virtio:

[PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-20 Thread Halil Pasic
run with protection. This is especially interesting for s390 as VIRTIO_F_IOMMU_PLATFORM pushes all the virtio control structures into the first 2G of guest memory: something we don't necessarily want to do per-default. Signed-off-by: Halil Pasic Tested-by: Ram Pai Tested-by: Michael Mueller

Re: [PATCH 1/2] virtio-blk: fix hw_queue stopped on arbitrary error

2020-02-19 Thread Halil Pasic
On Wed, 19 Feb 2020 09:46:56 +0800 Ming Lei wrote: > On Tue, Feb 18, 2020 at 8:35 PM Halil Pasic wrote: > > > > On Tue, 18 Feb 2020 10:21:18 +0800 > > Ming Lei wrote: > > > > > On Thu, Feb 13, 2020 at 8:38 PM Halil Pasic wrote: > > > > &

Re: [PATCH 1/2] virtio-blk: fix hw_queue stopped on arbitrary error

2020-02-18 Thread Halil Pasic
On Tue, 18 Feb 2020 10:21:18 +0800 Ming Lei wrote: > On Thu, Feb 13, 2020 at 8:38 PM Halil Pasic wrote: > > > > Since nobody else is going to restart our hw_queue for us, the > > blk_mq_start_stopped_hw_queues() is in virtblk_done() is not sufficient > > neces

Re: [PATCH 1/2] virtio-blk: fix hw_queue stopped on arbitrary error

2020-02-17 Thread Halil Pasic
n+0x1aa/0x430 > [ 54.769298] process_one_work+0x156/0x360 > [ 54.769299] worker_thread+0x41/0x3b0 > [ 54.769300] kthread+0xf3/0x130 > [ 54.769302] ? process_one_work+0x360/0x360 > [ 54.769303] ? kthread_bind+0x10/0x10 > [ 54.769305] ret_from_fork+0x35/0x40 >

[PATCH 2/2] virtio-blk: improve virtqueue error to BLK_STS

2020-02-13 Thread Halil Pasic
Let's change the mapping between virtqueue_add errors to BLK_STS statuses, so that -ENOSPC, which indicates virtqueue full is still mapped to BLK_STS_DEV_RESOURCE, but -ENOMEM which indicates non-device specific resource outage is mapped to BLK_STS_RESOURCE. Signed-off-by: Halil Pasic --- See

[PATCH 1/2] virtio-blk: fix hw_queue stopped on arbitrary error

2020-02-13 Thread Halil Pasic
requests. Let us also remove a stale comment. Signed-off-by: Halil Pasic Cc: Jens Axboe Fixes: f7728002c1c7 ("virtio_ring: fix return code on DMA mapping fails") --- I'm in doubt with regards to the Fixes tag. The thing is, virtio-blk probably made an assumption on virtqueue_add: the failure

[PATCH 0/2] virtio-blk: improve handling of DMA mapping failures

2020-02-13 Thread Halil Pasic
in use I experienced hangs. The goal of this series is to fix those hangs. Halil Pasic (2): virtio-blk: fix hw_queue stopped on arbitrary error virtio-blk: improve virtqueue error to BLK_STS drivers/block/virtio_blk.c | 17 - 1 file changed, 12 insertions(+), 5 deletions

Re: [PATCH 1/1] virtio_ring: fix return code on DMA mapping fails

2019-11-29 Thread Halil Pasic
On Tue, 26 Nov 2019 19:45:27 +0100 Christoph Hellwig wrote: > On Sat, Nov 23, 2019 at 09:39:08AM -0600, Tom Lendacky wrote: > > Ideally, having a pool of shared pages for DMA, outside of standard > > SWIOTLB, might be a good thing. On x86, SWIOTLB really seems geared > > towards devices that

  1   2   >