Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp727677imm; Wed, 17 Oct 2018 07:25:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV61DjX3+PUvsgwYVyz2q1aexfOwhN3s6HNHj/sylYpXIW2Szu3P863XQiB2fIengHydWM0u9 X-Received: by 2002:a63:f210:: with SMTP id v16-v6mr24113732pgh.371.1539786338485; Wed, 17 Oct 2018 07:25:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539786338; cv=none; d=google.com; s=arc-20160816; b=ZiCqitE/3zhlIXOtOx9GZKKeI8sv8e1wj1ysD1/zTfZLmZcIK+pAS131JC/Fi5IYQc 9OlG8e0fzkjSZ0lMm3BV1uw5qO11XXykOU+odkQGZXicVv+jEhimN6b3F6PVrcDXcG+G 9V+6ylHy4lnkf7hor2lDW5Yw8tUogOPbESVLlrtLn3KPGBYPNGah4mzKYb13fvTFAt2p 9YaqwcKLYw0eCKWFDXnXLxH5MRUnBbuH0K5KJ51q3MZ0In5Nz+7ZC4LVlKeipV2GQD0b QZXNTpMhn8HCDjQwpwlKpjTPgsKAB5AxSylaKzbSWbiLVBT5xah92hNUXUcVaGo4Wyxe wT8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=+V+1tdObalfpAa88mC/A06Ihj6E2es3DkukF8lOEjQM=; b=HxZD0Pz7TiDyKyT7NcK2hdNc9a7b2DlFWgaU3Dd1JJbPpAsCpFWdn9kpduAVG5pRwU +quEvk3HiYPvIt8B74yty1Tu3Ay7a7ARlIfinf5eUPoFn2zhIpSL1ApPUpkHQZMrBwDf r4VKWTZ9M3ytYRmDuGZj/bAmwl7maMhSiM26xmly7feKw55akG0GlX2iiIR1Yj7mRZgD 2rK9Qd87vwqJMpsPyOdPYjPzBor4a84LGE9br6TLH/4/2k5//GT8h9/N+wSg68ubofrW eNqmEWKfM86EG/AVFmZO8f7Um8+hUCv2+g40tlQLp5mDU5oiruEZ6/q2uJw+RmfKmn4H TIdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ofyguocm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si18279641plk.405.2018.10.17.07.25.22; Wed, 17 Oct 2018 07:25:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ofyguocm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727589AbeJQWTQ (ORCPT + 99 others); Wed, 17 Oct 2018 18:19:16 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:34977 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727032AbeJQWTQ (ORCPT ); Wed, 17 Oct 2018 18:19:16 -0400 Received: by mail-qt1-f193.google.com with SMTP id d21-v6so17808494qtq.2 for ; Wed, 17 Oct 2018 07:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=+V+1tdObalfpAa88mC/A06Ihj6E2es3DkukF8lOEjQM=; b=OfyguocmKYwUM0YN79sptX8QQJ6ISrE5BDpU6jbLH+bxqfV+3oePtQ0IJjd3IBqsIk 20apZbfxDOIReRisA+0CLXRIaAxy+lkyVSpJBTtGDFcsFE1BVHsT+UlFrRuc6Gy6ryV9 NMSOCpBkJVPs+IbrV7q6HsCg4EbeGO2AOf6nY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=+V+1tdObalfpAa88mC/A06Ihj6E2es3DkukF8lOEjQM=; b=CYR1Yx9SuG+MK3FJSsMmVuQTuQ15j+O5OYZmUXnaGWkxKfi8DokeZVys+S6eZrYe1o cDX1kFwLxtFlaSO7exhRVq4Xaz+oBZIU002KyScjhZxfu0JDLQEGH8IbqrqQFi4R5r/P gI8PWNe+tKam3kuHFx4TFY8pKJ+GfXtN9FMNUbUDWm6tQEiX4hlfNnb6HuRhV7u05fCD Jp3HLSbdOuop4Ie83DsZIofgxIb1QKDtMdu3+d/AH6QI1z4JQcbw5A2DRoKSLl/DKv9k +/HFgAM96rIydq7lMBmzARFrrQeG9AXafoEo4OYXpG3YDZvnSXBMdGHojQW8FBjZnadp WBiQ== X-Gm-Message-State: ABuFfoi7/oXGuuTZYAmuxaAlIgi+H2oB1NLuIVoHcpUUOk1Ag229YZ/W v3hYjHcVvnZ/R1YtuUs+2wxo/w== X-Received: by 2002:aed:3024:: with SMTP id 33-v6mr20773244qte.29.1539786199479; Wed, 17 Oct 2018 07:23:19 -0700 (PDT) Received: from xanadu.home (modemcable228.104-82-70.mc.videotron.ca. [70.82.104.228]) by smtp.gmail.com with ESMTPSA id l43-v6sm13559575qtc.80.2018.10.17.07.23.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Oct 2018 07:23:18 -0700 (PDT) Date: Wed, 17 Oct 2018 10:23:17 -0400 (EDT) From: Nicolas Pitre To: Arnd Bergmann cc: Russell King - ARM Linux , Linus Walleij , Stefan Agner , Hans Ulli Kroll , Joel Stanley , Linux ARM , Linux Kernel Mailing List , Roman Yeryomin Subject: Re: [PATCH 1/2] ARM: copypage-fa: add kto and kfrom to input operands list In-Reply-To: Message-ID: References: <20181015221629.13924-1-stefan@agner.ch> <20181016084416.GF30658@n2100.armlinux.org.uk> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 17 Oct 2018, Arnd Bergmann wrote: > On Tue, Oct 16, 2018 at 10:43 PM Nicolas Pitre wrote: > > On Tue, 16 Oct 2018, Russell King - ARM Linux wrote: > > > On Tue, Oct 16, 2018 at 10:00:19AM +0200, Linus Walleij wrote: > > > > On Tue, Oct 16, 2018 at 12:16 AM Stefan Agner wrote: > > > It's not obvious yet whether this is right - it contradicts the GCC > > > manual, but then we have evidence that it's required for some GCC > > > versions where GCC may clone the function, or if the function is > > > used within the same file. > > > > Why not getting rid of __naked altogether? Here's what I suggest: > > > > ----- >8 > > Subject: [PATCH] ARM: remove naked function usage > > > > Convert page copy functions not to rely on the naked function attribute. > > > > This attribute is known to confuse some gcc versions when function > > arguments aren't explicitly listed as inline assembly operands despite > > the gcc documentation. That resulted in commit 9a40ac86152c ("ARM: > > 6164/1: Add kto and kfrom to input operands list."). > > It's probably worth noting that the minimum gcc version for compiling > the kernel is now gcc-4.6, which I think does not suffer from the gcc-4.5 > bug that triggered the change. See in particular commits 9c695203a7dd > ("compiler-gcc.h: gcc-4.5 needs noclone and noinline on __naked functions") > and d124b44f09ca ("Compiler Attributes: naked was fixed in gcc 4.6"). > > The first one made sure we don't inline these functions, so gcc-4.5 > no longer runs into the problem even in the absence of the workaround, > and the second patch reverts that again, noting that gcc-4.6 is fixed. > > I don't see anything wrong with converting the functions to not > use __naked at all, but I think we can also just revert the original > commit 9a40ac86152c to get it to build with clang. When I last > played with clang on arm32, that's what I did. I'll reply with the > patch I have in my randconfig tree. The __naked attribute has idiosyncrasies of its own, regardless of any potential bugs, that sometimes makes it harder to maintain and prevent extra optimizations that the compiler could otherwise take care of. So I think that this is a good thing to get rid of __naked when its usage isn't necessary, like the instances in this patch. The remaining instances are cases where there is simply no stack available making __naked necessary in those cases. Nicolas