Date: Wed, 15 Jun 2016 05:31:36 +0000 (UTC) From: Sepherosa Ziehau <sephe@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301914 - stable/10/sys/dev/hyperv/vmbus Message-ID: <201606150531.u5F5VaDX001583@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sephe Date: Wed Jun 15 05:31:35 2016 New Revision: 301914 URL: https://svnweb.freebsd.org/changeset/base/301914 Log: MFC 296180,297634 296180 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 <junsu microsoft com> MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5436 297634 hyperv: Use mb() instead of atomic_thread_fence_seq_cst() Since atomic_thread_fence_seq_cst() will become compiler fence on UP kernel. Reviewed by: kib, Dexuan Cui <decui microsoft com> MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5852 Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed Jun 15 05:16:37 2016 (r301913) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed Jun 15 05:31:35 2016 (r301914) @@ -116,8 +116,12 @@ handled: * message_pending and EOMing. Otherwise, the EOMing will * not deliver any more messages * since there is no empty slot + * + * NOTE: + * mb() is used here, since atomic_thread_fence_seq_cst() + * will become compler fence on UP kernel. */ - wmb(); + mb(); if (msg->header.message_flags.u.message_pending) { /* @@ -186,8 +190,12 @@ hv_vmbus_isr(struct trapframe *frame) * message_pending and EOMing. Otherwise, the EOMing will * not deliver any more messages * since there is no empty slot + * + * NOTE: + * mb() is used here, since atomic_thread_fence_seq_cst() + * will become compler fence on UP kernel. */ - wmb(); + mb(); if (msg->header.message_flags.u.message_pending) { /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606150531.u5F5VaDX001583>