From patchwork Mon Sep 30 18:44:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 11167041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B9E4013BD for ; Mon, 30 Sep 2019 18:46:31 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 99D93224ED for ; Mon, 30 Sep 2019 18:46:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99D93224ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iF0ew-0002Qa-Vi; Mon, 30 Sep 2019 18:44:34 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iF0ev-0002QV-Ke for xen-devel@lists.xenproject.org; Mon, 30 Sep 2019 18:44:33 +0000 X-Inumbo-ID: 568c7f6c-e3b2-11e9-97fb-bc764e2007e4 Received: from foss.arm.com (unknown [217.140.110.172]) by localhost (Halon) with ESMTP id 568c7f6c-e3b2-11e9-97fb-bc764e2007e4; Mon, 30 Sep 2019 18:44:30 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 733971597; Mon, 30 Sep 2019 11:44:30 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6B7EF3F534; Mon, 30 Sep 2019 11:44:29 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 30 Sep 2019 19:44:25 +0100 Message-Id: <20190930184425.13756-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [PATCH for-4.13] xen/arm32: head: Fix build when using GAS 2.25.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: jgross@suse.com, Stefano Stabellini , Julien Grall , Andrew Cooper , Julien Grall , Volodymyr Babchuk MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" GAS 2.25.0 throws multiple errors when building arm32/head.S: arm32/head.S: Assembler messages: arm32/head.S:452: Error: invalid constant (f7f) after fixup arm32/head.S:453: Error: invalid constant (f7f) after fixup arm32/head.S:495: Error: invalid constant (f7f) after fixup arm32/head.S:510: Error: invalid constant (f7f) after fixup arm32/head.S:514: Error: invalid constant (f7f) after fixup arm32/head.S:516: Error: invalid constant (f7f) after fixup arm32/head.S:633: Error: invalid constant (f7f) after fixup This makes sense because the instruction mov is only able to deal with a specific set of immediate (see "modified immediate constants in ARM instructions"). For any 16-bit immediate, the instruction movw should be used. It looks like newer version of GAS will seemly switch to movw if the immediate does not fit in the immediate encoding for mov. But we should not rely on this. So switch to movw. Fixes: 23dfe48d10 ("xen/arm32: head: Introduce macros to create table and mapping entry") Reported-by: Andrew Cooper Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/arm32/head.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S index 2fc312f9e0..e9d356f05c 100644 --- a/xen/arch/arm/arm32/head.S +++ b/xen/arch/arm/arm32/head.S @@ -383,7 +383,7 @@ ENDPROC(cpu_init) ldr r4, =\tbl add r4, r4, r10 /* r4 := paddr(\tlb) */ - mov r2, #PT_PT /* r2:r3 := right for linear PT */ + movw r2, #PT_PT /* r2:r3 := right for linear PT */ orr r2, r2, r4 /* + \tlb paddr */ mov r3, #0 @@ -419,7 +419,7 @@ ENDPROC(cpu_init) lsr r4, \phys, #THIRD_SHIFT lsl r4, r4, #THIRD_SHIFT /* r4 := PAGE_ALIGNED(phys) */ - mov r2, #\type /* r2:r3 := right for section PT */ + movw r2, #\type /* r2:r3 := right for section PT */ orr r2, r2, r4 /* + PAGE_ALIGNED(phys) */ mov r3, #0