Received: from eggs.gnu.org ([2001:4830:134:3::10]:47453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckv83-0002qG-9c for qemu-devel@nongnu.org; Mon, 06 Mar 2017 11:05:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ckv7y-0003do-An for qemu-devel@nongnu.org; Mon, 06 Mar 2017 11:04:55 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60771 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ckv7y-0003dW-5G for qemu-devel@nongnu.org; Mon, 06 Mar 2017 11:04:50 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v26G3d6d066479 for ; Mon, 6 Mar 2017 11:04:49 -0500 Received: from e06smtp09.uk.ibm.com (e06smtp09.uk.ibm.com [195.75.94.105]) by mx0a-001b2d01.pphosted.com with ESMTP id 2918mkyb3h-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 06 Mar 2017 11:04:49 -0500 Received: from localhost by e06smtp09.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 Mar 2017 16:04:47 -0000 Date: Mon, 6 Mar 2017 17:04:41 +0100 From: Cornelia Huck In-Reply-To: References: <20170302185942.76255-1-pasic@linux.vnet.ibm.com> <20170303132149.34e5906a.cornelia.huck@de.ibm.com> <20170303135012.17edb640.cornelia.huck@de.ibm.com> <20170306155625.5c426793.cornelia.huck@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-Id: <20170306170441.2a8f8b27.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH 1/1] virtio: fail device if set_event_notifier fails List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Halil Pasic Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" On Mon, 6 Mar 2017 16:21:13 +0100 Halil Pasic wrote: > On 03/06/2017 03:56 PM, Cornelia Huck wrote: > > On Fri, 3 Mar 2017 14:08:37 +0100 > > Halil Pasic wrote: > >=20 > >> On 03/03/2017 01:50 PM, Cornelia Huck wrote: > >>> On Fri, 3 Mar 2017 13:43:32 +0100 > >>> Halil Pasic wrote: > >>> > >>>> On 03/03/2017 01:21 PM, Cornelia Huck wrote: > >>>>> On Thu, 2 Mar 2017 19:59:42 +0100 > >>>>> Halil Pasic wrote: > [...] > >> I admit, I did not investigate this thoroughly, also because the patch > >> is flawed regarding multi-thread anyway. After a quick investigation > >> it seems the linux guest won't auto-reset the device so the guest shou= ld > >> end up with a not working device. I think it's pretty likely that the > >> admin will check the logs if the device was important. > >=20 > > Thinking a bit more about this, it seems setting the device broken is > > not the right solution for exactly that reason. Setting the virtio > > device broken is a way to signal the guest to 'you did something > > broken; please reset the device and start anew' (and that's how current > > callers use it). In our case, this is not the guest's fault. >=20 > Do we have something to just say stuff broken without blaming the guest? > And device reset might not be that stupid at all in the given situation, > if we want to save what can be saved from the perspective of the guest. > (After reset stuff should work again until we hit the race again -- and > since turning ioeventfd on/off should not happen that often during normal > operation it could help limit damage suffered -- e.g. controlled shutdown= ). Checking again, the spec says DEVICE_NEEDS_RESET (64) Indicates that the device has experienced an error from which it can=E2=80=99t recover. Nothing about 'guest error'. The only problem is that legacy devices don't have that state, which means they'll have a broken device through no fault of their own. >=20 > >=20 > > Maybe go back to the assert 'solution'? But I'm not sure that's enough > > if production builds disable asserts... > >=20 >=20 > I will wait a bit, maybe other virtio folks are going to have an=20 > opinion too. >=20 > My concern about the assert solution is that for production it is > either too rigorous (kill off, hopefully with a dump) or not > enough (as you have mentioned, if NDEBUG assert does nothing). >=20 >=20 > I think there are setups where a loss of device does not have to be > fatal, and I would not like to be the one who makes it fatal (for the > guest). Basically, it's a host bug (and not a bug specific to a certain device). Moving the device which was impacted to a broken state may be a useful mitigation. But yes, let's hear some other opinions.