From patchwork Mon Apr 22 16:49: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: 162613 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2801456jan; Mon, 22 Apr 2019 09:51:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOG/hx34uYvZr8uOkxDlrj3k18OXyBAcAf4iCY6mNqeUFj57oFLVOn57d6ebDT/VRvi72n X-Received: by 2002:a25:48f:: with SMTP id 137mr17502293ybe.290.1555951884775; Mon, 22 Apr 2019 09:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555951884; cv=none; d=google.com; s=arc-20160816; b=IGOfNXpRydY0GA3z7pjJmQ47ewPabTpnObGvFgfyTraHOPkbPV2BIEGZSXCdYrToXJ bpy7hA9BE/wPi/7CgoBAnFE/p0Z1d1qn+YhACrzynVpGWmplBrHztOaSVct3vqzMVYul 7VMoV2un2aJHZkM8xxpq72pR0FvXjRXwowz/uNf0weRBzyVk+Gg7T2jSvFWjuqwmxO8B l28+zmHtIir5VC6JF28I9KsIjJPdX85FmkE7JUsVbu0yhHzQGWbPhg03hVdUB8AjjAo0 Rtnj2nMQs1mIX8fDyF4JiOjMAi2eojKHNZK+USx6lZZECJ2LeDuNHq12JeRuq7QMrk8O FpUA== 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=KaHjZyCvhH9J7T3HHpk5GlSUlkZpYQnr4d7E7oK1HCs=; b=xa/BBRJ4FfPNhHQs6/uloI1Ox5ChNUemUQIcRKT+zrKZ3LD4DqLa76IAhS/VzH7hAm q3N6PUliIKHcVUOhlDrhNsccPaAQ1f6FLnImzRoqGr6tTpW4cg4XLrWzUDdNiPEiJFC/ LwTdOuXqoqriJlkWMx5TzfU4+xNO0astvo3vI9H13HWz1sRBGAaUO8nLtVcq/xue8OqP jToVxpQtd3jMdoxKUOOWnk/epdEtuyULb6S1pKZ6L6yKQ4lTub0iG+ZwjrVANsdxPSrS DIb2oZ8iSP1XPdfmf3/wnRiZ3n2YjZ4L85O1VCv7OizuCnkGO8cjGj/RYlWnZ3djRFI3 Og2w== 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 123si8862123ywr.52.2019.04.22.09.51.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Apr 2019 09:51:24 -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 1hIc8r-0004mL-5N; Mon, 22 Apr 2019 16:50:05 +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 1hIc8p-0004fN-G3 for xen-devel@lists.xenproject.org; Mon, 22 Apr 2019 16:50:03 +0000 X-Inumbo-ID: ac1324f8-651e-11e9-af01-c34a14b1c1f1 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id ac1324f8-651e-11e9-af01-c34a14b1c1f1; Mon, 22 Apr 2019 16:50:02 +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 EC255374; Mon, 22 Apr 2019 09:50:01 -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 DCA383F557; Mon, 22 Apr 2019 09:50:00 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 22 Apr 2019 17:49:25 +0100 Message-Id: <20190422164937.21350-9-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190422164937.21350-1-julien.grall@arm.com> References: <20190422164937.21350-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 08/20] 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 , sstabellini@kernel.org, Andrii_Anisov@epam.com 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. --- 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: