virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>, linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org, John Fastabend <john.fastabend@gmail.com>,
	David Miller <davem@davemloft.net>,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH net-next 12/12] tools/virtio: fix smp_mb on x86
Date: Fri, 26 Jan 2018 11:56:14 +0800	[thread overview]
Message-ID: <f2581b9f-9e0d-4db5-ee9d-a235bb0a1842@redhat.com> (raw)
In-Reply-To: <1516923320-16959-16-git-send-email-mst@redhat.com>



On 2018年01月26日 07:36, Michael S. Tsirkin wrote:
> Offset 128 overlaps the last word of the redzone.
> Use 132 which is always beyond that.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>   tools/virtio/ringtest/main.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/virtio/ringtest/main.h b/tools/virtio/ringtest/main.h
> index 593a328..301d59b 100644
> --- a/tools/virtio/ringtest/main.h
> +++ b/tools/virtio/ringtest/main.h
> @@ -111,7 +111,7 @@ static inline void busy_wait(void)
>   }
>   
>   #if defined(__x86_64__) || defined(__i386__)
> -#define smp_mb()     asm volatile("lock; addl $0,-128(%%rsp)" ::: "memory", "cc")

Just wonder did "rsp" work for __i386__ ?

Thanks

> +#define smp_mb()     asm volatile("lock; addl $0,-132(%%rsp)" ::: "memory", "cc")
>   #else
>   /*
>    * Not using __ATOMIC_SEQ_CST since gcc docs say they are only synchronized

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  parent reply	other threads:[~2018-01-26  3:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1516923320-16959-1-git-send-email-mst@redhat.com>
2018-01-25 23:36 ` [PATCH net-next 09/12] tools/virtio: switch to __ptr_ring_empty Michael S. Tsirkin
2018-01-25 23:36 ` [PATCH net-next 10/12] tools/virtio: more stubs to fix tools build Michael S. Tsirkin
2018-01-25 23:36 ` [PATCH net-next 11/12] tools/virtio: copy READ/WRITE_ONCE Michael S. Tsirkin
2018-01-25 23:36 ` [PATCH net-next 12/12] tools/virtio: fix smp_mb on x86 Michael S. Tsirkin
     [not found] ` <1516923320-16959-16-git-send-email-mst@redhat.com>
2018-01-26  3:56   ` Jason Wang [this message]
2018-01-26 13:45     ` Michael S. Tsirkin

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=f2581b9f-9e0d-4db5-ee9d-a235bb0a1842@redhat.com \
    --to=jasowang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=john.fastabend@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).