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

RE: [XEN RFC PATCH 02/40] xen/arm: Print a 64-bit number in hex from early uart


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Fri, 20 Aug 2021 01:13:37 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; 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-SenderADCheck; bh=I5ea1UXOvj1O6R847UNjM5VFamQbTT0w5FHa5zY6eSk=; b=dE6UroqhonEkRL7D1EdmyBW5XuQubIAHg9OWNZu6xBF2INGYdZrasqG8h4FPfINfx4YxuHvtbpls8+upd+3tDCvgzOSc3aMxXQfzYKMOjsAmavFzfjIIAmB3RzTomQzRu9zsQA+27aZrkPu3Um1U7cRdZ2srm8TgbYoI0ucq26OsppSVGzNEvcgYKV9KuTmqxpgMS32woQaPKnJqb0BBokHMOWW9Uh8TlkqDmIG9hXF2R+ftcNBRV/r3nHnSlPTsSxzZEVEUObGZLO4X2iWfC+lE94lHQbR/1QOYiP7thYucnmGRaBnyKcehQ4UPUSPK5uHNl4n8qD2R80DlrmpEQQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DJ09OlaCVtz/GW0MGKssDJGtbVOMIkkPlIGNfnm7qDUM3+Nmw06FBGo6Qprr5W87Wd6IDbmAQyodP8ZLiUmbfvJuMEyLrZOi+P5j3Mhg4aItwG/bTWH8Ce9piBgQJQ6+wvLrtM9/6TP6fa0qPRObnM12v98PWPc2HoWEM/tABFOFYBnvHchCw9BGbb90sPA9R+LBkJaJu7f8lou1lTnVITk8sU2IhZUQAE72UT7Fd+R4dRxU3EQLCjZoToY8dyt1ZqQgUlLipAuimCiyAV4A2V2URlPI7qJoSjAVlkjXq3W3j0n3SlHlpOpGNSqGwYmezYDJjoS8Uwwv/2J7CtvLpg==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Fri, 20 Aug 2021 01:14:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXjpsdCvhq9I7jC0CjJYd+3OMFqat62GyAgADLXdA=
  • Thread-topic: [XEN RFC PATCH 02/40] xen/arm: Print a 64-bit number in hex from early uart

Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: 2021年8月19日 21:05
> To: Wei Chen <Wei.Chen@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> sstabellini@xxxxxxxxxx; jbeulich@xxxxxxxx
> Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
> Subject: Re: [XEN RFC PATCH 02/40] xen/arm: Print a 64-bit number in hex
> from early uart
> 
> Hi Wei,
> 
> On 11/08/2021 11:23, Wei Chen wrote:
> > 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..b32639d7d6 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.  Specific to the PL011 UART.
> 
> As you modify the line, can you take the opportunity to write:
> 
> /*
>   * Print a 64-bit...
> 
> And also drop the second sentence as it the code has not been PL011
> specific for quite a while now.
> 

Ok, I will do it in next version

> >    * 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 */
> >
> 
> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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