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 1AA68C25B0C for ; Mon, 8 Aug 2022 08:06:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 815498E0002; Mon, 8 Aug 2022 04:06:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C3108E0001; Mon, 8 Aug 2022 04:06:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B2048E0002; Mon, 8 Aug 2022 04:06:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5CE4B8E0001 for ; Mon, 8 Aug 2022 04:06:33 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 2DE891C620C for ; Mon, 8 Aug 2022 08:06:33 +0000 (UTC) X-FDA: 79775693466.04.B6F182E Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by imf25.hostedemail.com (Postfix) with ESMTP id 9F453A0160 for ; Mon, 8 Aug 2022 08:06:32 +0000 (UTC) Received: from mail-ej1-f47.google.com ([209.85.218.47]) by mrelayeu.kundenserver.de (mreue106 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MORR2-1o2lmD0DXi-00Pyet for ; Mon, 08 Aug 2022 10:06:31 +0200 Received: by mail-ej1-f47.google.com with SMTP id m4so15153029ejr.3 for ; Mon, 08 Aug 2022 01:06:30 -0700 (PDT) X-Gm-Message-State: ACgBeo3PUAmQ0GtEojAC+rRvIat0x3eKF/Aqw8hNOFzLZVx2SMT7Zno1 a+3jqLwgq8deeUYbV81Ve4NvP80mr5tXlLOAh1Y= X-Google-Smtp-Source: AA6agR4GgGd8n+xBtHZRIIZDSb3raNbv0NcwwkrbkWgSf6AjnZq/RmNzizI0Ihs+/xXm5AI+HvVE+1WgmC6BUZ+FEN4= X-Received: by 2002:a17:906:9b08:b0:730:5d3c:4b1b with SMTP id eo8-20020a1709069b0800b007305d3c4b1bmr13057897ejc.606.1659945990183; Mon, 08 Aug 2022 01:06:30 -0700 (PDT) MIME-Version: 1.0 References: <20220807172854.12971-1-rdunlap@infradead.org> <3a4dad85-1102-1bab-c0af-a2c6827663b1@infradead.org> In-Reply-To: <3a4dad85-1102-1bab-c0af-a2c6827663b1@infradead.org> From: Arnd Bergmann Date: Mon, 8 Aug 2022 10:06:14 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] asm-generic: unistd.h: make 'compat_sys_fadvise64_64' conditional To: Randy Dunlap Cc: Arnd Bergmann , 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 Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:lWzIpt1FZorc9IzioOjrspv8TyuVWO0Tby9mEij4uTgcsRd9Bqc D3nL9/oLQ+SGvKm1P+k59C2+X/QRa+JEu2WmdKvx9sB4IEPY6WocGVMuyHkfCN8xUe+69na 3QD5ki3VhrZbTQfWiVTEMUTIUXoZM2ZXYQvyWEGkO814WHLVP19Y3XCK3u4x4NqfMgwUNYF cEJs0h5rA+PBmBVGPDHoA== X-UI-Out-Filterresults: notjunk:1;V03:K0:Sh/9A9NYYaw=:cx/lcMejYHilWt52tFndbL xsX5UVF53UICOSxj/XZp2xSeZrY6FNnRdAwTaywCV4VbLPgbtbr52PTQymzgoibxUnDC46VY+ w25bQ/MEV9XzOBi/RkDep7rMGJZTn44RE+84KN52xE9c+rAV6UvW73lzrkMgjDrDdNxyyG4O+ ppDG4YhI1TbKyQZSjWl2kX/WouE/Th+UUTtcYBlvmwcFoBrhOgLup/UxFn3S4hxjH/Fcf6INC MVfH3pUxgTnhQhVHYL1crDwkJutsD5WMGAQ7SHOVWfCMdG5YJoamc5RGYEys1nNmPESVXajdT Qp3ySx38X/LIanj+0Dm54+9bfEW9MZH6COmTRLD3PuUUVjyMbF9qkbwqj5RzYnOpPrUwSyKxu PQwqvvo2aR6J1bTf87gtqZi44YPhdtPWAduAtQHRm91wc0yw3yeJfdobNEtuMcxxpZvMFFa1Z g7iZcNdyis//wqCGhSyrPlb24SkBp+SBjmtlQzt0yDnZwyi01Zh/K9Sf5nSfq3v4nocRZmH6L jSr18wr3LLlVOPCsG7vW38fn5QAVcXA49fToIM4Lt7LQO5+3sV9hhhQlKCFNxYzolGMeLM3+k vfToJGfXqrC08sI8Y1pT9HwBr34IdqopdmsteQwppkhHs3vS42M0QEfWYpT/7HVkOhqk7xvAF jTHqmT90pf8+LN0z0ZpBS9Gwv2oCH7qJ55hmB1LffCMGY4hbo1UB/GuicZcj5KHyRCr+Fxi/B 53P/SiUyhgOtT08vBfrv5jV8GP0KFWeacY27+mpdCwNKjsKmEaKMCzMJSV6tCP3HKcJ+OLu7c 1DvP+hRm6RnrCmEbPcn+DSxSFLuoRTHS6Yp3dg8DFrOUHRMbeM0ciHV2QsQQaa6c3E2JkowKh 8th4Dy0rvYw11ADckWrg== ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659945992; a=rsa-sha256; cv=none; b=Ietk2OfDsBaDfgn9U+ae7IDwSu3N87kQ52iGVRlRb8NFU66CtY+vM4n5rWHflqLK1YzJKZ WeNxs0FEIUkqY/KX6qYEuuwbS1O8PFISLT0x+kZwTj3ebi1WR84arxLKlPxrhCgUW+hcuR tvX8zAjddvuDOrUjKzCax6XPE9am79c= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; spf=none (imf25.hostedemail.com: domain of arnd@arndb.de has no SPF policy when checking 212.227.17.13) smtp.mailfrom=arnd@arndb.de; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659945992; 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: in-reply-to:in-reply-to:references:references; bh=NxJumRNOjPsyMsCe/6e/nAOP2KJw9Rh0Z9TYrRxcthw=; b=7lg7z29vIpfMczfvf+uuR8503hc5h3XeYmPd5YHTYrySh0B5vC7hPD7uHBdy9YY50CocQ/ EBUdRYlKFs8wzhfbU7zJmBlSKLylTmzdxXHHRMkoUM4i4R5BaZ8ae+XN/auoHhiUioBHSQ UcjDAW0eWZXGVXjApKljFkkeyTBOSfM= X-Rspamd-Queue-Id: 9F453A0160 Authentication-Results: imf25.hostedemail.com; dkim=none; spf=none (imf25.hostedemail.com: domain of arnd@arndb.de has no SPF policy when checking 212.227.17.13) smtp.mailfrom=arnd@arndb.de; dmarc=none X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: ygtp7e7j6rf1wq9ss3tn9x56mrasqroc X-HE-Tag: 1659945992-269239 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: On Mon, Aug 8, 2022 at 12:39 AM Randy Dunlap wrote: > On 8/7/22 12:44, Arnd Bergmann wrote: > > On Sun, Aug 7, 2022 at 7:28 PM Randy Dunlap wrote: > >> > > > > 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, Ok. > although I can look into making more entries in > unconditional. This would be a nice cleanup, but it does involve making sure that all prototypes are compatible with the implementation on each architecture. I think we should definitely do this, it's just not as simple as removing each #ifdef in linux/compat.h and linux/syscall.h > That would also mean adding them to kernel/sys_ni.c, right? > (if not already there) That part should be completely independent. If the entry in kernel/sys_ni.c is missing, that causes a link failure, while an incorrect #ifdef would cause a compile-time error for the missing prototype. Arnd