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

Re: [XTF PATCH v1 4/6] x86: skip registering unavailable Xen console



On Wed, 11 Nov 2026, dmukhin@xxxxxxxx wrote:
> From: Denis Mukhin <dmukhin@xxxxxxxx>
> 
> Do not register Xen console for the test in case HYPERCALL_console_io
> is not available.
> 
> Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>

Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>



> ---
>  arch/x86/setup.c        | 5 +++--
>  include/xtf/hypercall.h | 4 ++--
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/setup.c b/arch/x86/setup.c
> index 8fea6495de1c..725abe289a05 100644
> --- a/arch/x86/setup.c
> +++ b/arch/x86/setup.c
> @@ -250,7 +250,7 @@ static void qemu_console_write(const char *buf, size_t 
> len)
>  
>  static void xen_console_write(const char *buf, size_t len)
>  {
> -    hypercall_console_write(buf, len);
> +    (void)hypercall_console_write(buf, len);
>  }
>  
>  /*
> @@ -297,7 +297,8 @@ void arch_setup(void)
>      if ( IS_DEFINED(CONFIG_HVM) && !pvh_start_info )
>          register_console_callback(qemu_console_write);
>  
> -    register_console_callback(xen_console_write);
> +    if ( !hypercall_console_write("\0", 1) )
> +        register_console_callback(xen_console_write);
>  
>      collect_cpuid(IS_DEFINED(CONFIG_PV) ? pv_cpuid_count : cpuid_count);
>  
> diff --git a/include/xtf/hypercall.h b/include/xtf/hypercall.h
> index 68b3da111d85..475eb771d472 100644
> --- a/include/xtf/hypercall.h
> +++ b/include/xtf/hypercall.h
> @@ -194,9 +194,9 @@ static inline long hypercall_argo_op(unsigned int cmd, 
> void *arg1, void *arg2,
>  /*
>   * Higher level hypercall helpers
>   */
> -static inline void hypercall_console_write(const char *buf, unsigned long 
> count)
> +static inline long hypercall_console_write(const char *buf, unsigned long 
> count)
>  {
> -    (void)HYPERCALL3(long, __HYPERVISOR_console_io, CONSOLEIO_write, count, 
> buf);
> +    return HYPERCALL3(long, __HYPERVISOR_console_io, CONSOLEIO_write, count, 
> buf);
>  }
>  
>  static inline long hypercall_shutdown(unsigned int reason)
> -- 
> 2.56.0
> 



 


Rackspace

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