Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1238345rdb; Wed, 20 Sep 2023 03:51:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUDecEwSmgbS/ZJc+rHCH6Fnn5FtSYw3dwJOQ3acNOR3k0Gw1Wcr0pVA6pffcrEC8TGliC X-Received: by 2002:a05:6808:13c8:b0:3a7:4509:ecc7 with SMTP id d8-20020a05680813c800b003a74509ecc7mr2339735oiw.16.1695207102468; Wed, 20 Sep 2023 03:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695207102; cv=none; d=google.com; s=arc-20160816; b=V7wk650APe/VyQWk5t9pNCGbVEPLqAY4msNjlUupJlfyehhqK7pUtct8SL7myBa7nh U4A0uKxUsxuwJLyXNjATSuhT+pBXSPSB8i5K7XBuHRtUsJkaCZAdyYrE42uyoqXYRWBG hhf/m4yOBKxvTapIm9pfQK+3pAjlEzRqPiKpIpJ61kx6LBawgbwPz6dtjfslIx32fRCY 8FJQm2FXKiHrz2jGokDlI3BcHk/OwOqqXR+Do4pa2L9La+6xd5pPDb3/4kBCI9sCiDoI PabUIiMEm3KFBmp3wUf9MgtC5zwtj34lhpLSUyD0ihbm3yYe4L5zFPm6DUwmitg41txW IuiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9aISSy5Y6tM/5Mn3uS24TYyGdedLlI00cbNXlchHbQU=; fh=deqbsmF+WxCsy8NzbMNSMHZ2UCeA2rgCx7yPnSqubIk=; b=bf1oRfntSeFW4IXva4EECERRpGcGpYl4PW2Et+k+yqq/jEktTYTymdjrxGLT2J4zih sz8Q1GaSPC+cMQ08N3Us4GtTibCcMWBH4eRKtjtK7yKCzSAsi/KtWFAgQfWB/BGGGFOg MmejdObKKNITqT0QjwvxfoAWP5gYGD+WS8IW0yManF0etbIZ+gDBMiaTCV8fq+X7wlJW 7liDowtRpW5w9w0+8p/7OXe/IUYwA3K/HbgT9umODCzWCLZclGvP+9wrA2JLsGddQcXU sJPSHkd+NONNU+iUSfZsiPr1TQz5kVojx84ML8jx1G8LqUhsn0rDfOhkzPxI6oSqofFZ oPFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l2Xh1rws; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id 203-20020a6301d4000000b0057888936295si5218261pgb.767.2023.09.20.03.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 03:51:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l2Xh1rws; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id A88D682DEE6F; Wed, 20 Sep 2023 00:47:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233989AbjITHqt (ORCPT + 99 others); Wed, 20 Sep 2023 03:46:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234001AbjITHqU (ORCPT ); Wed, 20 Sep 2023 03:46:20 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9ACFE8 for ; Wed, 20 Sep 2023 00:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695195947; x=1726731947; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=9aISSy5Y6tM/5Mn3uS24TYyGdedLlI00cbNXlchHbQU=; b=l2Xh1rwslYrzpiC9dAqARlRahanGE3c9AzAnOMGswCW9Onjo00YJoWEY riLhZXvySb5whOa16Gqd85cl/3PWjg+dv5gjccARCr72sIm2idczr6gxf tbF6MOaAriHCxWa15WukMPOn7sJQk3j9WY4pWdwqr7NL0c8VVCG3uzcYg SpV1846pID3a3RsF91ci0MM4v1bF2ZJszvM3yCKWTjGJMYpOAK6NsYORx bzIRcU3WMRf2IBh5nb0uGyI3WUXMVu9XxAeWrMMsJQQ3uWe4xR1Un/G+h T2zaRFyEAi6kUFln8vQLG47jZeQOdpeVzC/cnDULhB74KJtWPvvaUMREs g==; X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="370468073" X-IronPort-AV: E=Sophos;i="6.02,161,1688454000"; d="scan'208";a="370468073" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2023 00:45:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="749789384" X-IronPort-AV: E=Sophos;i="6.02,161,1688454000"; d="scan'208";a="749789384" Received: from lingshan-mobl.ccr.corp.intel.com (HELO [10.93.14.5]) ([10.93.14.5]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2023 00:45:41 -0700 Message-ID: <1a2537e9-b70c-0d85-20f5-e8ef5c8a9bb8@intel.com> Date: Wed, 20 Sep 2023 15:45:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.15.1 Subject: Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg Content-Language: en-US To: Parav Pandit , "Chen, Jiqian" , "Michael S. Tsirkin" Cc: Gerd Hoffmann , Jason Wang , Xuan Zhuo , David Airlie , Gurchetan Singh , Chia-I Wu , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Robert Beckett , Mikhail Golubev-Ciuchea , "virtio-comment@lists.oasis-open.org" , "virtio-dev@lists.oasis-open.org" , "qemu-devel@nongnu.org" , "linux-kernel@vger.kernel.org" , Stefano Stabellini , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , "Deucher, Alexander" , "Koenig, Christian" , "Hildebrand, Stewart" , Xenia Ragiadakou , "Huang, Honglei1" , "Zhang, Julia" , "Huang, Ray" References: <20230919114242.2283646-1-Jiqian.Chen@amd.com> <20230919114242.2283646-2-Jiqian.Chen@amd.com> <20230919082802-mutt-send-email-mst@kernel.org> <701bb67c-c52d-4eb3-a6ed-f73bd5d0ff33@intel.com> <91c3e7ec-d702-ee61-c420-59ddc8dac6dc@intel.com> From: "Zhu, Lingshan" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 20 Sep 2023 00:47:10 -0700 (PDT) On 9/20/2023 3:32 PM, Parav Pandit wrote: > >> From: Zhu, Lingshan >> Sent: Wednesday, September 20, 2023 12:58 PM >> >> On 9/20/2023 3:10 PM, Parav Pandit wrote: >>>> From: Zhu, Lingshan >>>> Sent: Wednesday, September 20, 2023 12:37 PM >>>>> The problem to overcome in [1] is, resume operation needs to be >>>>> synchronous >>>> as it involves large part of context to resume back, and hence just >>>> asynchronously setting DRIVER_OK is not enough. >>>>> The sw must verify back that device has resumed the operation and >>>>> ready to >>>> answer requests. >>>> this is not live migration, all device status and other information >>>> still stay in the device, no need to "resume" context, just resume running. >>>> >>> I am aware that it is not live migration. :) >>> >>> "Just resuming" involves lot of device setup task. The device implementation >> does not know for how long a device is suspended. >>> So for example, a VM is suspended for 6 hours, hence the device context >> could be saved in a slow disk. >>> Hence, when the resume is done, it needs to setup things again and driver got >> to verify before accessing more from the device. >> The restore procedures should perform by the hypervisor and done before set >> DRIVER_OK and wake up the guest. > Which is the signal to trigger the restore? Which is the trigger in physical device when there is no hypervisor? > > In my view, setting the DRIVER_OK is the signal regardless of hypervisor or physical device. > Hence the re-read is must. Yes, as I said below, should verify by re-read. > >> And the hypervisor/driver needs to check the device status by re-reading. >>>> Like resume from a failed LM. >>>>> This is slightly different flow than setting the DRIVER_OK for the >>>>> first time >>>> device initialization sequence as it does not involve large restoration. >>>>> So, to merge two ideas, instead of doing DRIVER_OK to resume, the >>>>> driver >>>> should clear the SUSPEND bit and verify that it is out of SUSPEND. >>>>> Because driver is still in _OK_ driving the device flipping the SUSPEND bit. >>>> Please read the spec, it says: >>>> The driver MUST NOT clear a device status bit >>>> >>> Yes, this is why either DRIER_OK validation by the driver is needed or Jiqian's >> synchronous new register.. >> so re-read > Yes. re-read until set, Thanks. >