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=-13.2 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 6DB47C2D0A3 for ; Mon, 26 Oct 2020 13:50:53 +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 D105C21D42 for ; Mon, 26 Oct 2020 13:50:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="SnHw47Kv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D105C21D42 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:32860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kX2tf-0004Iz-Qo for qemu-devel@archiver.kernel.org; Mon, 26 Oct 2020 09:50:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kX2s8-000332-Tk for qemu-devel@nongnu.org; Mon, 26 Oct 2020 09:49:16 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:16093) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kX2s6-0001E1-LO for qemu-devel@nongnu.org; Mon, 26 Oct 2020 09:49:16 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 26 Oct 2020 06:49:17 -0700 Received: from [10.40.102.184] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 26 Oct 2020 13:48:55 +0000 Subject: Re: [PATCH v29 05/17] vfio: Add VM state change handler to know state of VM To: Alex Williamson References: <1603704987-20977-1-git-send-email-kwankhede@nvidia.com> <1603704987-20977-6-git-send-email-kwankhede@nvidia.com> <20201026070056.42bb04de@w520.home> X-Nvconfidentiality: public From: Kirti Wankhede Message-ID: Date: Mon, 26 Oct 2020 19:18:51 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20201026070056.42bb04de@w520.home> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1603720157; bh=b8YMHIcDj5K1y1w6xfBiRQwKIz4ZMqfKKDtpWZv0QEw=; h=Subject:To:CC:References:X-Nvconfidentiality:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=SnHw47KvNz48ovU1So+FygOk9eU2/VSKe1wH00isWiyXd4ybkQggoft1KHY/MxDjt /fFhwEhDKOTo6ovOtw3CbKDGelrmVNeNCjAL+OBmdfwtuLlM5Z79PbJG619NiY9vmZ EW8EvJfRae2rQayjcpKDP9iZ5MAkXdd8BYIl3eQY9J56/lhE6MGJir20k8SuxliDzL 5HwDFv/+GDnM4T9PuhSU1d9Okb6Jf7ZKE2Uxh+gH/dmJN1sFq8lTq1eObKtQAoourx RLsonkziwjJHrKMraNoEbazNFIKUSfxoe8RNq8Eni6/3i5uJtN1jqJDtnQhP1cZgY/ rZW5GKlFYnHeQ== Received-SPF: pass client-ip=216.228.121.64; envelope-from=kwankhede@nvidia.com; helo=hqnvemgate25.nvidia.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/26 09:49:13 X-ACL-Warn: Detected OS = Windows 7 or 8 [fuzzy] X-Spam_score_int: -92 X-Spam_score: -9.3 X-Spam_bar: --------- X-Spam_report: (-9.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-2.167, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: cohuck@redhat.com, cjia@nvidia.com, zhi.wang.linux@gmail.com, aik@ozlabs.ru, Zhengxiao.zx@Alibaba-inc.com, shuangtai.tst@alibaba-inc.com, qemu-devel@nongnu.org, peterx@redhat.com, eauger@redhat.com, artemp@nvidia.com, yi.l.liu@intel.com, quintela@redhat.com, ziye.yang@intel.com, armbru@redhat.com, mlevitsk@redhat.com, pasic@linux.ibm.com, felipe@nutanix.com, zhi.a.wang@intel.com, mcrossley@nvidia.com, kevin.tian@intel.com, yan.y.zhao@intel.com, dgilbert@redhat.com, changpeng.liu@intel.com, eskultet@redhat.com, Ken.Xue@amd.com, jonathan.davies@nutanix.com, pbonzini@redhat.com, dnigam@nvidia.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 10/26/2020 6:30 PM, Alex Williamson wrote: > On Mon, 26 Oct 2020 15:06:15 +0530 > Kirti Wankhede wrote: > >> VM state change handler is called on change in VM's state. Based on >> VM state, VFIO device state should be changed. >> Added read/write helper functions for migration region. >> Added function to set device_state. >> >> Signed-off-by: Kirti Wankhede >> Reviewed-by: Neo Jia >> Reviewed-by: Dr. David Alan Gilbert >> Reviewed-by: Cornelia Huck >> --- >> hw/vfio/migration.c | 158 ++++++++++++++++++++++++++++++++++++++++++ >> hw/vfio/trace-events | 2 + >> include/hw/vfio/vfio-common.h | 4 ++ >> 3 files changed, 164 insertions(+) >> >> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c >> index fd7faf423cdc..65ce735d667b 100644 >> --- a/hw/vfio/migration.c >> +++ b/hw/vfio/migration.c > [snip] >> @@ -64,6 +216,9 @@ static int vfio_migration_init(VFIODevice *vbasedev, >> ret = -EINVAL; >> goto err; >> } >> + >> + migration->vm_state = qemu_add_vm_change_state_handler(vfio_vmstate_change, >> + vbasedev); >> return 0; >> >> err: > > Fails to build, @migration is not defined. We could use > vbasedev->migration or pull defining and setting @migration from patch > 06. Thanks, > Pulling and setting migration from patch 06 seems better option. Should I resend patch 5 & 6 only? Thanks, Kirti