From patchwork Fri Aug 15 13:55:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 35465 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 13AC4203C5 for ; Fri, 15 Aug 2014 13:55:49 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id le20sf6739458vcb.5 for ; Fri, 15 Aug 2014 06:55:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :references:mime-version:in-reply-to:user-agent:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe :content-type:content-disposition; bh=LwAtHsQzrQ+eNvkYLlc+Cu/7KHMBazXZu5aDuwRNqa0=; b=Sx34Mtz7yIMWALvQO60yPTQtYCaOhOdXLdvzG97tpLArsnBkt78L/R/6EyrxlRA7jR oUCLRsG3Xo6DhMWWOPQtTbFJvKi4M20STAXN22WiyuLuyrQIL+r8WAyoyVZl29hHZP51 Jqh+ZJLB4Su88ELEJfH7HaT5A2tTf5s2bJnDkpr619dw1nTqpfBSSrSd1Uoh+W41n8Z3 aICr2QE+pG4+s7sSh7Rt7OXlM2RdYC434K6pNYDP/ojkYg6hTZMPQwts6OxHExvzXz7b gPJhnckKB08rCMP7EvqO2daPqpG1ksLAWSaSo15RxYGhkcCXBdRWQ/r6z4oCF7uKdS5f wmHQ== X-Gm-Message-State: ALoCoQn+soU6C+3yMGz2EtB2OPpS4CCPYkxd9zgYONCQHUM8fEkxr5zs9KgFPOh0XIh3vDcXJnvP X-Received: by 10.236.23.230 with SMTP id v66mr252608yhv.53.1408110948842; Fri, 15 Aug 2014 06:55:48 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.170 with SMTP id u39ls1393847qga.21.gmail; Fri, 15 Aug 2014 06:55:48 -0700 (PDT) X-Received: by 10.140.17.79 with SMTP id 73mr24950462qgc.47.1408110948733; Fri, 15 Aug 2014 06:55:48 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id n20si11927590qar.74.2014.08.15.06.55.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Aug 2014 06:55:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id la4so2947219vcb.37 for ; Fri, 15 Aug 2014 06:55:48 -0700 (PDT) X-Received: by 10.52.35.81 with SMTP id f17mr6765884vdj.13.1408110948514; Fri, 15 Aug 2014 06:55:48 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp114449vcb; Fri, 15 Aug 2014 06:55:47 -0700 (PDT) X-Received: by 10.70.130.195 with SMTP id og3mr10288629pdb.59.1408110947198; Fri, 15 Aug 2014 06:55:47 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ko4si8524618pbc.33.2014.08.15.06.55.46 for ; Fri, 15 Aug 2014 06:55:47 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751476AbaHONzp (ORCPT + 26 others); Fri, 15 Aug 2014 09:55:45 -0400 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:40417 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751102AbaHONzn (ORCPT ); Fri, 15 Aug 2014 09:55:43 -0400 Received: from arm.com (edgewater-inn.cambridge.arm.com [10.1.203.34]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id s7FDt6wo016471; Fri, 15 Aug 2014 14:55:06 +0100 (BST) Date: Fri, 15 Aug 2014 14:55:20 +0100 From: Will Deacon To: Vivek Goyal Cc: linux-kernel , Geert Uytterhoeven , "linux-arm-kernel@lists.infradead.org" , Arnd Bergmann , David Herrmann Subject: Re: [PATCH 2/2] asm-generic: add memfd_create system call to unistd.h Message-ID: <20140815135520.GT27466@arm.com> References: <1407764228-7904-1-git-send-email-will.deacon@arm.com> <20140811171511.GF8828@arm.com> <201408112057.01177.arnd@arndb.de> <20140812102734.GG29013@arm.com> <20140812111030.GK29013@arm.com> <20140812123736.GA16961@redhat.com> MIME-Version: 1.0 In-Reply-To: <20140812123736.GA16961@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: will.deacon@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-Disposition: inline On Tue, Aug 12, 2014 at 01:37:36PM +0100, Vivek Goyal wrote: > On Tue, Aug 12, 2014 at 12:10:30PM +0100, Will Deacon wrote: > > Hmm, so whilst I can easily wire-up the new syscall, it's pretty useless for > > anybody other than x86 at the moment. There are a bunch of arch helpers: > > > > arch_kexec_kernel_image_probe > > arch_kexec_kernel_verify_sig > > arch_kexec_kernel_image_load > > arch_kimage_file_post_load_cleanup > > > > which are only implemented for x86 (arch/x86/kernel/machine_kexec_64.c), > > even though I don't really see what makes them arch-specific as opposed to > > file format specific. > > Yes, at this point of time, this system call will work only on x86. Agreed > that primarily it is file format details which are primarily in arch > specific section. > > I think that some of the code will become arch independent as other > arches start implementing this syscall. > > > > > So this syscall will always fail with -ENOEXEC at the moment. Is it still > > worth wiring it up? > > I thought that for other arches I have not even defined the syscall. So > it probably will fail with -ENOSYS. What I meant was, if I wire it into asm-generic/unistd.h then it will return -ENOEXEC for architectures using that file (e.g. arm64). Patch below, but I don't think it's very useful. Will --->8 commit a20104072c8faeeacb2857ce24cdb2818f51ff1a Author: Will Deacon Date: Mon Aug 11 14:24:47 2014 +0100 asm-generic: add kexec_file_load system call to unistd.h Commit cb1052581e2b ("kexec: implementation of new syscall kexec_file_load") added a new system call (kexec_file_load) but didn't update the asm-generic unistd header. This patch adds the new system call to the asm-generic version of unistd.h so that it can be used by architectures such as arm64. Note that without the arch_kexec hooks, all file formats will result in -ENOEXEC. Cc: Arnd Bergmann Cc: Vivek Goyal Reported-by: Geert Uytterhoeven Signed-off-by: Will Deacon --- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 11d11bc5c78f..92ae121fa055 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -705,9 +705,11 @@ __SYSCALL(__NR_seccomp, sys_seccomp) __SYSCALL(__NR_getrandom, sys_getrandom) #define __NR_memfd_create 279 __SYSCALL(__NR_memfd_create, sys_memfd_create) +#define __NR_kexec_file_load 280 +__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load) #undef __NR_syscalls -#define __NR_syscalls 280 +#define __NR_syscalls 281 /* * All syscalls below here should go away really,