From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a5d:51d0:0:0:0:0:0 with SMTP id n16csp9229794wrv; Fri, 9 Aug 2019 06:51:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzUYIahCdD25JJmdTtxtbfKnSzEy7Q3wr61p+QkqmGcUQWnt8oy8QopGDkQIl2xa7ATd5b X-Received: by 2002:a0c:e588:: with SMTP id t8mr17973486qvm.179.1565358682246; Fri, 09 Aug 2019 06:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565358682; cv=none; d=google.com; s=arc-20160816; b=bJQUucOBjKe2aeQX+UrHXvsOLR+9sy2SvBDxy5LY98rudYjIqRi5wh7o18IfWGIdqR RjxTtWzHMUW/d6RAgTnqCNPsNLUsDVVYwvWTe30gpJlOWbm6ci45J2Vk7wNiWXroOEWd unGWfgAK0OB7JfGvR1CfZNbVVkQAsiiXqIU405s73yNV2HXHKZFuxrABpcZZozGDE7NE wOQ8WG2/SXHyQhOHLlpRYGFuOZmi+E28pCalOTTiOTqEFsmzC94CY9VtnVABVQ4VOtW8 lq9nbHMoDalYmtOc/d7oTvZElrToEw3yEtKeY17XUYNQI/L9VjrQb8fpjSstJDRlkvgV jSJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:to:from:date; bh=4NyZeoeVEUBjJ3JBUZqCndDZ7MkkZ0qRycH2ZWeND2E=; b=rpPUYkdJStjKUIO6n5EW/7MUAnaA4OztGofMkUwMBd4qc3h0gS13x6VM8gZSmSywXU YCXsSRkCDfy/mdV5Q+lKO8PNn0xlsRPs/n/+oRDPPUpEYRFOpsEIIZ6Me5X56Y9LzQOn CE2BXaoGIJjyrEWJT5Mjz/hf4cUDBALs8goehowSpAWDaejTxVY3IhAeDHs+Qa0eo88g WoeM60NNe6jyym+0nwfy9XcR0u3cH31UO+58n2hMevVixkmB0hf6JG1Aw4lYUW2de8IP BDBQnXtc/M4DQtkuomHWY6PwEgEYHkCF6/jb8GXW8SV335Wdg5lSmZomJLhVsHObU6h9 NNAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x3si40713124qkn.31.2019.08.09.06.51.22 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Aug 2019 06:51:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:59556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hw5If-0001fN-Qi for alex.bennee@linaro.org; Fri, 09 Aug 2019 09:51:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34520) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hw5Ia-0001cb-7T for qemu-arm@nongnu.org; Fri, 09 Aug 2019 09:51:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hw5IZ-0001OF-6u for qemu-arm@nongnu.org; Fri, 09 Aug 2019 09:51:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5009) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hw5IY-0001NE-VR; Fri, 09 Aug 2019 09:51:15 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D9E4E308A958; Fri, 9 Aug 2019 13:51:12 +0000 (UTC) Received: from work-vm (ovpn-117-184.ams2.redhat.com [10.36.117.184]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6798B65EB4; Fri, 9 Aug 2019 13:50:49 +0000 (UTC) Date: Fri, 9 Aug 2019 14:50:46 +0100 From: "Dr. David Alan Gilbert" To: Peter Maydell Message-ID: <20190809135046.GE2840@work-vm> References: <20190729145654.14644-1-damien.hedde@greensocs.com> <20190729145654.14644-8-damien.hedde@greensocs.com> <20190808154219.GK2852@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 09 Aug 2019 13:51:13 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-arm] [PATCH v3 07/33] automatically add vmstate for reset support in devices X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Collin Walling , Dmitry Fleytman , "Michael S. Tsirkin" , Mark Cave-Ayland , QEMU Developers , Gerd Hoffmann , Edgar Iglesias , Hannes Reinecke , Qemu-block , Juan Quintela , David Hildenbrand , Halil Pasic , Christian Borntraeger , Marcel Apfelbaum , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Richard Henderson , Thomas Huth , Eduardo Habkost , Alistair Francis , qemu-s390x , qemu-arm , =?iso-8859-1?Q?C=E9dric?= Le Goater , John Snow , David Gibson , Damien Hedde , "Daniel P. Berrange" , Cornelia Huck , Mark Burton , qemu-ppc , Paolo Bonzini Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: fSqVI07LtKja * Peter Maydell (peter.maydell@linaro.org) wrote: > On Thu, 8 Aug 2019 at 16:42, Dr. David Alan Gilbert wrote: > > > > * Peter Maydell (peter.maydell@linaro.org) wrote: > > > On Mon, 29 Jul 2019 at 15:59, Damien Hedde wrote: > > > > > > > > This add the reset related sections for every QOM > > > > device. > > > > > > A bit more detail in the commit message would help, I think -- > > > this is adding extra machinery which has to copy and modify > > > the VMStateDescription passed in by the device in order to > > > add the subsection that handles reset. > > > > > > I've added Dave Gilbert to the already long cc list since this > > > is migration related. > > > > I don't like dynamically modifying all the vmsds. > > Yeah, I'm not a huge fan of it either, but it does mean that > the state gets migrated and we don't have a pile of really > easy to miss bugs where we forgot to say "this device needs to > migrate the reset state" and it means we don't have every > device we ever write in the future needing to say "this device > needs to migrate reset state"... > > > Aren't you going to have to understand each devices reset behaviour > > and make sure it does something sane? e.g. it might have a postload > > that registers a timer or something that you wouldn't want to do if it's > > in reset. > > > > The easiest way is to write a macro that you can easily add to devices > > you've checked subsection list (like the way we have a > > VMSTATE_USB_DEVICE). > > One problem is that as soon as somebody writes a USB controller > or PCI controller model that can be held in reset, every > device that could sat behind it automatically now could find > that it's migrated while it's in reset. I'm not convinced though that they'll all be fixed by adding this subsection; I think some of those devices you're going to have to look at and see what they do. Dave > thanks > -- PMM -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK 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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 B7DA2C31E40 for ; Fri, 9 Aug 2019 13:51:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 90B092086D for ; Fri, 9 Aug 2019 13:51:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90B092086D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hw5JF-0002hY-J5 for qemu-devel@archiver.kernel.org; Fri, 09 Aug 2019 09:51:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34560) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hw5Ie-0001jd-T9 for qemu-devel@nongnu.org; Fri, 09 Aug 2019 09:51:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hw5Id-0001RL-En for qemu-devel@nongnu.org; Fri, 09 Aug 2019 09:51:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5009) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hw5IY-0001NE-VR; Fri, 09 Aug 2019 09:51:15 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D9E4E308A958; Fri, 9 Aug 2019 13:51:12 +0000 (UTC) Received: from work-vm (ovpn-117-184.ams2.redhat.com [10.36.117.184]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6798B65EB4; Fri, 9 Aug 2019 13:50:49 +0000 (UTC) Date: Fri, 9 Aug 2019 14:50:46 +0100 From: "Dr. David Alan Gilbert" To: Peter Maydell Message-ID: <20190809135046.GE2840@work-vm> References: <20190729145654.14644-1-damien.hedde@greensocs.com> <20190729145654.14644-8-damien.hedde@greensocs.com> <20190808154219.GK2852@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 09 Aug 2019 13:51:13 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PATCH v3 07/33] automatically add vmstate for reset support in devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Collin Walling , Dmitry Fleytman , "Michael S. Tsirkin" , Mark Cave-Ayland , QEMU Developers , Gerd Hoffmann , Edgar Iglesias , Hannes Reinecke , Qemu-block , Juan Quintela , David Hildenbrand , Halil Pasic , Christian Borntraeger , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Richard Henderson , Thomas Huth , Eduardo Habkost , Alistair Francis , qemu-s390x , qemu-arm , =?iso-8859-1?Q?C=E9dric?= Le Goater , John Snow , David Gibson , Damien Hedde , "Daniel P. Berrange" , Cornelia Huck , Mark Burton , qemu-ppc , Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" * Peter Maydell (peter.maydell@linaro.org) wrote: > On Thu, 8 Aug 2019 at 16:42, Dr. David Alan Gilbert wrote: > > > > * Peter Maydell (peter.maydell@linaro.org) wrote: > > > On Mon, 29 Jul 2019 at 15:59, Damien Hedde wrote: > > > > > > > > This add the reset related sections for every QOM > > > > device. > > > > > > A bit more detail in the commit message would help, I think -- > > > this is adding extra machinery which has to copy and modify > > > the VMStateDescription passed in by the device in order to > > > add the subsection that handles reset. > > > > > > I've added Dave Gilbert to the already long cc list since this > > > is migration related. > > > > I don't like dynamically modifying all the vmsds. > > Yeah, I'm not a huge fan of it either, but it does mean that > the state gets migrated and we don't have a pile of really > easy to miss bugs where we forgot to say "this device needs to > migrate the reset state" and it means we don't have every > device we ever write in the future needing to say "this device > needs to migrate reset state"... > > > Aren't you going to have to understand each devices reset behaviour > > and make sure it does something sane? e.g. it might have a postload > > that registers a timer or something that you wouldn't want to do if it's > > in reset. > > > > The easiest way is to write a macro that you can easily add to devices > > you've checked subsection list (like the way we have a > > VMSTATE_USB_DEVICE). > > One problem is that as soon as somebody writes a USB controller > or PCI controller model that can be held in reset, every > device that could sat behind it automatically now could find > that it's migrated while it's in reset. I'm not convinced though that they'll all be fixed by adding this subsection; I think some of those devices you're going to have to look at and see what they do. Dave > thanks > -- PMM -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK