From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtNR6-0005U3-HC for qemu-devel@nongnu.org; Mon, 02 Nov 2015 17:18:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtNR2-0007eE-ID for qemu-devel@nongnu.org; Mon, 02 Nov 2015 17:18:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42580) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtNR2-0007dr-DJ for qemu-devel@nongnu.org; Mon, 02 Nov 2015 17:18:40 -0500 Date: Mon, 2 Nov 2015 16:18:33 -0600 From: Andrew Jones Message-ID: <20151102221833.GC5279@hawk.localdomain> References: <1446212690-7656-2-git-send-email-eduardo.otubo@profitbricks.com> <1446486994-29913-1-git-send-email-drjones@redhat.com> <20151102190435.GB5279@hawk.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2] seccomp: add cacheflush to whitelist List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Eduardo Otubo On Mon, Nov 02, 2015 at 08:37:15PM +0000, Peter Maydell wrote: > On 2 November 2015 at 19:04, Andrew Jones wrote: > > On Mon, Nov 02, 2015 at 06:09:41PM +0000, Peter Maydell wrote: > >> On 2 November 2015 at 17:56, Andrew Jones wrote: > >> > cacheflush is an arm-specific syscall that qemu built for arm > >> > uses. Add it to the whitelist, but only if we're linking with > >> > a recent enough libseccomp. > >> > > >> > Signed-off-by: Andrew Jones > >> > --- > >> > v2: only add cacheflush if libseccomp supports it > >> > > >> > qemu-seccomp.c | 9 ++++++++- > >> > 1 file changed, 8 insertions(+), 1 deletion(-) > >> > > >> > diff --git a/qemu-seccomp.c b/qemu-seccomp.c > >> > index 80d034a8d5190..e76097e958779 100644 > >> > --- a/qemu-seccomp.c > >> > +++ b/qemu-seccomp.c > >> > @@ -16,6 +16,10 @@ > >> > #include > >> > #include "sysemu/seccomp.h" > >> > > >> > +#if SCMP_VER_MAJOR >= 2 && SCMP_VER_MINOR >= 2 && SCMP_VER_MICRO >= 3 > >> > +#define HAVE_CACHEFLUSH > >> > +#endif > >> > >> This will claim that a hypothetical future version 3.0.0 does not > >> have cacheflush... > > > > Indeed. Sigh... In that case, how about just > > > > #if defined(TARGET_ARM) || defined(TARGET_AARCH64) > > { SCMP_SYS(cacheflush), 240 }, > > #endif > > You want to be checking based on the host architecture, > not the target architecture. Also, not doing the check based > on seccomp version means there's no hint in the code that the > ifdefs become obsolete if we raise our cross-architecture > minimum seccomp version requirement in the future, so really > a version check is better I think. Right. OK, I'll stop flinging junk and pull a better version check together. Thanks, drew > > thanks > -- PMM >