Received: from eggs.gnu.org ([2001:4830:134:3::10]:53302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoWHi-0004oE-FS for qemu-devel@nongnu.org; Fri, 08 Apr 2016 09:17:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoWHe-00081P-CA for qemu-devel@nongnu.org; Fri, 08 Apr 2016 09:17:14 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:55545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoWHe-00080x-5k for qemu-devel@nongnu.org; Fri, 08 Apr 2016 09:17:10 -0400 From: James Hogan Date: Fri, 8 Apr 2016 14:16:33 +0100 Message-ID: <1460121394-31975-2-git-send-email-james.hogan@imgtec.com> In-Reply-To: <1460121394-31975-1-git-send-email-james.hogan@imgtec.com> References: <1460121394-31975-1-git-send-email-james.hogan@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v2 1/2] seccomp: Whitelist cacheflush since 2.2.0 not 2.2.3 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Andrew Jones , Eduardo Otubo , Aurelien Jarno , 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 Cc: Eduardo Otubo Cc: Aurelien Jarno --- Changes in v2: - Added Peter's comment --- qemu-seccomp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qemu-seccomp.c b/qemu-seccomp.c index 2866e3c2a660..138ee022a8fe 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 -- 2.4.10