From owner-svn-src-head@freebsd.org Mon Feb 29 04:58:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F30DAAB8840; Mon, 29 Feb 2016 04:58:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5DAE17D3; Mon, 29 Feb 2016 04:58:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1T4weg1007966; Mon, 29 Feb 2016 04:58:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1T4we0O007965; Mon, 29 Feb 2016 04:58:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201602290458.u1T4we0O007965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 29 Feb 2016 04:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296180 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Feb 2016 04:58:42 -0000 Author: sephe Date: Mon Feb 29 04:58:40 2016 New Revision: 296180 URL: https://svnweb.freebsd.org/changeset/base/296180 Log: hyperv: Use proper fence function to keep store-load order for msgs sfence only makes sure about the store-store order, which is not sufficient here. Use atomic_thread_fence_seq_cst() as suggested jhb and kib (a locked op in the nutshell, which should have the Reviewed by: jhb, kib, Jun Su MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5436 Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Feb 29 04:50:24 2016 (r296179) +++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Feb 29 04:58:40 2016 (r296180) @@ -117,7 +117,7 @@ handled: * not deliver any more messages * since there is no empty slot */ - wmb(); + atomic_thread_fence_seq_cst(); if (msg->header.message_flags.u.message_pending) { /* @@ -187,7 +187,7 @@ hv_vmbus_isr(struct trapframe *frame) * not deliver any more messages * since there is no empty slot */ - wmb(); + atomic_thread_fence_seq_cst(); if (msg->header.message_flags.u.message_pending) { /*