From patchwork Wed Oct 3 21:11:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 188930 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 722002C0095 for ; Thu, 4 Oct 2012 07:11:19 +1000 (EST) Received: from localhost ([::1]:59311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJWDt-0003U7-Fn for incoming@patchwork.ozlabs.org; Wed, 03 Oct 2012 17:11:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJWDn-0003Tu-GV for qemu-devel@nongnu.org; Wed, 03 Oct 2012 17:11:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJWDm-00075h-Ht for qemu-devel@nongnu.org; Wed, 03 Oct 2012 17:11:11 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:55716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJWDm-00075T-BL; Wed, 03 Oct 2012 17:11:10 -0400 Received: from localhost (v220110690675601.yourvserver.net.local [127.0.0.1]) by v220110690675601.yourvserver.net (Postfix) with ESMTP id B29737280032; Wed, 3 Oct 2012 23:11:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at weilnetz.de Received: from v220110690675601.yourvserver.net ([127.0.0.1]) by localhost (v220110690675601.yourvserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qDT84Qw6MjTc; Wed, 3 Oct 2012 23:11:08 +0200 (CEST) Received: by v220110690675601.yourvserver.net (Postfix, from userid 1000) id 2D73F728003B; Wed, 3 Oct 2012 23:11:08 +0200 (CEST) From: Stefan Weil To: qemu-devel@nongnu.org Date: Wed, 3 Oct 2012 23:11:02 +0200 Message-Id: <1349298662-16666-1-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 78.47.199.172 Cc: qemu-trivial@nongnu.org, Stefan Weil , qemu-stable@nongnu.org, "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH] qemu-barrier: Fix compiler version check for future gcc versions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The current check will give a wrong result for gcc-5.x with x < 4. Using QEMU_GNUC_PREREQ is simpler and fixes that issue. Signed-off-by: Stefan Weil --- With current gcc versions (gcc-4.x) there is no problem. Nevertheless, I suggest to fix this in stable versions, too. Regards Stefan Weil qemu-barrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-barrier.h b/qemu-barrier.h index 7e11197..16f0942 100644 --- a/qemu-barrier.h +++ b/qemu-barrier.h @@ -19,7 +19,7 @@ * mfence on 32 bit as well, e.g. if built with -march=pentium-m. * However, on i386, there seem to be known bugs as recently as 4.3. * */ -#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 +#if QEMU_GNUC_PREREQ(4, 4) #define smp_mb() __sync_synchronize() #else #define smp_mb() asm volatile("lock; addl $0,0(%%esp) " ::: "memory")