From patchwork Tue May 14 12:24:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 164186 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2555154ili; Tue, 14 May 2019 05:26:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyi1vH+8mlACUPESkJkvjhq+rc3B4bCR+wHo9e9XXW8iPe8KLM2wzMBdJuFs/cKXPKfER33 X-Received: by 2002:a6b:b503:: with SMTP id e3mr20671685iof.216.1557836776710; Tue, 14 May 2019 05:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557836776; cv=none; d=google.com; s=arc-20160816; b=Gheuon7rVO6tU4DAC2Is/ysXqE7jhXhp3oac5K6EEvlGCQdI3oFRmcKJEF4WlcyYB8 4ZgwOkQle3G1j8Mr+L6Y4FzxoEvtAIV+BdTluWrroCW5xCcWA2b6i2Nzen0huMI2wnsR NOzCQS1gvgVqxNvmM96OShtlH6bepHGGCLyY0PldYIBqHE7z3Atfdfgs6QqSuEJeVSwW FUcZ4Q6ppqkWP17t6nEk/Hz69fxjNYf4uzxpHKkEi3gVpcQ/GScevrvoMjn8cb+n8BJ4 48e0ElQZyxwgDI+zZ1i9a/B+oHk1oVat+tsOEt4Mey2Lx5EV1bQ8MTnkrO8j6ufv2w9Q RAfg== 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=Gj+hjAHCv701nlaqRberPWmfgfPo5q2oIIvsfysR3jr45+mNBW6zqUWwZYPfY5bnQc FBUrRhrIoJ1C6TfhbwX90uEuJIwZT5+3BlAF10pP8J2warPKdSd/dnBZ5u5HyIpw/Nln 5foMOb8gLk/x5BnqHlQ3clAF9k5IhFIIuCdIcjEl9Ta457x145IB06IoKxkB3yyaNOZr 0t8RTjW3KUHD1oribJ0Dx+VuwPY/7sloJQedMmPNifdoQJtCsXgxT4p0/2x66Nalo1Aj qCflB6oMmliYg52sADEvWhW/SqMVyA9+cAkGOX8r+lTo3uc7OXReOAGF8NU4zvKaau0p clhg== 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 g4si519692iom.125.2019.05.14.05.26.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 05:26:16 -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 1hQWUg-0002gA-KM; Tue, 14 May 2019 12:25:18 +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 1hQWUd-0002cG-V0 for xen-devel@lists.xenproject.org; Tue, 14 May 2019 12:25:15 +0000 X-Inumbo-ID: 5379f0d4-7643-11e9-bc9c-af883ea96da6 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 5379f0d4-7643-11e9-bc9c-af883ea96da6; Tue, 14 May 2019 12:25:14 +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 8562515BE; Tue, 14 May 2019 05:25:14 -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 526503F71E; Tue, 14 May 2019 05:25:13 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 14 May 2019 13:24:45 +0100 Message-Id: <20190514122456.28559-9-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190514122456.28559-1-julien.grall@arm.com> References: <20190514122456.28559-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH MM-PART2 RESEND 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 Acked-by: Stefano Stabellini --- 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: