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 X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E93F8C43464 for ; Sat, 19 Sep 2020 05:34:00 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6C35520773 for ; Sat, 19 Sep 2020 05:34:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="xQnAgXHX"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Pklvwxxy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C35520773 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lRROJEc5qgH8oCONiM8oeqj108gBfZzNe0z45u+Zloo=; b=xQnAgXHXiU+WZiZTgTrlZxaM7 /L/ZEuopTjRobX3CjzXa3udAse7dZ/in5WARAQONoX7Ni4n9zTEpkPKz42mwiRJglx4p4iesNZIAW vIa/cmnBwihyo/Ns/KbnAWSS2WhACHA6gOX67uMM9xv8IF5lU9c4/Mf0t3pjzrT1qoDcCVPiE5CBs OEAmILzc7+WkhGyqrFfNYwArNQwkeIisHi6e89uyI6dN6EMmaLbpMeqh9e9pu7Yz4W59OqHa037e7 kk3M+WsPtEE5OSsZwjZ25P5NKYj7+1PXn1YUsXHZAy/uM+JSk97MlPByqtTakmTG5g8a/E1ojy3vq q0kUlIosw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJVUF-0005UQ-Gd; Sat, 19 Sep 2020 05:32:39 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJVUB-0005UB-Fn for linux-arm-kernel@merlin.infradead.org; Sat, 19 Sep 2020 05:32:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5l9UdMdT1kpasilHhGsGPjscN8WXGeNxjxm4ligfssk=; b=PklvwxxyywnV/HztolsBfh+KxB p+DlUY5tfy5HxdLj9mLod7nWbg9/RLtsgLrCV8I/JaVHsrldswQqbhkGeWbX5F4Hgz8jPiHSv73wh ZeB9Gm6dscU1ihdBAlLiCp443+GLOyVy4v4hxP0Va/Z98gWKIWifnpucMizD7IeNpdotxVVrDdu1u A57dTGJOMfP7zxeb7K4kYxPGHjVR/PubVK6dABHRBMqENzmWy2ssSqUxhy+7izdy4SFo7ghTdQfuQ VQTOzvfFnDAF/+Wuw/hyGy1K1lZWTThEFcw2YlUf2mPME0FlHAP5RWon7gnPFOJYdV2Nb1spKRfhN tmGxk44A==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJVU9-0000dS-Kx; Sat, 19 Sep 2020 05:32:33 +0000 Date: Sat, 19 Sep 2020 06:32:33 +0100 From: Christoph Hellwig To: Arnd Bergmann Subject: Re: [PATCH v2 5/9] ARM: oabi-compat: rework epoll_wait/epoll_pwait emulation Message-ID: <20200919053233.GH30063@infradead.org> References: <20200918124624.1469673-1-arnd@arndb.de> <20200918124624.1469673-6-arnd@arndb.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200918124624.1469673-6-arnd@arndb.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Russell King , Christoph Hellwig , linux-mm@kvack.org, Alexander Viro , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > index 855aa7cc9b8e..156880943c16 100644 > --- a/arch/arm/include/asm/syscall.h > +++ b/arch/arm/include/asm/syscall.h > @@ -28,6 +28,17 @@ static inline int syscall_get_nr(struct task_struct *task, > return task_thread_info(task)->syscall & ~__NR_OABI_SYSCALL_BASE; > } > > +static inline bool __in_oabi_syscall(struct task_struct *task) > +{ > + return IS_ENABLED(CONFIG_OABI_COMPAT) && > + (task_thread_info(task)->syscall & __NR_OABI_SYSCALL_BASE); > +} > + > +static inline bool in_oabi_syscall(void) > +{ > + return __in_oabi_syscall(current); > +} > + Maybe split these infrastructure additions into a separate helper? > +#if !defined(CONFIG_ARM) || !defined(CONFIG_OABI_COMPAT) > +/* ARM OABI has an incompatible struct layout and needs a special handler */ > +static inline struct epoll_event __user * > +epoll_put_uevent(__poll_t revents, __u64 data, > + struct epoll_event __user *uevent) > +{ > + if (__put_user(revents, &uevent->events) || > + __put_user(data, &uevent->data)) > + return NULL; > + > + return uevent+1; > +} > +#else > +struct epoll_event __user * > +epoll_put_uevent(__poll_t revents, __u64 data, > + struct epoll_event __user *uevent); > +#endif So after you argued for this variant I still have minor nitpicks: I alway find positive ifdefs better where possible, e.g. #if defined(CONFIG_ARM) && defined(CONFIG_OABI_COMPAT) external declaration here #else the real thing #endif but I still find the fact that the native case goes into the arch helper a little weird. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel