Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-17 Thread Richard Henderson
On 2/17/21 3:15 AM, Peter Maydell wrote: > This isn't aarch64-host-specific, though, is it? It's going to be > the situation for any host with a relaxed memory model. Yes. I intend to make the code-generation changes generic. > Do we really > want to make all loads and stores lower-performance b

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-17 Thread Peter Maydell
On Wed, 17 Feb 2021 at 04:31, Richard Henderson wrote: > On 2/16/21 8:15 AM, Thomas Huth wrote: > With > > diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc > index 1376cdc404..3c5f38be62 100644 > --- a/tcg/aarch64/tcg-target.c.inc > +++ b/tcg/aarch64/tcg-target.c.inc > @@ -

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Richard Henderson
On 2/16/21 8:15 AM, Thomas Huth wrote: > On 16/02/2021 15.40, Halil Pasic wrote: >> On Tue, 16 Feb 2021 12:00:56 +0100 >> Thomas Huth wrote: >> >>> According to the virtio specification, a memory barrier should be >>> used before incrementing the idx field in the "available" ring. >>> So far, we d

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Halil Pasic
On Tue, 16 Feb 2021 17:15:19 +0100 Thomas Huth wrote: > >> (Note: The virtio spec also talks about using a memory barrier > >> *after* incrementing the idx field, but if I understood correctly > >> this is only required when using notification suppression - which > >> we don't use in the s390-ccw

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Peter Maydell
On Tue, 16 Feb 2021 at 16:15, Thomas Huth wrote: > I was just about to reply that this is certainly not necessary, since > the DIAGNOSE instruction that we use for the notification hypercall > should be serializing anyway ... but after looking at the PoP, it > actually is not marked as a serializi

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Thomas Huth
On 16/02/2021 15.40, Halil Pasic wrote: On Tue, 16 Feb 2021 12:00:56 +0100 Thomas Huth wrote: According to the virtio specification, a memory barrier should be used before incrementing the idx field in the "available" ring. So far, we did not do this in the s390-ccw bios yet, but recently Pete

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Cornelia Huck
On Tue, 16 Feb 2021 15:40:10 +0100 Halil Pasic wrote: > On Tue, 16 Feb 2021 12:00:56 +0100 > Thomas Huth wrote: > > > According to the virtio specification, a memory barrier should be > > used before incrementing the idx field in the "available" ring. > > So far, we did not do this in the s390-

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Cornelia Huck
On Tue, 16 Feb 2021 14:37:22 + Peter Maydell wrote: > On Tue, 16 Feb 2021 at 14:35, Thomas Huth wrote: > > > > On 16/02/2021 15.32, Peter Maydell wrote: > > > On Tue, 16 Feb 2021 at 14:30, Cornelia Huck wrote: > > >> Step 4 in "2.7.13 Supplying Buffers to The Device": > > >> > > >> "The

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Halil Pasic
On Tue, 16 Feb 2021 12:00:56 +0100 Thomas Huth wrote: > According to the virtio specification, a memory barrier should be > used before incrementing the idx field in the "available" ring. > So far, we did not do this in the s390-ccw bios yet, but recently > Peter Maydell saw problems with the s39

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Peter Maydell
On Tue, 16 Feb 2021 at 14:35, Thomas Huth wrote: > > On 16/02/2021 15.32, Peter Maydell wrote: > > On Tue, 16 Feb 2021 at 14:30, Cornelia Huck wrote: > >> Step 4 in "2.7.13 Supplying Buffers to The Device": > >> > >> "The driver performs a suitable memory barrier to ensure the device > >> sees th

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Thomas Huth
On 16/02/2021 15.32, Peter Maydell wrote: On Tue, 16 Feb 2021 at 14:30, Cornelia Huck wrote: Step 4 in "2.7.13 Supplying Buffers to The Device": "The driver performs a suitable memory barrier to ensure the device sees the updated descriptor table and available ring before the next step." I t

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Peter Maydell
On Tue, 16 Feb 2021 at 14:30, Cornelia Huck wrote: > Step 4 in "2.7.13 Supplying Buffers to The Device": > > "The driver performs a suitable memory barrier to ensure the device > sees the updated descriptor table and available ring before the next > step." I thought that my first time through the

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Cornelia Huck
On Tue, 16 Feb 2021 15:21:45 +0100 Thomas Huth wrote: > On 16/02/2021 12.47, Cornelia Huck wrote: > > On Tue, 16 Feb 2021 12:00:56 +0100 > > Thomas Huth wrote: > > > >> According to the virtio specification, a memory barrier should be > >> used before incrementing the idx field in the "availa

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Thomas Huth
On 16/02/2021 12.47, Cornelia Huck wrote: On Tue, 16 Feb 2021 12:00:56 +0100 Thomas Huth wrote: According to the virtio specification, a memory barrier should be used before incrementing the idx field in the "available" ring. So far, we did not do this in the s390-ccw bios yet, but recently Pe

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Cornelia Huck
On Tue, 16 Feb 2021 12:00:56 +0100 Thomas Huth wrote: > According to the virtio specification, a memory barrier should be > used before incrementing the idx field in the "available" ring. > So far, we did not do this in the s390-ccw bios yet, but recently > Peter Maydell saw problems with the s39

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Thomas Huth
On 16/02/2021 12.43, Peter Maydell wrote: On Tue, 16 Feb 2021 at 11:01, Thomas Huth wrote: According to the virtio specification, a memory barrier should be used before incrementing the idx field in the "available" ring. So far, we did not do this in the s390-ccw bios yet, but recently Peter Ma

Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Peter Maydell
On Tue, 16 Feb 2021 at 11:01, Thomas Huth wrote: > According to the virtio specification, a memory barrier should be > used before incrementing the idx field in the "available" ring. > So far, we did not do this in the s390-ccw bios yet, but recently > Peter Maydell saw problems with the s390-ccw

[PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code

2021-02-16 Thread Thomas Huth
According to the virtio specification, a memory barrier should be used before incrementing the idx field in the "available" ring. So far, we did not do this in the s390-ccw bios yet, but recently Peter Maydell saw problems with the s390-ccw bios when running the qtests on an aarch64 host (the bios