From patchwork Sun Jun 25 20:49:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 13292189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6317EEB64DD for ; Sun, 25 Jun 2023 20:49:41 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.554879.866348 (Exim 4.92) (envelope-from ) id 1qDWfl-0004GB-KT; Sun, 25 Jun 2023 20:49:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 554879.866348; Sun, 25 Jun 2023 20:49:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qDWfl-0004Fu-Fd; Sun, 25 Jun 2023 20:49:25 +0000 Received: by outflank-mailman (input) for mailman id 554879; Sun, 25 Jun 2023 20:49:24 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qDWfk-00049b-Sq for xen-devel@lists.xenproject.org; Sun, 25 Jun 2023 20:49:24 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qDWfk-0003Nd-Hy; Sun, 25 Jun 2023 20:49:24 +0000 Received: from 54-240-197-232.amazon.com ([54.240.197.232] helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qDWfk-00021M-AE; Sun, 25 Jun 2023 20:49:24 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=ze41TrTEDnEX29OT1AHfqfE9eyz1GRWB/h0Tzh6x6sw=; b=t6JvaOPPa7AuK8mxOH+M6lRRH7 I7kQWX8z/QU8gxHbAC6LKuGGrtQToawvnjjGsoCOSw3r/IigPeVa4W9ajiG/uxS/75QnIhFRrYJ4S lCebwDwGR9sJlg3z/TrvVzzoEhHiZzHZAnnAk5NHW/3l5kpMZdcnX3kH7i5yMgbCIWNA=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: Luca.Fancellu@arm.com, michal.orzel@amd.com, Henry.Wang@arm.com, Julien Grall , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH 7/9] xen/arm64: head: Rework PRINT() to work when the string is not withing +/- 1MB Date: Sun, 25 Jun 2023 21:49:05 +0100 Message-Id: <20230625204907.57291-8-julien@xen.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230625204907.57291-1-julien@xen.org> References: <20230625204907.57291-1-julien@xen.org> MIME-Version: 1.0 From: Julien Grall The instruction ADR is able to load an address of a symbol that is within the range +/- 1 MB of the instruction. While today Xen is quite small (~1MB), it could grow up to 2MB in the current setup. So there is no guarantee that the instruction can load the string address (stored in rodata). So replace the instruction ADR with the pseudo-instruction ADR_L which is able to handle symbol within the range +/- 4GB. Signed-off-by: Julien Grall Reviewed-by: Michal Orzel Reviewed-by: Henry Wang --- xen/arch/arm/arm64/head.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S index c9e2e36506d9..38f896bdb8e2 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -90,7 +90,7 @@ */ #define PRINT(_s) \ mov x3, lr ; \ - adr x0, 98f ; \ + adr_l x0, 98f ; \ bl puts ; \ mov lr, x3 ; \ RODATA_STR(98, _s)