[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 01/10] xen/arm: Print a 64-bit number in hex from early uart


  • To: <--to=xen-devel@xxxxxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Mon, 18 Apr 2022 17:07:26 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FIw93tJ3H+SfJwxD5M/sOYcJYzkHITrNvMbzRUuV10w=; b=b9Hf+f/t5UF9Z1H4gBgpnLVEDhVPWfJtF7srDN659wSrn9bQ81QUbFfqUuTHgxfE7M+vBsCyr62ba/uyiis2xrEulLjbhGYOwt1FdfSmuP+xCbjiGiqFf+P9ac1riVKftkXo+Q0Opv7TdJdEa7Ho0wWK2rSWLujvGaLcnm5YXRKXEw2q8QfKi+ov0Tki5lKBmIe2sFerGcfHTl3g4hfVT7IoNjpt9csT6tZC8KL/a/bIZOKGHI9HAo2jMirSHJhE5VTeaXUhP1TbLeUFDvP4U5xwiKsburwUcaZMX6wq1fTmA4f9r3QXU8AU7BIHLqyS+0x+GBuKDbxhT+vcTvybgg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RzoFdnGDJnskow1Ky3YI5yjPDXf7PkzJ4O7gUvM+/onqmxm5RX5xcNPsWjgu5faqpqM7WpWzcsaynu17lXIhnLZxWvKl2TdFJh9VTyNOtSZ5EfI2c4gu+3TTpyGUBnB4qWarQSyzlRP25MSCGFE6S5hYPomUONn0Y4e024X73zKl8U4tOLk42zir66tzIHg/K7jOHse8kfBzF9H/rKrnN6wcK9e7jf3p4x8fU5RLzm8ZxYOuAN10N8MvEDMg0Q1tpGnDoyaAKV/FqugJvMcqH8CfZytH0MLdIDxBeIflpMh1mSSokxCTpr/xbhEzjMB2SUYYRd0RhBDiDeeBQvJ1jQ==
  • Cc: <nd@xxxxxxx>, Wei Chen <wei.chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>
  • Delivery-date: Mon, 18 Apr 2022 09:09:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

Current putn function that is using for early print
only can print low 32-bit of AArch64 register. This
will lose some important messages while debugging
with early console. For example:
(XEN) Bringing up CPU5
- CPU 0000000100000100 booting -
Will be truncated to
(XEN) Bringing up CPU5
- CPU 00000100 booting -

In this patch, we increased the print loops and shift
bits to make putn print 64-bit number.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 xen/arch/arm/arm64/head.S | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index e62c48ec1c..2bb7906f69 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -866,17 +866,19 @@ puts:
         ret
 ENDPROC(puts)
 
-/* Print a 32-bit number in hex.  Specific to the PL011 UART.
+/*
+ * Print a 64-bit number in hex.
  * x0: Number to print.
  * x23: Early UART base address
- * Clobbers x0-x3 */
+ * Clobbers x0-x3
+ */
 putn:
         adr   x1, hex
-        mov   x3, #8
+        mov   x3, #16
 1:
         early_uart_ready x23, 2
-        and   x2, x0, #0xf0000000    /* Mask off the top nybble */
-        lsr   x2, x2, #28
+        and   x2, x0, #(0xf<<60)     /* Mask off the top nybble */
+        lsr   x2, x2, #60
         ldrb  w2, [x1, x2]           /* Convert to a char */
         early_uart_transmit x23, w2
         lsl   x0, x0, #4             /* Roll it through one nybble at a time */
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.