Received: from eggs.gnu.org ([2001:4830:134:3::10]:57169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frJmS-0002N6-85 for qemu-devel@nongnu.org; Sun, 19 Aug 2018 05:13:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frJmP-0000da-NB for qemu-devel@nongnu.org; Sun, 19 Aug 2018 05:13:52 -0400 From: "Emilio G. Cota" Date: Sun, 19 Aug 2018 05:13:25 -0400 Message-Id: <20180819091335.22863-2-cota@braap.org> In-Reply-To: <20180819091335.22863-1-cota@braap.org> References: <20180819091335.22863-1-cota@braap.org> Subject: [Qemu-devel] [PATCH v2 01/11] rcu_queue: use atomic_set in QLIST_REMOVE_RCU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Peter Crosthwaite , Richard Henderson , David Gibson , Alexander Graf , Riku Voipio , Laurent Vivier , qemu-ppc@nongnu.org To avoid undefined behaviour. Signed-off-by: Emilio G. Cota --- include/qemu/rcu_queue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/rcu_queue.h b/include/qemu/rcu_queue.h index 01be77407b..dd7b3be043 100644 --- a/include/qemu/rcu_queue.h +++ b/include/qemu/rcu_queue.h @@ -112,7 +112,7 @@ extern "C" { (elm)->field.le_next->field.le_prev = \ (elm)->field.le_prev; \ } \ - *(elm)->field.le_prev = (elm)->field.le_next; \ + atomic_set((elm)->field.le_prev, (elm)->field.le_next); \ } while (/*CONSTCOND*/0) /* List traversal must occur within an RCU critical section. */ -- 2.17.1