Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5091649imm; Tue, 16 Oct 2018 05:10:41 -0700 (PDT) X-Google-Smtp-Source: ACcGV63PRipRIF/k2q6h6/V4zUIIdyM83srb5QtsZTJMdz8ARNmC1wmJZRIa6IfyRJ/8gt97Ftal X-Received: by 2002:a62:85cb:: with SMTP id m72-v6mr21711394pfk.173.1539691841817; Tue, 16 Oct 2018 05:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539691841; cv=none; d=google.com; s=arc-20160816; b=bJMGXgJX19ePAVdF7ZCOQX6JK1m0yNqokh5hsAIj59GHGQ4hOD/qODOmDpDH6uIaHN c6zZkfGmFwI8FQSGyDGHL01nbjhD32K4+pCjeAZoIURzfqSxRVmMTp7fUOBiYY7jhtC5 WrxalEnk+2/G5wFzXPQRnZS1FKdij9DJED667jf8s+d57A0wAc0K6Np9WBZWZvRTl9NI RZug8JZQOpJnBwhUQAtS7ETcjge/kOPof5rj+DpQCZAMJhrAWdOEdWdfx9LKPd0L+5dL Be5N2oWScvLnldyVwRsjLCRzHOBaqiWIMLzRxzFoztI0JvEXf8ROfbcDMZveOMD15PuH OOIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=vc7OfA8K90wk3LmnhZR1nunIfmX0CyAv0TExfiih588=; b=GyWm+jRx+F3WkfifKDBKQ+F9ft3UFbLYuJHPMwqBBHj4rUqXwT7WQU+XtsK2ao9Z1W tQtdytOwWjvt+DzDbNhkj750fuvDO0kYwbzMiGdxK8fkYYmwpWvfJ/5f3b6Z9Kp3PFEQ edhs5i+RfkQvdnBNtR6I7Cn37l/0KAJwEvhYbPPvXg/AUXaUgRNO+pRrmmSYOSYkYizt Djxs8rGRBSugs1K7r5yMjUcuxHY8s8KZNdEhBZzfKNIFtnUBnRhe4WqxSd9COuQmU0RN pGY7E2sFAw0ccp5eTFmyjJE+zgqAxezTu1/MUh9wkkPStvSkBljTKEtRzcJg9DYWM7iu n6qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=ZW++bNBY; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c19-v6si13788366plo.357.2018.10.16.05.10.25; Tue, 16 Oct 2018 05:10:41 -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=@agner.ch header.s=dkim header.b=ZW++bNBY; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727051AbeJPUAC (ORCPT + 99 others); Tue, 16 Oct 2018 16:00:02 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:45470 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbeJPUAC (ORCPT ); Tue, 16 Oct 2018 16:00:02 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 257C65C01E8; Tue, 16 Oct 2018 14:09:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1539691790; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vc7OfA8K90wk3LmnhZR1nunIfmX0CyAv0TExfiih588=; b=ZW++bNBYYa3zM8xllZpFcKHKCrQ3tL7QipGfskAhJC5E/C2XawQXp0sOTfb8gPKn8UHjGy Cul2vhpHfRKVyu4hbebXBjFMoCOhyTGVoKTTZ7VS4jk1v4gey5wTXLp9ydVZfEamG8FQj0 x+QfVuY0Kr+fefnTKS9Z2lrt1F4FjOY= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Tue, 16 Oct 2018 14:09:49 +0200 From: Stefan Agner To: Russell King - ARM Linux Cc: Nicolas Pitre , arnd@arndb.de, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, joel@jms.id.au, ulli.kroll@googlemail.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/2] ARM: copypage: do not use naked functions In-Reply-To: <20181016083341.GE30658@n2100.armlinux.org.uk> References: <20181015222621.14673-1-stefan@agner.ch> <20181015224152.GA30658@n2100.armlinux.org.uk> <4e598f27e3dc7ae9fd96a6cf097d1154@agner.ch> <20181016083341.GE30658@n2100.armlinux.org.uk> Message-ID: <473d9036247c467d1d3c0573ebad09c1@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16.10.2018 10:33, Russell King - ARM Linux wrote: > On Mon, Oct 15, 2018 at 07:27:43PM -0400, Nicolas Pitre wrote: >> It's hard to see what that commit was actually fixing, but the operands >> usage is wrong as explained already. Maybe the generated code has been >> OK for all those years but that is due to luck rather than correctness. > ... >> No idea. Maybe Russell remembers? >> Maybe digging into the mailing list archive might tell. > > I found this as a reply to the patch by Mikael Pettersson: > > I've tested and verified that this bit enables a gcc-4.5 compiled kernel > to boot on TS-119 (Kirkwood) when combined with my fix for __naked. > With neither or only one of the patches applied, the kernel oopses hard > in copy_user_page() as it tries to start /sbin/init. > ... > - the asm() bodies of these __naked functions have inadequate input > parameter constraints, in particular they fail to declare any > dependencies on the functions' formal parameters; gcc-4.5 sees this > and skips the parameter setup before calling these functions, causing > runtime crashes; Khem's patch (this one) fixes that > (copypage-xscale.c already had correct asm() constraints so it works > with only the __naked fix, these other copypage-*.c files need both > patches to work) > > So, while wrong to the GCC manual, it's fixing a bug that is present > with gcc-4.5 and who-knows what other GCC versions. Reverting the > commit has the chance to cause regressions with GCC. The build system requires at least GCC 4.6 currently, so we do not have to deal with 4.5. > > It looks like any change here needs to be validated on a range of > GCC versions, because there are versions of GCC known not to follow > it's manual! The commit message as well as the above message sounds more like it was a newly introduced behavior in 4.5. I would suggest to at least check 4.6 to make sure it has been corrected. -- Stefan