[PATCH 2/3] vl: disable default serial when xen-console is enabled

David Woodhouse posted 3 patches 1 year ago
Maintainers: Stefano Stabellini <sstabellini@kernel.org>, Anthony Perard <anthony.perard@citrix.com>, Paul Durrant <paul@xen.org>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Jason Wang <jasowang@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
[PATCH 2/3] vl: disable default serial when xen-console is enabled
Posted by David Woodhouse 1 year ago
From: David Woodhouse <dwmw@amazon.co.uk>

If a Xen console is configured on the command line, do not add a default
serial port.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 system/vl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/system/vl.c b/system/vl.c
index 5af7ced2a1..8109231834 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -198,6 +198,7 @@ static const struct {
     const char *driver;
     int *flag;
 } default_list[] = {
+    { .driver = "xen-console",          .flag = &default_serial    },
     { .driver = "isa-serial",           .flag = &default_serial    },
     { .driver = "isa-parallel",         .flag = &default_parallel  },
     { .driver = "isa-fdc",              .flag = &default_floppy    },
-- 
2.41.0
Re: [PATCH 2/3] vl: disable default serial when xen-console is enabled
Posted by Paul Durrant 1 year ago
On 15/11/2023 17:24, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> If a Xen console is configured on the command line, do not add a default
> serial port.
> 
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> ---
>   system/vl.c | 1 +
>   1 file changed, 1 insertion(+)
> 

Reviewed-by: Paul Durrant <paul@xen.org>
Re: [PATCH 2/3] vl: disable default serial when xen-console is enabled
Posted by Marc-André Lureau 1 year ago
Hi

On Wed, Nov 15, 2023 at 9:28 PM David Woodhouse <dwmw2@infradead.org> wrote:
>
> From: David Woodhouse <dwmw@amazon.co.uk>
>
> If a Xen console is configured on the command line, do not add a default
> serial port.
>
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> ---
>  system/vl.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/system/vl.c b/system/vl.c
> index 5af7ced2a1..8109231834 100644
> --- a/system/vl.c
> +++ b/system/vl.c
> @@ -198,6 +198,7 @@ static const struct {
>      const char *driver;
>      int *flag;
>  } default_list[] = {
> +    { .driver = "xen-console",          .flag = &default_serial    },
>      { .driver = "isa-serial",           .flag = &default_serial    },
>      { .driver = "isa-parallel",         .flag = &default_parallel  },
>      { .driver = "isa-fdc",              .flag = &default_floppy    },

Consistent with the rest of the lines (no conditional compilation nor
driver #define..)
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

btw, while quickly testing this (do we have any test for xen-console?):

$ qemu --accel kvm,xen-version=0x40011,kernel-irqchip=split -device
xen-console,chardev=foo -chardev stdio,id=foo
(and close gtk window)

Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
0x0000555555c11695 in qemu_free_net_client (nc=0x0) at ../net/net.c:387
387        if (nc->incoming_queue) {
(gdb) bt
#0  0x0000555555c11695 in qemu_free_net_client (nc=0x0) at ../net/net.c:387
#1  0x0000555555c11a14 in qemu_del_nic (nic=0x555558b6f930) at ../net/net.c:459
#2  0x00005555559e398b in xen_netdev_unrealize (xendev=0x555558b6b510)
at ../hw/net/xen_nic.c:550
#3  0x0000555555b6e22f in xen_device_unrealize (dev=0x555558b6b510) at
../hw/xen/xen-bus.c:973
#4  0x0000555555b6e351 in xen_device_exit (n=0x555558b6b5e0, data=0x0)
at ../hw/xen/xen-bus.c:1002
#5  0x00005555560bc3fc in notifier_list_notify (list=0x5555570b5fc0
<exit_notifiers>, data=0x0) at ../util/notify.c:39
#6  0x0000555555ba1d49 in qemu_run_exit_notifiers () at ../system/runstate.c:800



--
Marc-André Lureau
Re: [PATCH 2/3] vl: disable default serial when xen-console is enabled
Posted by Marc-André Lureau 1 year ago
Hi

On Tue, Nov 21, 2023 at 2:57 PM Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
>
> Hi
>
> On Wed, Nov 15, 2023 at 9:28 PM David Woodhouse <dwmw2@infradead.org> wrote:
> >
> > From: David Woodhouse <dwmw@amazon.co.uk>
> >
> > If a Xen console is configured on the command line, do not add a default
> > serial port.
> >
> > Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> > ---
> >  system/vl.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/system/vl.c b/system/vl.c
> > index 5af7ced2a1..8109231834 100644
> > --- a/system/vl.c
> > +++ b/system/vl.c
> > @@ -198,6 +198,7 @@ static const struct {
> >      const char *driver;
> >      int *flag;
> >  } default_list[] = {
> > +    { .driver = "xen-console",          .flag = &default_serial    },
> >      { .driver = "isa-serial",           .flag = &default_serial    },
> >      { .driver = "isa-parallel",         .flag = &default_parallel  },
> >      { .driver = "isa-fdc",              .flag = &default_floppy    },
>
> Consistent with the rest of the lines (no conditional compilation nor
> driver #define..)
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> btw, while quickly testing this (do we have any test for xen-console?):
>
> $ qemu --accel kvm,xen-version=0x40011,kernel-irqchip=split -device
> xen-console,chardev=foo -chardev stdio,id=foo
> (and close gtk window)
>
> Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
> 0x0000555555c11695 in qemu_free_net_client (nc=0x0) at ../net/net.c:387
> 387        if (nc->incoming_queue) {
> (gdb) bt
> #0  0x0000555555c11695 in qemu_free_net_client (nc=0x0) at ../net/net.c:387
> #1  0x0000555555c11a14 in qemu_del_nic (nic=0x555558b6f930) at ../net/net.c:459
> #2  0x00005555559e398b in xen_netdev_unrealize (xendev=0x555558b6b510)
> at ../hw/net/xen_nic.c:550
> #3  0x0000555555b6e22f in xen_device_unrealize (dev=0x555558b6b510) at
> ../hw/xen/xen-bus.c:973
> #4  0x0000555555b6e351 in xen_device_exit (n=0x555558b6b5e0, data=0x0)
> at ../hw/xen/xen-bus.c:1002
> #5  0x00005555560bc3fc in notifier_list_notify (list=0x5555570b5fc0
> <exit_notifiers>, data=0x0) at ../util/notify.c:39
> #6  0x0000555555ba1d49 in qemu_run_exit_notifiers () at ../system/runstate.c:800

Ok, I found related "[PATCH 1/3] net: do not delete nics in net_cleanup()"



-- 
Marc-André Lureau
Re: [PATCH 2/3] vl: disable default serial when xen-console is enabled
Posted by David Woodhouse 1 year ago
On Tue, 2023-11-21 at 14:58 +0400, Marc-André Lureau wrote:
> 
> > Consistent with the rest of the lines (no conditional compilation nor
> > driver #define..)
> > Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Thanks.

> > btw, while quickly testing this (do we have any test for xen-console?):
> > 
> > $ qemu --accel kvm,xen-version=0x40011,kernel-irqchip=split -device
> > xen-console,chardev=foo -chardev stdio,id=foo
> > (and close gtk window)
> > 
> > Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
> > 0x0000555555c11695 in qemu_free_net_client (nc=0x0) at ../net/net.c:387
> > 387        if (nc->incoming_queue) {
> > (gdb) bt
> > #0  0x0000555555c11695 in qemu_free_net_client (nc=0x0) at ../net/net.c:387
> > #1  0x0000555555c11a14 in qemu_del_nic (nic=0x555558b6f930) at ../net/net.c:459
> > #2  0x00005555559e398b in xen_netdev_unrealize (xendev=0x555558b6b510)
> > at ../hw/net/xen_nic.c:550
> > #3  0x0000555555b6e22f in xen_device_unrealize (dev=0x555558b6b510) at
> > ../hw/xen/xen-bus.c:973
> > #4  0x0000555555b6e351 in xen_device_exit (n=0x555558b6b5e0, data=0x0)
> > at ../hw/xen/xen-bus.c:1002
> > #5  0x00005555560bc3fc in notifier_list_notify (list=0x5555570b5fc0
> > <exit_notifiers>, data=0x0) at ../util/notify.c:39
> > #6  0x0000555555ba1d49 in qemu_run_exit_notifiers () at ../system/runstate.c:800
> 
> Ok, I found related "[PATCH 1/3] net: do not delete nics in net_cleanup()"

Yep, and I think I saw that go by in a pull request not many hours ago,
so it should be fixed by -rc1. Thanks for testing.