Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4451910imm; Mon, 15 Oct 2018 15:17:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV602lxRFmYKJSZ4Y8piR44/2MvfBeJviDzzM5oNr6cKq4sCly2y6jow8gzfAal/tAuPqw95m X-Received: by 2002:a17:902:b109:: with SMTP id q9-v6mr18858497plr.83.1539641839137; Mon, 15 Oct 2018 15:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539641839; cv=none; d=google.com; s=arc-20160816; b=JnNyc/uEv6C2/XbZR2HEocCMVZZjpglC0qwMK9wQe1t4eZmwubesh7yppMjZEn3B0g Gnd+2lUJ0B7g4+KHA33G4sal1mKgCnnnR0lfXrD4Ihs4ChkA7x9L/q8U5TK3ufEByoIX i1tWb03ktMqypl/nUe8UwUjfoa2dgkdPjOeolLJ1Mt6PTL8YqzyKFGMhd9Z2O+ZJk7sU DcYhCiSgZzSkGJ5pd0T1iczyaiDqEoM2BCb+oKqQ+5B7QZzFQMfh1nZ+LktF5eJtF7tk ONL0mfOZSSwdo7rpDtzuvug+Z+NUdjXodEsJBuyRp6tFPa0ULwF1Txs2IThpIKlFKSx0 DunA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=M6JmEVCtUnq7D+ti0w3NkBGcNYQiCg6j51cuvLvMpH8=; b=dtomaFecXp+8DHubRWKRk4j+/i9A2eZb3pxzeYay2+YMAEmsd8kcl15gS/C/05qH8m AuhUpiF79QJG+plYqmHOLMnLxDdPVWkPLmfaTHGPTEvjM1TMoT7Hkhvdg2u2SUAeKvBR H3yEsWvC45GW7G7IvFE/3RLWWy74G4T6MZGQYRVkeV5vYofj/nZnByqKHIOWGmnqrq8n xJJL5NInjISpsq5LuIInqPnT9wgxDhbnnJlClJeySq0wY2RVbZSu9V37uXEmo/9r/9JZ vagNFfUjI1+PWlKAohzeDbJurWJmJypQO7UGlUEer5g2ppZAE7M+HXlSmsmhErepC2Ww dvFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=BYfuLSJy; 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 e36-v6si11816145pge.127.2018.10.15.15.17.02; Mon, 15 Oct 2018 15:17:19 -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=BYfuLSJy; 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 S1726956AbeJPGDu (ORCPT + 99 others); Tue, 16 Oct 2018 02:03:50 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:38354 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726430AbeJPGDu (ORCPT ); Tue, 16 Oct 2018 02:03:50 -0400 Received: from trochilidae.toradex.int (unknown [IPv6:2a02:169:3460::525]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 9E3EB5C0106; Tue, 16 Oct 2018 00:16:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1539641798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=M6JmEVCtUnq7D+ti0w3NkBGcNYQiCg6j51cuvLvMpH8=; b=BYfuLSJy1GSO3z8/vmtk9X9mCacyD9ZRyQ+k+W5NRZUQDr009VRB8n9gldKj26RYA+JSx1 Wk4zkn3L79ZlSGYE4j1hWx9yiTOEwzWZT7RQT8eXUzkzJRPX/GoGevM4qO3SXWtO82mGMH cisISckofZSxqTTZrAGVJA0J+bBs53c= From: Stefan Agner To: linux@armlinux.org.uk, ulli.kroll@googlemail.com Cc: joel@jms.id.au, nico@linaro.org, arnd@arndb.de, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Agner Subject: [PATCH 1/2] ARM: copypage-fa: add kto and kfrom to input operands list Date: Tue, 16 Oct 2018 00:16:29 +0200 Message-Id: <20181015221629.13924-1-stefan@agner.ch> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam: Yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When functions incoming parameters are not in input operands list gcc 4.5 does not load the parameters into registers before calling this function but the inline assembly assumes valid addresses inside this function. This breaks the code because r0 and r1 are invalid when execution enters v4wb_copy_user_page () Also the constant needs to be used as third input operand so account for that as well. This fixes copypage-fa.c what has previously done before for the other copypage implementations in commit 9a40ac86152c ("ARM: 6164/1: Add kto and kfrom to input operands list."). Signed-off-by: Stefan Agner --- arch/arm/mm/copypage-fa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mm/copypage-fa.c b/arch/arm/mm/copypage-fa.c index d130a5ece5d5..ec6501308c60 100644 --- a/arch/arm/mm/copypage-fa.c +++ b/arch/arm/mm/copypage-fa.c @@ -22,7 +22,7 @@ fa_copy_user_page(void *kto, const void *kfrom) { asm("\ stmfd sp!, {r4, lr} @ 2\n\ - mov r2, %0 @ 1\n\ + mov r2, %2 @ 1\n\ 1: ldmia r1!, {r3, r4, ip, lr} @ 4\n\ stmia r0, {r3, r4, ip, lr} @ 4\n\ mcr p15, 0, r0, c7, c14, 1 @ 1 clean and invalidate D line\n\ @@ -36,7 +36,7 @@ fa_copy_user_page(void *kto, const void *kfrom) mcr p15, 0, r2, c7, c10, 4 @ 1 drain WB\n\ ldmfd sp!, {r4, pc} @ 3" : - : "I" (PAGE_SIZE / 32)); + : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 32)); } void fa_copy_user_highpage(struct page *to, struct page *from, -- 2.19.1