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

Re: [PATCH v3 5/6] xen/riscv: introduce early_printk basic stuff


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 10 Jan 2023 16:57:47 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gaQPbytk+9sWancaNFfbsyIA0wu03ZervPJ+QZzmKQY=; b=EdKxGGJ1aKpQEhepsQ1+TNtPvyvjXpr96wk4uSRxYVYFpLKIVa2yMymmrwYilTev996+608phBAqa4Vyfz/OfJPBwmZ+2lV7ULLoM6EA6u8SgVYSUvq0CNDrWMt4Hz9YCfkhtMwQkc9qmfqCfsssmazauSeYabLOQ/SXLPYTRhTL8XlNVu+dZT902dxHaommDRHbQMDwqawC9/8Z9Nis4tHTmEP8rt9tJ0ObMdQrnE1yH7Eh/v5joet0gdpP1MJ4cge0gxM9Hh/BXRNPPjOk0fnjLH7Bw4f03NoQRrEIFWfGcInac80E5ibA6GC6ttJS99IVAIzHxtEGbUVELk6nJg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dq1wicav9BQVE8MDHlBgk+XxmNZ+eu75xmWxHjw3bqat/FgSb771DBkZLItnHYfUHZ9MRZO137dkqBggJUtswsJmpYqHkEhv53LIcjrvtB2ReIGeXr35OHSEIzOtHjQbGoeDOInCO8KY6mrnurmZsJDs+qFNxJPPaQj4qUAe47zwubG3sakqOCP0qmHFBQGOxQIDQETArHmbR5jjjxkXORCNw79f4F3cBVog62M8BtzmpGVjuiUi4yEMsSg9MPQ6uB15l6JC02NTFggoWaYPuy7qMB8pa5hvL5hW7TDhrIC+cDNd4+I59q7r21q8Zy6M4o0kEoabHGPb8GzH+yFozg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Gianluca Guida <gianluca@xxxxxxxxxxxx>, Bobby Eshleman <bobby.eshleman@xxxxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 10 Jan 2023 15:57:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.01.2023 16:17, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/Kconfig.debug
> +++ b/xen/arch/riscv/Kconfig.debug
> @@ -0,0 +1,7 @@
> +config EARLY_PRINTK
> +    bool "Enable early printk"
> +    default DEBUG
> +    depends on RISCV_64 || RISCV_32

You're in a RISC-V-specific Kconfig - do you really need this line?

> --- /dev/null
> +++ b/xen/arch/riscv/early_printk.c
> @@ -0,0 +1,33 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * RISC-V early printk using SBI
> + *
> + * Copyright (C) 2021 Bobby Eshleman <bobbyeshleman@xxxxxxxxx>
> + */
> +#include <asm/early_printk.h>
> +#include <asm/sbi.h>
> +
> +/*
> + * TODO:
> + *   sbi_console_putchar is already planned for deprecation
> + *   so it should be reworked to use UART directly.
> +*/
> +void early_puts(const char *s, size_t nr)
> +{
> +    while ( nr-- > 0 )
> +    {
> +        if (*s == '\n')

Nit (style): Missing blanks.

> +            sbi_console_putchar('\r');
> +        sbi_console_putchar(*s);
> +        s++;
> +    }
> +}
> +
> +void early_printk(const char *str)
> +{
> +    while (*str)

Again.

> --- a/xen/arch/riscv/setup.c
> +++ b/xen/arch/riscv/setup.c
> @@ -1,12 +1,16 @@
>  #include <xen/compile.h>
>  #include <xen/init.h>
>  
> +#include <asm/early_printk.h>
> +
>  /* Xen stack for bringing up the first CPU. */
>  unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
>      __aligned(STACK_SIZE);
>  
>  void __init noreturn start_xen(void)
>  {
> +    early_printk("Hello from C env\n");
> +
>      for ( ;; )
>          asm volatile ("wfi");

While this is only context here, it affects an earlier patch in the
series; this wants to be

    for ( ; ; )
        asm volatile ( "wfi" );

Jan



 


Rackspace

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