diff mbox series

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

Message ID 20231115172723.1161679-3-dwmw2@infradead.org (mailing list archive)
State New, archived
Headers show
Series Misc fixes for 8.2 | expand

Commit Message

David Woodhouse Nov. 15, 2023, 5:24 p.m. UTC
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(+)

Comments

Marc-André Lureau Nov. 21, 2023, 10:57 a.m. UTC | #1
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
Marc-André Lureau Nov. 21, 2023, 10:58 a.m. UTC | #2
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()"
Paul Durrant Nov. 21, 2023, 10:59 a.m. UTC | #3
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>
David Woodhouse Nov. 21, 2023, 11:42 a.m. UTC | #4
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.
diff mbox series

Patch

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    },