From patchwork Sat Apr 16 19:04:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Otubo X-Patchwork-Id: 8861831 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8ECBFBF29F for ; Sat, 16 Apr 2016 19:05:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA188201B9 for ; Sat, 16 Apr 2016 19:05:42 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6487720173 for ; Sat, 16 Apr 2016 19:05:41 +0000 (UTC) Received: from localhost ([::1]:60207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arVXG-0004jG-GC for patchwork-qemu-devel@patchwork.kernel.org; Sat, 16 Apr 2016 15:05:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arVWy-0004hB-DQ for qemu-devel@nongnu.org; Sat, 16 Apr 2016 15:05:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1arVWw-0006ff-CI for qemu-devel@nongnu.org; Sat, 16 Apr 2016 15:05:20 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:35186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arVWw-0006fa-5O for qemu-devel@nongnu.org; Sat, 16 Apr 2016 15:05:18 -0400 Received: by mail-wm0-x235.google.com with SMTP id a140so70628135wma.0 for ; Sat, 16 Apr 2016 12:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profitbricks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5++LnRZIHQfSrKtQsUDFsA1MQQMQ9Yi+jBmyvQAbHcY=; b=0GkpDnjvN4Icu7Aj6Tc7XF91CcSTJufjaYgWZHi7ySSru8HA0zPt3XMCbDCKAPHiuH 7nKfjkgtP0QoIGfcJXWgUgY5PUv7gb5pDLhlZooYgGuRN7Zw9wGUI956Y0y2OhX+dEyT r8qcdfzWmDrTx/PSRMHT8717yYGmNr3DZgkguse5bjPFlWJDnZYw2pVjlUDct490P46g Lvyh8MDmo2nYWmSkRKHU+uBiQE79OCEbpde+el3JO/IjIcZytwikDZCJEGPpvUu0tk4G ohC2TvM8sOWjvGJd/IJ6Pnzl4AfyGueHVpJGyuU4fTRJYeIA+tR0eGyILz+u2x0o4cUN 07sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5++LnRZIHQfSrKtQsUDFsA1MQQMQ9Yi+jBmyvQAbHcY=; b=WxEKSuKtlMkLZPGpAZaupMD4Fv+1QUL4e7g0qnW0gWUpvfwq4+1IOUogC+daMUWxln xhNc5I5FdEHdaakVzov/4jbeTd6M3GiFYyWr2I0SJ2ZFOaT1gcO8PV8p0wL7WFu9SfKN kcTozv7tI4FYHbIYCcinYqiitCMGh0DP6qWRrRZEHdzqyRdMxHJxYdhwmoEUh7BRfPtA +2aHfeFPxjeuoCAQMTkNPUWvRF+8ljFBbN7jiJ+nU2+8HRHCMHVydf9Z3aAtwtiR5Wsf sqPQX846m5q2L3PNnbbf5zpS5VVVFubv7lXJgsL5M4KXsBQhkJEYweYmZcL08Kez3a5g HN1Q== X-Gm-Message-State: AOPr4FUgLc2HyaxR/+wdVVGAwrNKbFOWjK2DBxAnocgoPrV6XHzkEo07TnQGfGFaZjOwxOHY X-Received: by 10.194.184.38 with SMTP id er6mr26771798wjc.93.1460833517541; Sat, 16 Apr 2016 12:05:17 -0700 (PDT) Received: from vader.pb.local ([62.217.45.26]) by smtp.gmail.com with ESMTPSA id n3sm55236224wja.6.2016.04.16.12.05.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 Apr 2016 12:05:17 -0700 (PDT) From: Eduardo Otubo To: qemu-devel@nongnu.org Date: Sat, 16 Apr 2016 21:04:31 +0200 Message-Id: <1460833472-14855-3-git-send-email-eduardo.otubo@profitbricks.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1460833472-14855-1-git-send-email-eduardo.otubo@profitbricks.com> References: <1460833472-14855-1-git-send-email-eduardo.otubo@profitbricks.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::235 Subject: [Qemu-devel] [PULL 02/03] seccomp: Whitelist cacheflush since 2.2.0 not 2.2.3 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, James Hogan Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: James Hogan The cacheflush system call (found on MIPS and ARM) has been included in the libseccomp header since 2.2.0, so include it back to that version. Previously it was only enabled since 2.2.3 since that is when it was enabled properly for ARM. This will allow seccomp support to be enabled for MIPS back to libseccomp 2.2.0. Signed-off-by: James Hogan Reviewed-By: Andrew Jones Acked-by: Eduardo Otubo --- qemu-seccomp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qemu-seccomp.c b/qemu-seccomp.c index 2866e3c..138ee02 100644 --- a/qemu-seccomp.c +++ b/qemu-seccomp.c @@ -16,11 +16,13 @@ #include #include "sysemu/seccomp.h" +/* For some architectures (notably ARM) cacheflush is not supported until + * libseccomp 2.2.3, but configure enforces that we are using a more recent + * version on those hosts, so it is OK for this check to be less strict. + */ #if SCMP_VER_MAJOR >= 3 #define HAVE_CACHEFLUSH -#elif SCMP_VER_MAJOR == 2 && SCMP_VER_MINOR >= 3 - #define HAVE_CACHEFLUSH -#elif SCMP_VER_MAJOR == 2 && SCMP_VER_MINOR == 2 && SCMP_VER_MICRO >= 3 +#elif SCMP_VER_MAJOR == 2 && SCMP_VER_MINOR >= 2 #define HAVE_CACHEFLUSH #endif