Received: by 10.213.65.68 with SMTP id h4csp1071743imn; Wed, 21 Mar 2018 01:42:50 -0700 (PDT) X-Google-Smtp-Source: AG47ELvEDUCH2YlZII5hc0Z2nkfVG0rOQHxe8Jes6EZRDNFyLZ7ZEPFoToGS5kalazAXWvFlBZ7z X-Received: by 2002:a17:902:ba96:: with SMTP id k22-v6mr20024208pls.111.1521621770764; Wed, 21 Mar 2018 01:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521621770; cv=none; d=google.com; s=arc-20160816; b=qHr9iJNyOpqGKKGlUf7dmUhAg34NMVAtg5EpH9EYUScmIqyfN33TrfFPxOhiLUCR2M ka4nA8Li1oUmmYObO6BALp1uhllpk7nHBW1foD3wm/l1zAKfS1GbUwSpe4WqELs1s/t+ y1/BUhZaV336GySOZURPLTDJyjsQBoMLKDjgaQWrv/VkWF8HhjapWB/wG4LNSXENjUuH G/WOqOvzEBhVZfLthHyh9ucKkgxJLSsZVobQa2rk8BwTBWJnYBSPTEZA2WxBFvkhXFDg 5GWicqQbQlgWVHXUtr6yO2vyF/uuAsCuCAUF7cnzVxsfz1mmwkcUXz2+bPlEVjmAcv69 nCDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:user-agent:message-id :references:in-reply-to:subject:cc:to:from:date :content-transfer-encoding:mime-version:arc-authentication-results; bh=/PyjP0qUnQc6QV+eRVyHEDIkGqnWV09YOLVm4oXhOcU=; b=Zex3ix+j5GItcqbuJRgzEvk9dHEw6xe8jtygjDXLE36MkWuzY4xe6jHRdc7d4AloXl wnWzBZ+Ds9WIk3LTHx0GgqeAZudgihwGLu6d1nsNY6RxyV5wKwuicJWEoHOAYgkmH3rr kG7hct8SGr6gVYy6Nk6EOlhP9v+SI9T2Q6Zi0tomlvnTz3nZ3anK5UYJloI7nzSCWTbG 3z3l909HcNFyxIMeJjgaa8V9UZFdsihfaKX9+ZKSQrxCpIS7jSKQ+cBjAljbqkRJkg+l w6zofAkz/JZxzl/8yBUKCMo7IMwRK2E3YcAyh/8VLF1Gme5fQdWlcZei7pyJCNpJ7Swc ItKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=z1l+WYT5; 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 v12-v6si3415810plo.170.2018.03.21.01.42.36; Wed, 21 Mar 2018 01:42:50 -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=z1l+WYT5; 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 S1751729AbeCUIlq (ORCPT + 99 others); Wed, 21 Mar 2018 04:41:46 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:47473 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751411AbeCUIln (ORCPT ); Wed, 21 Mar 2018 04:41:43 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 4990B5C1DED; Wed, 21 Mar 2018 09:41:20 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Wed, 21 Mar 2018 09:41:41 +0100 From: Stefan Agner To: Russell King - ARM Linux 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 In-Reply-To: <20180320231309.GJ2743@n2100.armlinux.org.uk> References: <20180320230206.25289-1-stefan@agner.ch> <20180320230206.25289-4-stefan@agner.ch> <20180320231309.GJ2743@n2100.armlinux.org.uk> Message-ID: <98806397d62084bf01c475fd210cd186@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1521621680; bh=/PyjP0qUnQc6QV+eRVyHEDIkGqnWV09YOLVm4oXhOcU=; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID; b=z1l+WYT5yWn1R0vKlgKzLackT/QWsR3XUSZCylSzUEaIhbcFe7JCsRzBLJC/5xyFlJuwCUZx9mRkHQx1jCmCsCuhwZADsyzdvaJ0j6hbpubRS9uZrBZOSpVw4kz+AiaJht7wSDAdoUVLinZubFVlm6MYxgvtLf4PmQiJFu6RBZg= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21.03.2018 00:13, Russell King - ARM Linux wrote: > 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. > Ok, will reword that part to something like: As documented in GCC naked functions should only use Basic asm syntax. The Extended asm or mixture of Basic asm and "C" code cannot be depended upon. Furthermore with clang using parameters in Extended asm in a naked function is not supported: ... > In fact, as you're introducing further register variables, these > checks become more important to have than they were with the > previous code. Ok I see, so I definitely have to leave them in. You generally agree with the change otherwise? -- Stefan