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

Re: [XTF 3/4] Enabled serial writing for hvm guests



On 16/04/2020 10:41, Pawel Wieczorkiewicz wrote:
> From: Paul Semel <phentex@xxxxxxxxx>
>
> setup.c: PV console writing is not working in Xen 4.2 for hvm
> guests,

What is not working about it?

>  so we make xtf write to COM1 serial port to get its output
>
> Signed-off-by: Paul Semel <phentex@xxxxxxxxx>
> Signed-off-by: Pawel Wieczorkiewicz <wipawel@xxxxxxxxx>
> ---
>  arch/x86/setup.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/arch/x86/setup.c b/arch/x86/setup.c
> index 3c84e96..f6fa4df 100644
> --- a/arch/x86/setup.c
> +++ b/arch/x86/setup.c
> @@ -238,6 +238,13 @@ static void qemu_console_write(const char *buf, size_t 
> len)
>                   : "d" (0x12));
>  }
>  
> +static void com1_write(const char *buf, size_t len)
> +{
> +    asm volatile("rep; outsb"
> +                 : "+S" (buf), "+c" (len)
> +                 : "d" (0x3f8));

Despite being 0x3f8, this really isn't uart-compatible COM1.  I presume
it only works because Qemu doesn't have any real THR delays in its
emulation.

> +}
> +
>  static void xen_console_write(const char *buf, size_t len)
>  {
>      hypercall_console_write(buf, len);
> @@ -246,7 +253,14 @@ static void xen_console_write(const char *buf, size_t 
> len)
>  void arch_setup(void)
>  {
>      if ( IS_DEFINED(CONFIG_HVM) && !pvh_start_info )
> +    {
>          register_console_callback(qemu_console_write);
> +    }
> +
> +    if ( IS_DEFINED(CONFIG_HVM) )
> +    {
> +        register_console_callback(com1_write);

This wires up 0x3f8 even for PVH guests, which I'm guessing isn't
intentional?  This should be part of the previous if(), but does beg the
question what is wrong with the existing qemu console?

~Andrew



 


Rackspace

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