From patchwork Tue Jun 7 14:42:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Wise X-Patchwork-Id: 9161579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9810760572 for ; Tue, 7 Jun 2016 14:57:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B1DA2723E for ; Tue, 7 Jun 2016 14:57:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FF4E2793B; Tue, 7 Jun 2016 14:57:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C8572723E for ; Tue, 7 Jun 2016 14:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932806AbcFGO5P (ORCPT ); Tue, 7 Jun 2016 10:57:15 -0400 Received: from smtp.opengridcomputing.com ([72.48.136.20]:58942 "EHLO smtp.opengridcomputing.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932411AbcFGO5O (ORCPT ); Tue, 7 Jun 2016 10:57:14 -0400 Received: from smtp.ogc.us (build2.ogc.int [10.10.0.32]) by smtp.opengridcomputing.com (Postfix) with ESMTP id 48D302A02A; Tue, 7 Jun 2016 09:57:14 -0500 (CDT) Received: by smtp.ogc.us (Postfix, from userid 503) id 39C9BE08BE; Tue, 7 Jun 2016 09:57:14 -0500 (CDT) Message-Id: <8dde3b93ddc1251c3487438331590acb099c6360.1465310573.git.root@r9.asicdesigners.com> In-Reply-To: References: From: Steve Wise Date: Tue, 7 Jun 2016 07:42:47 -0700 Subject: [PATCH 2/2] Fail compiles if no platform specific memory barriers exist To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently there is a "generic" implementation for the memory barrier macros in arch.h. These turned out to be insuffient for ARM64 causing memory corruption problems when doing RDMA operations. So going forward, fail a compile on a platform w/o platform-specific memory barrier macros. Signed-off-by: Steve Wise --- include/infiniband/arch.h | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/include/infiniband/arch.h b/include/infiniband/arch.h index c31dd0a..e35ecf0 100644 --- a/include/infiniband/arch.h +++ b/include/infiniband/arch.h @@ -132,12 +132,7 @@ static inline uint64_t ntohll(uint64_t x) { return x; } #else -#warning No architecture specific defines found. Using generic implementation. - -#define mb() asm volatile("" ::: "memory") -#define rmb() mb() -#define wmb() mb() -#define wc_wmb() wmb() +#error No architecture specific memory barrier defines found! #endif