From patchwork Tue May 14 12:21:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 164147 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2552046ili; Tue, 14 May 2019 05:23:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5DHbSfCwDdtSRqGkXzS8UK3bT36FaQZTLM0dbUkgE6ep2bSIO3zYkiTm9Ti481NIFrF0t X-Received: by 2002:a02:741c:: with SMTP id o28mr22378752jac.144.1557836586315; Tue, 14 May 2019 05:23:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557836586; cv=none; d=google.com; s=arc-20160816; b=GJqio/E5tjpOD9FRTs+cyiXsAEYt9jbIQk7467A9Kj1Y++JApqCZOSFWMzrALw1K2K Y+19R12bOT9TUkUa3qXa0TgVroWMWwDYaG5moG0AknxrxvwcNkTierzQGvx3uorQh2fM QgJKH45ljWisZ/3gpwRYnOLh2smynTwDjdA5MhltHOyxPNUClJnA4RY8X6XusWnkc7D0 wdIF+7yhVUWKquO2Q5Ah/yvCjFypJFOxBEEneYzmOFD0i04Yu9WivhjiH0yRBY59M7u5 s17+YNmcE8U7KmL6wabUwhuW2rVpI+4TSFGhHvZDPNNN2/Y8V0BOJcDl57zrmg/bLHPA Ujtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=LaGJNp285ZFjIJhqP3unIWqhVqJzUGz0Av5n0mhE8Ew=; b=WgfDyl+WSbFv8W96UI1UJ3u7K5u/9rUEbP19XrGxifN61bpyH8MQLz/+zC9D+jz8k9 L+KmxGul2ORm1Y8Na3tN4KZig/BWqOLXl513KhfSjGAvmYOgYfrdL9O3NbzKFgXY+vIl f6zJIATA/N6n4R9/H2NN9g8peVfMhd6f1iUQuKlJkdpD9jBR/IC77kW+lmlHs6oXhc92 LlShVNfUpw9ScM8haRbxL4N7xIaOk0BpTKSKElGgFeP/9xel0JYhlF7xNw3y12Kq9gU6 pxudv2KlAp32ia59sm427w+L1ANwSN7PY5MHAWL6SuXwKnsSJusA254evm9KWa8cerkx yhtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id f23si10020622jaa.12.2019.05.14.05.23.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 05:23:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 1hQWRc-0008S2-IZ; Tue, 14 May 2019 12:22:08 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQWRa-0008PL-Ma for xen-devel@lists.xenproject.org; Tue, 14 May 2019 12:22:06 +0000 X-Inumbo-ID: e2fce7da-7642-11e9-be88-bb4c75b274af Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id e2fce7da-7642-11e9-be88-bb4c75b274af; Tue, 14 May 2019 12:22:06 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C92EE15AB; Tue, 14 May 2019 05:22:05 -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 963C23F71E; Tue, 14 May 2019 05:22:04 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 14 May 2019 13:21:24 +0100 Message-Id: <20190514122136.28215-16-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190514122136.28215-1-julien.grall@arm.com> References: <20190514122136.28215-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH MM-PART2 v2 08/19] xen/arm64: head: Move earlyprintk messages in .rodata.str 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: Oleksandr_Tyshchenko@epam.com, Julien Grall , Stefano Stabellini , Andrii Anisov MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" At the moment, the earlyprintk messages are interleaved with the instructions. This makes more difficult to read the objdump output. Introduce a new macro to add a string in .rodata.str and use it for all the earlyprintk messages. Signed-off-by: Julien Grall Reviewed-by: Andrii Anisov --- I haven't done a similar change in arm32 yet because the compiler will throw an error when using 'adr' when load an address from a different section (see A5-200 in ARM DDI 0406C.a for the technical reason). The change is likely to be more elaborate. Changes in v2: - Add Andrii's reviewed-by --- xen/arch/arm/arm64/head.S | 14 +++++--------- xen/include/asm-arm/asm_defns.h | 5 +++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S index ad446e7345..b957eb90fb 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -81,13 +81,10 @@ /* Macro to print a string to the UART, if there is one. * Clobbers x0-x3. */ #ifdef CONFIG_EARLY_PRINTK -#define PRINT(_s) \ - adr x0, 98f ; \ - bl puts ; \ - b 99f ; \ -98: .asciz _s ; \ - .align 2 ; \ -99: +#define PRINT(_s) \ + adr x0, 98f ; \ + bl puts ; \ + RODATA_STR(98, _s) #else /* CONFIG_EARLY_PRINTK */ #define PRINT(s) #endif /* !CONFIG_EARLY_PRINTK */ @@ -633,8 +630,7 @@ init_uart: #endif adr x0, 1f b puts -1: .asciz "- UART enabled -\r\n" - .align 4 +RODATA_STR(1, "- UART enabled -\r\n") /* Print early debug messages. * x0: Nul-terminated string to print. diff --git a/xen/include/asm-arm/asm_defns.h b/xen/include/asm-arm/asm_defns.h index 02be83e2b3..3f21def0ab 100644 --- a/xen/include/asm-arm/asm_defns.h +++ b/xen/include/asm-arm/asm_defns.h @@ -16,6 +16,11 @@ # error "unknown ARM variant" #endif +#define RODATA_STR(label, msg) \ +.pushsection .rodata.str, "aMS", %progbits, 1 ; \ +label: .asciz msg; \ +.popsection + #endif /* __ARM_ASM_DEFNS_H__ */ /* * Local variables: