Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4903243imm; Tue, 16 Oct 2018 01:47:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV61lasftzTArOMcjCeeSR/XfRXeGLrUTO1Rw/HZWaVoT43cdi5s9XbWEGSmOigUKpVdMwMyT X-Received: by 2002:a17:902:e111:: with SMTP id cc17-v6mr20572830plb.175.1539679628762; Tue, 16 Oct 2018 01:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539679628; cv=none; d=google.com; s=arc-20160816; b=mb5yRYLFLu0e0ynPJPRUQW18ofLaMSm+Y8K/dTfoQvXqRyNHe4ahgCQttPhN3yiJZE TvUruk5hr4jqb6fBgZk78OKCt1gDIm9WJrhpZG7lIivfqKxFrVUC7Z/6ZQeeIoWoQG4G NNRvs1B1iOHV2b9DUWCFBZQnLKmm7AuKiwGzEpmsnJk/wv+Rz7AQVu/2965ytSHsn+Pn 2S82rtKJdNuZFyb2oMN/GkJNTm0vzEuxfqUXyZVRUkPojdY4BjtuejM0Kui14Dm2bIDS aOc4AcYU/0+rDtrUTWuyN8iqjBme2RDAjjFqOP/6pkmC62wJiTIq7IztbmHQiWSczkAJ 2tFw== 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:dkim-signature; bh=f6b8fkpQVzqGRwLgW09JgtCwhHpUtWz4Z8RunHt8vtw=; b=R6GJp6IMyPfrGoIahppqBfN96UVn5NNR3Z4QI0ooGw8O8HrgRCpBEtQ6Z5Fbm5fKuX 8jhpZKnKWdE4JNBR3uD21lFhx2QWe0Ioln0Ib6+1X/degaVkga4ZNR/N7mlAaSbQmqAO BGFg2h+NLXgV6jlvKSKuvZHTvdkFk+6a1I36W0i0cof0lOeqrO2lmp/V+85yRPgCQUAh AYIFYs0bkN/U8qLd/irjcvzRxAqQs5AIPL+l4gCRfiPbXDx/z0GO0w+Mf8E1aATXWCdo Z2F87P5XP1Dn4U7RQN1KcXQdAdzk5GfidnWG4obl6BaE3aQQ7zMsk0XLCCJQYUDTGL/A MxDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@armlinux.org.uk header.s=pandora-2014 header.b=Xaj0YQud; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3-v6si11122242plb.197.2018.10.16.01.45.58; Tue, 16 Oct 2018 01:47:08 -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=neutral (body hash did not verify) header.i=@armlinux.org.uk header.s=pandora-2014 header.b=Xaj0YQud; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727233AbeJPQXM (ORCPT + 99 others); Tue, 16 Oct 2018 12:23:12 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:54798 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbeJPQXL (ORCPT ); Tue, 16 Oct 2018 12:23:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QivZEZYBJRjWSaF+/oOFS9hhAh0OQAp5JDcCTesjNag=; b=Xaj0YQudpqMWhokC1lhzwhTrR RoR2rcS577WbYNE9Rq6wTJGfa9qYd43jtKvQjjM2garK9P6x/umItLwpDzoHtqLFjP+QQd5pgZvEW uFPr+kxGvbjxAg0Yfh+hVvASMwmEEdXHVfPlZK2qeXBZphQbmbz9TFSm7rNSbzOaxeYfw=; Received: from n2100.armlinux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:55986) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1gCKnR-0005Wx-Rx; Tue, 16 Oct 2018 09:33:46 +0100 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1gCKnO-00056X-Ok; Tue, 16 Oct 2018 09:33:42 +0100 Date: Tue, 16 Oct 2018 09:33:41 +0100 From: Russell King - ARM Linux To: Nicolas Pitre Cc: Stefan Agner , 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 Message-ID: <20181016083341.GE30658@n2100.armlinux.org.uk> References: <20181015222621.14673-1-stefan@agner.ch> <20181015224152.GA30658@n2100.armlinux.org.uk> <4e598f27e3dc7ae9fd96a6cf097d1154@agner.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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! -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up