Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3825303ybz; Tue, 28 Apr 2020 00:50:36 -0700 (PDT) X-Google-Smtp-Source: APiQypKgjT2vxvc7jeiRk9bqG/WZrtH+ZHEbGgWaO25VuBabeZqcsjAYdBl9+Byue0AF6IDVyX1j X-Received: by 2002:a17:906:3f45:: with SMTP id f5mr6550294ejj.18.1588060235875; Tue, 28 Apr 2020 00:50:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588060235; cv=none; d=google.com; s=arc-20160816; b=T5N3lI1C6YN7CcFt4EFSpSo9a1xhB8/2QW19LsRrVAFcBpJciHt2XPBLqIRYyOi78I Gd6PXSR3Dc547scVfpAhz3K5nv7Ql0CTAUU4gP9AidWSg/kENj+ewRWR11KxRC2K2aDW 607bO539aoXOhQMLfaS+5kXEmoC/06lSnCIKKLnEx/cVaZ+azqyc33LQoCrw3fL1cT8k keBySHPQmzouMGuPU45UYU8j1roEDjujVgCKiARnThNNxPYtgoXGLtQ+RymLEDGjz6nJ uYN1lrEdrU7+0/AWciAGfmCNOekxTjen0kofRu+yN2GnjJdiR+gZcnERa6GqwiC9Ee02 9Wrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/D5HCy4Wb1vBSw0rU5b0xv/hVdj2wXql4oWF52ewv40=; b=fv3AuXNqMDXwuuXS5GVEq0EXLA1JJ82dm/ijNGJKvXFTTP+L5BnV5kRfUZ7xbzPzZO VFAFDiiV6yiNCLYXw7QTpWWtzUbcEBTc5/00YlyEX3pWauA+9paJBuoEWIN1IfOBvRJH ml9WxTfv7rRZXkcEVzHAu5p/HYaGELJIOiClwfoDtdmiDgzEcMKvJHXUWNlj/QjXqZLk aw1j/UpPIBjqB/24/vhUscoa4IiEFjf9T29lR/4HYvf2KJziyXkqRcFvVrvNrlhElbtC unjiK3qcGD1JbStIoNQ0cNJwQvZ8TJBTSR3CYPaK4De4HeDkX9L43vUqGS9YlJAzqqTR 2mjw== ARC-Authentication-Results: i=1; mx.google.com; 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 bs4si1332189ejb.275.2020.04.28.00.50.13; Tue, 28 Apr 2020 00:50:35 -0700 (PDT) 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; 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 S1726581AbgD1Hse (ORCPT + 99 others); Tue, 28 Apr 2020 03:48:34 -0400 Received: from verein.lst.de ([213.95.11.211]:54693 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726282AbgD1Hsa (ORCPT ); Tue, 28 Apr 2020 03:48:30 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id B772568CF0; Tue, 28 Apr 2020 09:48:27 +0200 (CEST) Date: Tue, 28 Apr 2020 09:48:27 +0200 From: Christoph Hellwig To: Christophe Leroy Cc: Christoph Hellwig , Andrew Morton , Arnd Bergmann , Linus Torvalds , linux-kernel@vger.kernel.org, Alexander Viro , Jeremy Kerr , linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, "Eric W . Biederman" Subject: Re: [PATCH 2/7] signal: factor copy_siginfo_to_external32 from copy_siginfo_to_user32 Message-ID: <20200428074827.GA19846@lst.de> References: <20200421154204.252921-1-hch@lst.de> <20200421154204.252921-3-hch@lst.de> <20200425214724.a9a00c76edceff7296df7874@linux-foundation.org> <20200426074039.GA31501@lst.de> <20200427154050.e431ad7fb228610cc6b95973@linux-foundation.org> <20200428070935.GE18754@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 28, 2020 at 09:45:46AM +0200, Christophe Leroy wrote: >> I guess that might be a worthwhile middle ground. Still not a fan of >> all these ifdefs.. >> > > Can't we move the small X32 specific part out of > __copy_siginfo_to_user32(), in an arch specific helper that voids for other > architectures ? > > Something like: > > if (!arch_special_something(&new, from)) { > new.si_utime = from->si_utime; > new.si_stime = from->si_stime; > } > > Then the arch_special_something() does what it wants in x86 and returns 1, > and for architectures not implementating it, a generic version return 0 all > the time. The main issue is that we need an explicit paramter to select x32, as it can't just be discovered from the calling context otherwise. The rest is just sugarcoating.