From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 199F2C19F2A for ; Sun, 7 Aug 2022 22:39:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 591958E0002; Sun, 7 Aug 2022 18:39:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 540DC8E0001; Sun, 7 Aug 2022 18:39:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 408838E0002; Sun, 7 Aug 2022 18:39:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2D6AA8E0001 for ; Sun, 7 Aug 2022 18:39:12 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 062BC40511 for ; Sun, 7 Aug 2022 22:39:12 +0000 (UTC) X-FDA: 79774263744.05.6801E00 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf26.hostedemail.com (Postfix) with ESMTP id DCE5714003F for ; Sun, 7 Aug 2022 22:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=dLjSYAzCh4IBJ/gcod+IKEbUhjWe/9Of5cFDsSCQDGI=; b=310JJornQDy4RnuqU1FkM3sUOA RlpcAU9IwdVoQQ6mrP19n3L198KdGW6/P0D0oi2Dq85A9mbT0Ncxs4iD7+2BKF0ElO+d111fORGqn yhhSpdqxIK/H+MwbQlBidthWbBvcOyT7ldcjddq7blgvwm1YfhVVriwRCUhj8UlSeXcEPF3INm5yt ESo4Cw2KMzmgTE3idAITUEbr2mKi6N4gBLcXlgm4bVITxZZ5y8/IaAOpMUo4mhFccmGDW5BNoAmvg 2dkUlCebB8v2ZsivvfmmVIIqtgyIbvyYUIV61nw17r54FMDO06+MHv3DGrgUfn7vDTuGujDTaJXGH hl62BVig==; Received: from [2601:1c0:6280:3f0::a6b3] by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKovI-003VFb-9Q; Sun, 07 Aug 2022 22:39:04 +0000 Message-ID: <3a4dad85-1102-1bab-c0af-a2c6827663b1@infradead.org> Date: Sun, 7 Aug 2022 15:39:01 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] asm-generic: unistd.h: make 'compat_sys_fadvise64_64' conditional Content-Language: en-US To: Arnd Bergmann Cc: linux-kernel@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, Andrew Morton , linux-mm@kvack.org References: <20220807172854.12971-1-rdunlap@infradead.org> From: Randy Dunlap In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659911951; a=rsa-sha256; cv=none; b=ZjFMqgI0D+Aw7VsbPyEoIp6Qwah2a7MMMoxHMbZuN70cdinognnOMeFiHRroUo/N3ZBYgP 6fU/K0P7LiML565BtuOi3AXE3IJMcWE4ertChx/r6CKIxdlqsUtcmoM7jhV/Fqg8e4MvOW rR3K8zm7dECoFtsi5+86lyZPmjDttys= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=310JJorn; spf=none (imf26.hostedemail.com: domain of rdunlap@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=rdunlap@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659911951; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=dLjSYAzCh4IBJ/gcod+IKEbUhjWe/9Of5cFDsSCQDGI=; b=K7Uaail0bw/+8S8efLG4CyWA9poZMgGfRnTqNCCl5DZx5jbYs1hxGaZ2wcw4aHVUq369mX tixDQSM/A4jRBTwyaYHrnQ+AvpaPCbMv0HqM2FspAOE2vxJ33GLgNvgSgw3Tqe+N2227Ji q2i7xlTq/gd9zMHA+UYh3XoOV46dQkQ= X-Rspamd-Queue-Id: DCE5714003F Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=310JJorn; spf=none (imf26.hostedemail.com: domain of rdunlap@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=rdunlap@infradead.org; dmarc=none X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: b7g1db9o8coqqnwjhospbknifq11z3tp X-HE-Tag: 1659911950-225631 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Arnd, On 8/7/22 12:44, Arnd Bergmann wrote: > On Sun, Aug 7, 2022 at 7:28 PM Randy Dunlap wrote: >> >> Don't require 'compat_sys_fadvise64_64' when >> __ARCH_WANT_COMPAT_FADVISE64_64 is not set. >> >> Fixes this build error when CONFIG_ADVISE_SYSCALLS is not set: >> >> include/uapi/asm-generic/unistd.h:649:49: error: 'compat_sys_fadvise64_64' undeclared here (not in a function); did you mean 'ksys_fadvise64_64'? >> 649 | __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64) >> arch/riscv/kernel/compat_syscall_table.c:12:42: note: in definition of macro '__SYSCALL' >> 12 | #define __SYSCALL(nr, call) [nr] = (call), >> include/uapi/asm-generic/unistd.h:649:1: note: in expansion of macro '__SC_COMP' >> 649 | __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64) >> >> Signed-off-by: Randy Dunlap >> Cc: Paul Walmsley >> Cc: Palmer Dabbelt >> Cc: Albert Ou >> Cc: linux-riscv@lists.infradead.org >> Cc: Arnd Bergmann >> Cc: linux-arch@vger.kernel.org >> Cc: Andrew Morton >> Cc: linux-mm@kvack.org >> --- >> include/uapi/asm-generic/unistd.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> --- a/include/uapi/asm-generic/unistd.h >> +++ b/include/uapi/asm-generic/unistd.h >> @@ -645,8 +645,10 @@ __SC_COMP(__NR_execve, sys_execve, compa >> #define __NR3264_mmap 222 >> __SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap) >> /* mm/fadvise.c */ >> +#ifdef __ARCH_WANT_COMPAT_FADVISE64_64 >> #define __NR3264_fadvise64 223 >> __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64) >> +#endif >> > > This does not work: __ARCH_WANT_COMPAT_FADVISE64_64 is defined in > arch/riscv/include/asm/unistd.h, which is not a UAPI header. By making the line > conditional on this, user space no longer sees the macro definition. > > It looks like you also drop the native definition on all architectures other > than riscv here. What we probably want is to just make all the > declarations in include/linux/compat.h unconditional and not have them > depend on architecture specific macros. Some of these may have > incompatible prototypes depending on the architecture, but if we run > into those, I would suggest we just give them unique names. Thanks for the comments. With the other patch to kernel/sys_ni.c, this one is no longer needed, although I can look into making more entries in unconditional. That would also mean adding them to kernel/sys_ni.c, right? (if not already there) -- ~Randy