Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753401AbdC2GXi (ORCPT ); Wed, 29 Mar 2017 02:23:38 -0400 Received: from mout.gmx.net ([212.227.15.19]:51631 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753027AbdC2GXg (ORCPT ); Wed, 29 Mar 2017 02:23:36 -0400 Message-ID: <1490768602.5950.25.camel@gmx.de> Subject: Re: Random guest crashes since 5c34d002dcc7 ("virtio_pci: use shared interrupts for virtqueues") From: Mike Galbraith To: Christoph Hellwig Cc: Thorsten Leemhuis , mst@redhat.com, virtio-dev@lists.oasis-open.org, Linux Kernel Mailing List , rjones@redhat.com Date: Wed, 29 Mar 2017 08:23:22 +0200 In-Reply-To: <1490638711.26533.44.camel@gmx.de> References: <20170323145622.GA31690@lst.de> <1490605644.14634.50.camel@gmx.de> <20170327170540.GA28715@lst.de> <1490638711.26533.44.camel@gmx.de> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:mWIIZYeh/cmsdkQiRcHKbXKKJx3BghFiSmZBpsVxFMVBoDDHTE+ tDpik5VbScMBjpVZ1Vir78PG6nU3lh4kIS7+9V5ibzM07PRleroundWQtURkk8MIBJQb6P9 RDSS5Hn21N46LzwWwTAP4qz4jMNqzDIETDiuykYpbOCFJixRG+CnFxURk4ybDyEcZm8kOqA uL3NXh8fvc9krmZ7e/D8w== X-UI-Out-Filterresults: notjunk:1;V01:K0:9jog8IMHGEo=:VBoA9aM4oZC1UpLDgytn/8 0AIxhOt2xT6uUH86lCimcoB9XPkoyn3g05C+7PDxVfm900RyE1XYu94MgObklYDqs+pkAfy06 7LN3O0KrTfJ98xBqe75dqw3ctLkxfDgsiJdg9KplbYIphXQ3wK8Fp8MwdNPlQ8jBqmmtNEBlp T5RvunN8SBHOLsJ9ZvbzR2P5Btd81rELo8pXLlyNVZqwt3UtGQzvy1fNSWFF6ciDuJDAntex2 V0ayRpK+mcJFSO4XkxLJg/zMtzMygfdBDpkOdYuLIUL2hHitjuohaxqWJ0OM1dgg7Lnaqf0sN GNiJm0H8TjA45gbLkqv0klqB5jAoMFZM0vweT7DJUnS/tK595HkBQrE3cAfvjV8Ffr7LQNuHK 96WfEbAisa+i8kO9x838aUJNeHwZuhNpzjjLLW2v+TARNK3+WiB2NLpYoU2fp4y1aIJdTFzdJ RiDRuUgX40VkoJzACPt4cOdNh2qc24UcUDnKEG4ra26jqVedAnher9pt2s1o/Y7oWnyC5j3zk p5+llxVG7dioDEqEEI/LCUl6zODjOpudfXScOofjkwO7Swp9vgAah7FlJXx5fNqjGbNarap+V T5MRytqDTBuazy+H0ps1FP95F+x6cT3Fnj4k5oxYR0yE9Z1qeultUGgsEJu3bLHYQRpckAbuj tKuyDkk9ReST+r+Ik+CbsSr8nJG3JQmS6DW70dbArAhJ/h0wS/1ixSbspeVYsZLjfOrPsAA8I kN2/Atm+n6SeXiUKf6m/I5Se2okKejvto3IAVrLlqlsR+0hqZu0SUtI0Cnn3oi7eRn0S7Hbo+ SpEHISm Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1846 Lines: 50 On Mon, 2017-03-27 at 20:18 +0200, Mike Galbraith wrote: > BTW, WRT RT woes with $subject, I tried booting a generic kernel with > threadirqs, and bingo, same deal, just a bit more painful than for RT, > where there's no watchdog moaning accompanying the (preemptible) spin. BTW++: the last hunk of this bandaid may be a bug fix. With only the first two, box tried to use uninitialized stuff on hibernate, went boom. Looks like that may be possible without help from me. --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -2058,7 +2058,7 @@ static int virtcons_probe(struct virtio_ portdev->max_nr_ports = 1; /* Don't test MULTIPORT at all if we're rproc: not a valid feature! */ - if (!is_rproc_serial(vdev) && + if (!is_rproc_serial(vdev) && !IS_ENABLED(CONFIG_IRQ_FORCED_THREADING) && virtio_cread_feature(vdev, VIRTIO_CONSOLE_F_MULTIPORT, struct virtio_console_config, max_nr_ports, &portdev->max_nr_ports) == 0) { @@ -2179,7 +2179,9 @@ static struct virtio_device_id id_table[ static unsigned int features[] = { VIRTIO_CONSOLE_F_SIZE, +#ifndef CONFIG_IRQ_FORCED_THREADING VIRTIO_CONSOLE_F_MULTIPORT, +#endif }; static struct virtio_device_id rproc_serial_id_table[] = { @@ -2202,14 +2204,16 @@ static int virtcons_freeze(struct virtio vdev->config->reset(vdev); - virtqueue_disable_cb(portdev->c_ivq); + if (use_multiport(portdev)) + virtqueue_disable_cb(portdev->c_ivq); cancel_work_sync(&portdev->control_work); cancel_work_sync(&portdev->config_work); /* * Once more: if control_work_handler() was running, it would * enable the cb as the last step. */ - virtqueue_disable_cb(portdev->c_ivq); + if (use_multiport(portdev)) + virtqueue_disable_cb(portdev->c_ivq); remove_controlq_data(portdev); list_for_each_entry(port, &portdev->ports, list) {