From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9582CC433FE for ; Wed, 9 Dec 2020 17:59:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A29423C92 for ; Wed, 9 Dec 2020 17:59:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730928AbgLIR7Y (ORCPT ); Wed, 9 Dec 2020 12:59:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25180 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730721AbgLIR7U (ORCPT ); Wed, 9 Dec 2020 12:59:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607536674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/TyFuiiN7T8ztg3J+dkXREgPHoexWcv0xcyj6tH0TjY=; b=iEeAxQxUZUWWmjUDgxPI7QAFNgHbyqwA1P0M1iWJHHVWitWMLBaV+u3YdTGOUFJrvYlu35 jvB1J4eYrW124d8DllYnGBH89Woi/E99njj+GG/5/p9vpPj9egLWo1UZ0ThPObrereogZS 4U+E6JB/PXIeUlKnZVuuzG14B58cItQ= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-532-xQyUcCdpMqin9twmRJXqag-1; Wed, 09 Dec 2020 12:57:50 -0500 X-MC-Unique: xQyUcCdpMqin9twmRJXqag-1 Received: by mail-qk1-f198.google.com with SMTP id c25so1634845qko.19 for ; Wed, 09 Dec 2020 09:57:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=/TyFuiiN7T8ztg3J+dkXREgPHoexWcv0xcyj6tH0TjY=; b=P3OJntD/kIK7Nn6EO/pxzUkIzOHI5VcMBbS8Y43dOmgOJJD+r7MrkyixT7oV9ALjFi j4W5Kc/4EgLzKcPMOimDAknJU5R0wIrcrve3cLgqscRlf4uCUXrKR++LnbJk1eG7rTTP yi9zlW5sgDkU9ygTUlL+4O3kyZinKlOTvO8J58+PjiBHcyPBN2z2IAZfmQ2Jcsk/Js5Q phwfb9rZs4xKBRLUeEHKy99/BS97ELScX35UlMHNsv3voi1R4f3/a+Pvu85Zakq9ri8Z aJaGe8xpnsDyHa7tltVZfQOQocFf1w+FQmgli7TkIsBZbCxLAiCckzwcJBW4mwWMdH7j 6GVA== X-Gm-Message-State: AOAM533JaZwKsr8Dkhmeg4fSpEDsmIwua2QGECb6fxBgWKPGcQ3FrfVr /EQ1QoMZqdChK2aMFyrsewPOIGyjhCPsMKFQQKRLdhfto0qvHmKLvxGUCVPTJnyBuOcjMFRjfKO 3tL+/nxmpOTy9bI5JTWN2qFkvfMqo X-Received: by 2002:a37:b987:: with SMTP id j129mr1641815qkf.131.1607536669866; Wed, 09 Dec 2020 09:57:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPk1684Ru5rlDYOwl7BoAgTKuEcvaEAnSF0249oHQ/8MPs97gHSBbXi1zddK6zsparPuktdrs4tC120cCgL0c= X-Received: by 2002:a37:b987:: with SMTP id j129mr1641779qkf.131.1607536669584; Wed, 09 Dec 2020 09:57:49 -0800 (PST) MIME-Version: 1.0 References: <20201120185105.279030-1-eperezma@redhat.com> <20201120185105.279030-9-eperezma@redhat.com> <20201208072051.GO203660@stefanha-x1.localdomain> In-Reply-To: <20201208072051.GO203660@stefanha-x1.localdomain> From: Eugenio Perez Martin Date: Wed, 9 Dec 2020 18:57:12 +0100 Message-ID: Subject: Re: [RFC PATCH 08/27] vhost: Add a flag for software assisted Live Migration To: Stefan Hajnoczi Cc: qemu-level , Lars Ganrot , virtualization@lists.linux-foundation.org, Salil Mehta , "Michael S. Tsirkin" , Liran Alon , Rob Miller , Max Gurtovoy , Alex Barba , Stefan Hajnoczi , Jim Harford , Jason Wang , Harpreet Singh Anand , Christophe Fontaine , vm , Daniel Daly , Michael Lilja , Stefano Garzarella , Nitin Shrivastav , Lee Ballard , Dmytro Kazantsev , Juan Quintela , kvm list , Howard Cai , Xiao W Wang , Sean Mooney , Parav Pandit , Eli Cohen , Siwei Liu , Stephen Finucane Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, Dec 8, 2020 at 8:21 AM Stefan Hajnoczi wrote: > > On Fri, Nov 20, 2020 at 07:50:46PM +0100, Eugenio P=C3=A9rez wrote: > > @@ -1571,6 +1577,13 @@ void vhost_dev_disable_notifiers(struct vhost_de= v *hdev, VirtIODevice *vdev) > > BusState *qbus =3D BUS(qdev_get_parent_bus(DEVICE(vdev))); > > int i, r; > > > > + if (hdev->sw_lm_enabled) { > > + /* We've been called after migration is completed, so no need = to > > + disable it again > > + */ > > + return; > > + } > > + > > for (i =3D 0; i < hdev->nvqs; ++i) { > > r =3D virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), hdev->vq_= index + i, > > false); > > What is the purpose of this? It is again a quick hack to get shadow_vq POC working. Again, it deserves a better comment :). If I recall correctly, vhost-net calls vhost_dev_disable_notifiers again on destruction, and it calls to memory_region_del_eventfd, then virtio_pci_ioeventfd_assign, which is not safe to call again because of the i !=3D mr->ioeventfd_nb assertion. The right fix for this should be either in virtio-pci (more generic, but not sure if calling it again is the expected semantic of it), individual vhost devices (less generic) or where it is at this moment, but with the right comment. Thanks!