Received: by 10.213.65.68 with SMTP id h4csp806908imn; Tue, 20 Mar 2018 16:14:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELuO7rzG9OLvP4biDJR8UiL8AmZ/EJfrFaHV1OVM9iSsDS3PhU1Xbzqsp30MLlXbYx/odoUy X-Received: by 2002:a17:902:9009:: with SMTP id a9-v6mr17890786plp.272.1521587686377; Tue, 20 Mar 2018 16:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521587686; cv=none; d=google.com; s=arc-20160816; b=Vz8a3p+0PL733UsHXXD1lyOMu402YhVXYXCOE9F0t/UMVc3OtyLUEO6OmgRigDEVrd jJFjYGIfD8rg6PcE85wbNFaPzC2a+ZYGP7E9BqHw/JxQnoYPpEO5fuxKls4MSvELbItT IlwrmEOs2oPpfU0aaY8y1STyc08VHoVhjbJCFqbDN3DKlbzV2e9ApNrVe6na2/we4Ink uO+YHGuwOZU2WlNPj4Gpo8+YQYSCiTJqnFpiz6EBjOCCoiCvU7M07kOLTCUbfI7WioJc LtfT/jWKkvqk/kjQv38H9sAU59t0+g6wDZauNb67bQmsC7/Li69iWv2xO9A6/QKIDVhM XGyA== 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:arc-authentication-results; bh=bI8UuW1nomwi1lSr4ho+nSprQYRIpBr6SfSP8q9JYhc=; b=Dnf1OjjyMgiEkyxLDwN5AvfIhCelk6GNnQNFCExKupP4eeMQSbq9IIgcM+CphnQqDa Xv+T+6dMmvi/Fmo4QIBU6U6p2ki+fU6plJ/azn7eGVx10k4cNyj0nNmmNLwill8UIQrL L8quL0mCuwejZASm7PLkTmRy9ctRq0w1+nit0i+fvyNMxgSB6h3KUFh+5Pfs4Qc5xeky EqnRUkwdyFNN0W8qIEjqXy8sddHa6S2mpq1/SAiSM8DKdfE4Ky6mleSn04UdKWzCqO4R 38UhLJlLTkbl4rmuzDXExjPB/YOSEaXFhbjQtE8nC+G+DNoDEu/ZZbKQclwhkoupbzUb 7xtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=Uno7W3mw; 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 y9si1807002pgp.800.2018.03.20.16.14.31; Tue, 20 Mar 2018 16:14:46 -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=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=Uno7W3mw; 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 S1751526AbeCTXN3 (ORCPT + 99 others); Tue, 20 Mar 2018 19:13:29 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:36056 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319AbeCTXN2 (ORCPT ); Tue, 20 Mar 2018 19:13:28 -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; bh=bI8UuW1nomwi1lSr4ho+nSprQYRIpBr6SfSP8q9JYhc=; b=Uno7W3mwJRE0pLX5K8wXMSj5vGUcYP0om7sPa14d1295B8NUG1qtwx+qOektfLr87YNxpML/plTIVVLugGt6CpdYofidHVbStSrBiOaFyA10GkzySQC2exoYIqZmDZc1j7yK33Tt6Brh0D2k4Wz6JUIeO6TT63YFtsRO9n1G7ag=; Received: from n2100.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:4f86]:53018) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1eyQRS-0008AF-Fc; Tue, 20 Mar 2018 23:13:18 +0000 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1eyQRM-0002JT-Bo; Tue, 20 Mar 2018 23:13:12 +0000 Date: Tue, 20 Mar 2018 23:13:09 +0000 From: Russell King - ARM Linux To: Stefan Agner Cc: ard.biesheuvel@linaro.org, arnd@arndb.de, nicolas.pitre@linaro.org, marc.zyngier@arm.com, behanw@converseincode.com, keescook@chromium.org, Bernhard.Rosenkranzer@linaro.org, mka@chromium.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/5] ARM: trusted_foundations: do not use naked function Message-ID: <20180320231309.GJ2743@n2100.armlinux.org.uk> References: <20180320230206.25289-1-stefan@agner.ch> <20180320230206.25289-4-stefan@agner.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180320230206.25289-4-stefan@agner.ch> 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 Wed, Mar 21, 2018 at 12:02:04AM +0100, Stefan Agner wrote: > As documented in GCC naked functions should only use Basic asm > syntax. The Extended asm or mixture of Basic asm and "C" code is > not guaranteed. Currently this works because it was hard coded > to follow and check GCC behavior for arguments and register > placement. Those checks have nothing to do with that at all. The whole point of __asmeq() is to catch situations where you use register variables, specifying which register you want them in, and GCC then ends up passing them to assembly code in some other random register(s). This was found with older GCCs, and the problem was fixed. It has nothing to do with naked functions per se. In fact, as you're introducing further register variables, these checks become more important to have than they were with the previous code. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up