From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcaMD-0006EO-PT for qemu-devel@nongnu.org; Mon, 30 Mar 2015 10:08:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcaM7-0000QI-SJ for qemu-devel@nongnu.org; Mon, 30 Mar 2015 10:08:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcaM7-0000QE-NO for qemu-devel@nongnu.org; Mon, 30 Mar 2015 10:07:55 -0400 Date: Mon, 30 Mar 2015 15:07:49 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20150330140748.GC2474@work-vm> References: <1424883128-9841-1-git-send-email-dgilbert@redhat.com> <1424883128-9841-23-git-send-email-dgilbert@redhat.com> <20150313012346.GA11973@voom.redhat.com> <20150313104153.GB2486@work-vm> <551905E0.6020103@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <551905E0.6020103@redhat.com> Subject: Re: [Qemu-devel] [PATCH v5 22/45] postcopy: OS support test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, quintela@redhat.com, qemu-devel@nongnu.org, amit.shah@redhat.com, yanghy@cn.fujitsu.com, David Gibson * Paolo Bonzini (pbonzini@redhat.com) wrote: > > > On 13/03/2015 11:41, Dr. David Alan Gilbert wrote: > >>> > > +#ifdef HOST_X86_64 > >>> > > +#ifndef __NR_userfaultfd > >>> > > +#define __NR_userfaultfd 323 > >> > > >> > Sholdn't this come from the kernel headers imported in the previous > >> > patch? Rather than having an arch-specific hack. > > The header, like the rest of the kernel headers, just provides > > the constant and structure definitions for the call; the syscall numbers > > come from arch specific headers. I guess in the final world I wouldn't > > need this at all since it'll come from the system headers; but what's > > the right way to put this in for new syscalls? > > > > You would just require new _installed_ kernel headers. Then you can use > linux/userfaultfd.h and syscall.h (the latter from glibc, includes > asm/unistd.h to get syscall numbers). > > linux-headers/ is useful for APIs that do not require system calls, or > for APIs that are extensible. However, if a system call is required > (and mandatory) it's simpler to just use installed headers. OK, so then I could check for ifdef __NR_userfault and then do the include and I think that would be safe. Although then what's the best way to tell people to try it out without an updated libc? Or is it best to modify ./configure to detect it? Dave > > Paolo -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK