From patchwork Fri Oct 5 14:00:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 189497 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 CF5EC2C0093 for ; Sat, 6 Oct 2012 00:31:26 +1000 (EST) Received: from localhost ([::1]:43536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TK8TV-0008Uk-89 for incoming@patchwork.ozlabs.org; Fri, 05 Oct 2012 10:01:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TK8Sm-0006j7-G3 for qemu-devel@nongnu.org; Fri, 05 Oct 2012 10:01:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TK8Sf-0006TP-Sk for qemu-devel@nongnu.org; Fri, 05 Oct 2012 10:01:12 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:44818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TK8Sf-0006HH-Ld for qemu-devel@nongnu.org; Fri, 05 Oct 2012 10:01:05 -0400 Received: by mail-bk0-f45.google.com with SMTP id jf3so815270bkc.4 for ; Fri, 05 Oct 2012 07:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=KNHf+xyvkvR6ZjW3TYdwbiCWSLfFb80WAVqqi78fsNo=; b=v+hzbse8lmKfZRZtZWY0oWmn/LWqR1pNxGQN+ob4wUQvxu2OOUlJzw9Oxpci+IO6AS WLMxaFThyqSpFHzs5ssxktBtdtJHZFcfhJZYk5B2b2/MWPt/3A8tjqc7MkFq47cac692 nYWbbl7KTrETGzJjInaiNYnYXh28cUNRCRKUw0/vpSnilvtwCDMuPssNlZEpwfFNICG2 hw18AEDBdliON9IQ7fHAB89yw+hStSkell4gmEEhcGLpIwpGEKTuD9H/y59mRUwnQrSY EgLvcugmUo5uHE7yTokBmBRhH8ixNP8IRMRdUhRDze51jF+XqGlL3kk5tKwQSaAMoEF2 tO3A== Received: by 10.205.137.7 with SMTP id im7mr2790209bkc.25.1349445665174; Fri, 05 Oct 2012 07:01:05 -0700 (PDT) Received: from localhost (188-194-152-192-dynip.superkabel.de. [188.194.152.192]) by mx.google.com with ESMTPS id e13sm7779282bkw.12.2012.10.05.07.01.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 05 Oct 2012 07:01:04 -0700 (PDT) From: Stefan Hajnoczi To: Anthony Liguori Date: Fri, 5 Oct 2012 16:00:30 +0200 Message-Id: <1349445632-23674-11-git-send-email-stefanha@gmail.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1349445632-23674-1-git-send-email-stefanha@gmail.com> References: <1349445632-23674-1-git-send-email-stefanha@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.45 Cc: Stefan Weil , qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 10/12] 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 From: Stefan Weil 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 Signed-off-by: Stefan Hajnoczi --- 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")