Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp894292pxu; Thu, 3 Dec 2020 15:42:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLXk467AV8XEc+P7Ztyi7wDEmlaO03bI+Oegqkqjm9Z77tMk2mo5tHJucII37F0t9JmZCR X-Received: by 2002:aa7:d593:: with SMTP id r19mr5263467edq.246.1607038964689; Thu, 03 Dec 2020 15:42:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607038964; cv=none; d=google.com; s=arc-20160816; b=ojhgbn8C4ApIYktarG+XVHjNLQFh2B53EFDLhZozX438GVG43uLP0qwgJ+ArPDCoIi kwRO/nCWkr7MVDKTYM8uarsAoqCKUBb2IyaWJRM5eEL+3YnsWWTLrCcx6H/L+nm1DYxU Fr7labZ9l2fjrUqW7cPd/lEiHERC6D+mLCP1uDjsrXhwUizz0H7yKxudZ4rnLVkv7+BK ou5melNDYhoSaRKy2DX1Se0ukfEmXZJplONYD8/d0TuLvOApD0jASb0JEkqnLWlhBbZ4 Fp4BvEMfJIgX2C8KW4337ysz0sw/BCGGqN6ow0ltE2CFhVa2KXiV/BoTaXpQytW+KdUl wNhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:dkim-signature :date; bh=yuu8MHMFEkbp82IwxSZRBVemDmZxE80kvyeOaJ5dgGM=; b=HHAzpAP+aLiExcgrL8/R37jbdjoMCFsFhR0NH7gG5b2lt+dXs7ROHOuOpkTW8uD2Sn IKyP0niB670k17+UDul3PUE5+iyJ90x7+GNzioswkj99qwwdKb0YA8L1p9qQsULwl4Pe 6ZPrpBWbLu+9MfCkhFKCt2lwZ2nVIQQZL1G2wL784i+N6nz5wECR/ZKZ7B3+E7HOvRQ/ eQ6uXi6CsyjE4iNhOzoNj7g6dBwiUORlfpZhYif1H0siUUUJ/W4bc73Nxlct+PDD/Cef zRqq/t9h0RdD0r3DTe+hUlZv3NcAohdvaGc8hdhAFj4S47pBH7phHX364Ibz/DWw4I0t YM7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=mS6E8T6s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si269120ejk.570.2020.12.03.15.41.56; Thu, 03 Dec 2020 15:42:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=mS6E8T6s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387474AbgLCXkB (ORCPT + 99 others); Thu, 3 Dec 2020 18:40:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:44740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727495AbgLCXkA (ORCPT ); Thu, 3 Dec 2020 18:40:00 -0500 Date: Thu, 3 Dec 2020 15:39:16 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1607038759; bh=zDBJmA1njD9c5R9U97XtgqdT27wAv2IVLfk1nPS0FJM=; h=From:To:Cc:Subject:In-Reply-To:References:From; b=mS6E8T6sd+XV4qfkYaIC7AzHKw/6zG99ExlvCv9CM2GiRif+p2YkZqPRApdyQ8W6k 4GQb78gRhspuJjIgU7TpCoScNXnKT9kg7Cb/IBT70e6ZKsRZ74kZc1jLZ9uATm4O+j kPi+AoMzreC1GgZnwmGefOwVW3qrUNdYbrXPS6vE= From: Andrew Morton To: Mike Rapoport Cc: Alexander Viro , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christopher Lameter , Dan Williams , Dave Hansen , David Hildenbrand , Elena Reshetova , "H. Peter Anvin" , Ingo Molnar , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Mark Rutland , Mike Rapoport , Michael Kerrisk , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Rick Edgecombe , Roman Gushchin , Shakeel Butt , Shuah Khan , Thomas Gleixner , Tycho Andersen , Will Deacon , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, linux-riscv@lists.infradead.org, x86@kernel.org, Palmer Dabbelt Subject: Re: [PATCH v14 09/10] arch, mm: wire up memfd_secret system call were relevant Message-Id: <20201203153916.91f0f80dcb8a0fa81fc341fa@linux-foundation.org> In-Reply-To: <20201203062949.5484-10-rppt@kernel.org> References: <20201203062949.5484-1-rppt@kernel.org> <20201203062949.5484-10-rppt@kernel.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 3 Dec 2020 08:29:48 +0200 Mike Rapoport wrote: > From: Mike Rapoport > > Wire up memfd_secret system call on architectures that define > ARCH_HAS_SET_DIRECT_MAP, namely arm64, risc-v and x86. > > ... > > --- a/include/uapi/asm-generic/unistd.h > +++ b/include/uapi/asm-generic/unistd.h > @@ -861,9 +861,13 @@ __SYSCALL(__NR_faccessat2, sys_faccessat2) > __SYSCALL(__NR_process_madvise, sys_process_madvise) > #define __NR_watch_mount 441 > __SYSCALL(__NR_watch_mount, sys_watch_mount) > +#ifdef __ARCH_WANT_MEMFD_SECRET > +#define __NR_memfd_secret 442 > +__SYSCALL(__NR_memfd_secret, sys_memfd_secret) > +#endif Why do we add the ifdef? Can't we simply define the syscall on all architectures and let sys_ni do its thing?