Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp46802ybj; Wed, 6 May 2020 11:13:45 -0700 (PDT) X-Google-Smtp-Source: APiQypKuJnVxpLxeFR9tNs6s4yEE6DVvZFkXXuV957BrMzL7PyL7ZjBcAMuloZ0qMaRFGYMGEtsi X-Received: by 2002:a05:6402:3056:: with SMTP id bu22mr8336306edb.192.1588788825100; Wed, 06 May 2020 11:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588788825; cv=none; d=google.com; s=arc-20160816; b=OG4Bk42wQOTlpHnaxLL2eQ1rIqapiU7w1CnkG+u5PWOZeh/ReHh55N63pEKDsx8Rjn ilYPWTeDnkAWqEyx0PyO+Dkix4W3XLqZ1TY+fRFurphZwH53vAWyEjUDQfV8alzrVENP M+Q3w1nBnYUR/B9oirRM9uBfYdorc1GpBJsyQA52oIulDzqtKaSPCb1g65pgwp+5SONU PGoDkCMMuRUuit6CzRvH1EvF7GNGvSPqgzMWXUfSXyRyo+6OQCr19tpmAkuS/YJKpzFh +lBleQlZwDx7tVHVnCxnfKl8xhUM8zg07B5V9H9uq6grmWyOCyBRf6zX1VZZNXl+53BV MBjA== 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=pdl7UmW/3YWoh0QzoMSA5fqizB9tR6XeZ7i9pUcbmSc=; b=swQw9S8gBpqQ/mkPSWP6TlEp4JXiogkarV4sBSJ4SJcC0VR1Msn/IBOjgnabECwDBM WUpE2s6HYw+MnqcwkZCkIPGa5DJjW/7SItAIRDJjNng+762itkxMe9O6FpwHknrdhM/B fgsMN7kmGbqXiAfm+u9K2/z5ESndDntwN/FihU/rGv9q08cc8hpPsYZvm06Q7332HgEd 6am0qrekIiPd8QyT3y9yM6ixGAH0gf+WvmB1PHiz3DASRjQlx4fP6YYItydAsIKx44Yi d32J45uV5ZwkWGNQZcQ0INVUR1u+H1nRDvgt5lCFgEiEGVkuTmVKcwjj5wPwE2IqYWAZ mH1Q== 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 oh23si1624612ejb.22.2020.05.06.11.13.21; Wed, 06 May 2020 11:13:45 -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 S1730396AbgEFSKX (ORCPT + 99 others); Wed, 6 May 2020 14:10:23 -0400 Received: from gate.crashing.org ([63.228.1.57]:37800 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728566AbgEFSKW (ORCPT ); Wed, 6 May 2020 14:10:22 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 046I9r6r015436; Wed, 6 May 2020 13:09:53 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 046I9rPL015416; Wed, 6 May 2020 13:09:53 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 6 May 2020 13:09:52 -0500 From: Segher Boessenkool To: Michael Ellerman Cc: Christophe Leroy , Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , npiggin@gmail.com, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v4 1/2] powerpc/uaccess: Implement unsafe_put_user() using 'asm goto' Message-ID: <20200506180952.GU31009@gate.crashing.org> References: <23e680624680a9a5405f4b88740d2596d4b17c26.1587143308.git.christophe.leroy@c-s.fr> <87sggecv81.fsf@mpe.ellerman.id.au> <1c6379b2-7e0a-91fe-34f0-51f5adca7929@csgroup.eu> <20200505155944.GO31009@gate.crashing.org> <87lfm5dev3.fsf@mpe.ellerman.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lfm5dev3.fsf@mpe.ellerman.id.au> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 06, 2020 at 11:36:00AM +1000, Michael Ellerman wrote: > >> As far as I understood that's mandatory on recent gcc to get the > >> pre-update form of the instruction. With older versions "m" was doing > >> the same, but not anymore. > > > > Yes. How much that matters depends on the asm. On older CPUs (6xx/7xx, > > say) the update form was just as fast as the non-update form. On newer > > or bigger CPUs it is usually executed just the same as an add followed > > by the memory access, so it just saves a bit of code size. > > The update-forms are stdux, sthux etc. right? And stdu, sthu, etc. "x" is "indexed form" (reg+reg addressing). > I don't see any change in the number of those with or without the > constraint. That's using GCC 9.3.0. It's most useful in loops (and happens more often there). You probably do not have many loops that allow update form insns. > >> Should we ifdef the "m<>" or "m" based on GCC > >> version ? > > > > That will be a lot of churn. Just make 4.8 minimum? > > As I said in my other mail that's not really up to us. We could mandate > a higher minimum for powerpc, but I'd rather not. Yeah, I quite understand that. > I think for now I'm inclined to just drop the "<>", and we can revisit > in a release or two when hopefully GCC 4.8 has become the minimum. An unhappy resolution, but it leaves a light on the horizon :-) In that case, leave the "%Un", if you will but the "<>" back soonish? Not much point removing it and putting it back later (it is harmless, there are more instances of it in the kernel as well, since many years). Thanks! Segher