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

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


  • To: <wei.chen@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Thu, 23 Sep 2021 20:02:00 +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; bh=Jvn0ISo/HgoiboBWB5FbYbJTrYAvUyDADUFepjr42Sw=; b=cb1BOiI2Kv9ixkOVfDQ79QYSsvmpXzjAuNDDzqYCTxroWBbATu6+P6VIMjc+3sv+EDmYQ7h8zPFQLam8+d9dreZRQ7Ako4xBSUtkwGfW7Yu3+4iYRp3z+cSR0NU5/kypti4XbGpUqnJOdCb1i7fE+/PNp5hno5vnlFb1K02UeDxmkfgROlTJ1jnCaOC6bLhSjYbe3TUCz7bUaRHAlNBnV+KlWmhiZN86HTKbSQz5p4LnRkdKy5tTvdrQBfWhBC5uDxsaoijnnl0uiKCViyE2UVApEf/n+6WekI4Xej6OjtfC7xErWTy5xJ73w2bdwnKkZRg1GhFWbL0xTaMi8CrQ0w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gFvw+C6x1mEYUAyAcypHj6Ny9AHhhQdKsyh58VcmC9A19pZuivMGoBM2oPhTHYGTYkHAEX/JQz95AYvzaAifLyBwA0lPyWAvxKQIBEw/dKihQacyGbPWltZ7cwky2BtN0TeMBBMTA2pgGezwevhYHzGdiJbhx7a67wvKisUi8naeRiXiZMZ3sg277RNDxjuoYK6McD3SD6u9tyC4f58uBw0WXi6fmVy4/Vc3ufStuhGvUlW7RWQWy+mlldsuXdmyOQQxiyS0xXhP29jMrayAKtvZfNgKoSDXt52t74TMki0s9t/QFukFpdqnUZy5PSwyeecKVoeME/STuojWHDsUGw==
  • Cc: <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Thu, 23 Sep 2021 12:03:46 +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 | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index aa1f88c764..d957ea377b 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -862,17 +862,18 @@ 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 */
+#define PRINT_MASK 0xf000000000000000
 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, #PRINT_MASK    /* 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®.