From nobody Mon Nov 17 09:48:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=nvidia.com ARC-Seal: i=1; a=rsa-sha256; t=1603451881; cv=none; d=zohomail.com; s=zohoarc; b=Jaz25us5s6xKURz54i+TRKvTRZxVBwcjcu0xXF6lFXurLZ3x7wqOoxWlXf6GqVtUecrLQTSlqECSRRCer1rL+ZlUiqUI6LsZ4Vxkb7c2T4abWMKg1soAsxB7gbAWPKuMyoZ+Hd+qZ8UzyqltVdPbEMHldw5fx6Wm41NT+tqH+lo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603451881; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YXNa3H8eNeL3Vmem7X3LxVv9sAfs1VFH6OWaXoloGWw=; b=L/3U7ywRYaOD8unRU+4wqeMIuXur9nFfreSlTl6lzAkiYTv1td4h2RbcW0oLaJ7sJec6+IFF2vjzkCPPEWttF0hUZYXoE59GHtSdNE2avSqhv8PXAsjcQTEeiO/GkjL021Ei7yvwrUO6j3//f+CbdiZihLABkS7kngna9O/RETM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1603451881301286.9644491022109; Fri, 23 Oct 2020 04:18:01 -0700 (PDT) Received: from localhost ([::1]:37534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVv56-0002qb-78 for importer@patchew.org; Fri, 23 Oct 2020 07:18:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVv2I-0000sq-CH for qemu-devel@nongnu.org; Fri, 23 Oct 2020 07:15:06 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:15317) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVv2D-0007Wb-Kj for qemu-devel@nongnu.org; Fri, 23 Oct 2020 07:15:06 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 23 Oct 2020 04:14:11 -0700 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 23 Oct 2020 11:14:49 +0000 Received: from kwankhede-dev.nvidia.com (172.20.13.39) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 23 Oct 2020 11:14:40 +0000 From: Kirti Wankhede To: , Subject: [PATCH v28 10/17] memory: Set DIRTY_MEMORY_MIGRATION when IOMMU is enabled Date: Fri, 23 Oct 2020 16:10:36 +0530 Message-ID: <1603449643-12851-11-git-send-email-kwankhede@nvidia.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1603449643-12851-1-git-send-email-kwankhede@nvidia.com> References: <1603449643-12851-1-git-send-email-kwankhede@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1603451651; bh=YXNa3H8eNeL3Vmem7X3LxVv9sAfs1VFH6OWaXoloGWw=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:X-NVConfidentiality:MIME-Version:Content-Type; b=qSMD5/KCRs98sQafvCwyDgAYdB9oCts2jkhtJLstRoetA8hwscyqIisCi7PCF6SBQ VINnoZ7NTzYp84vrnqzy1yVGt9tV30Q8HihySe3wu8g2tQi2QIYitCHbCwv0JYmtl1 +rAwgs5b6EaHM7iPL3VUXdwgNH/h//1vmDPUozNZ5Lmstt9acZ1hxC65JEbFth9FkJ IEUVSQB0rkC/lYvNeQlmDgFhWy4tuI7QNFaUmWcFx88rhImuD68gbamvwRoJx8Lf5f qaLdDhsG3i5mCGL3HtjDNz8fZOBbUE71P0eIUfQI4z3voEdU9A/BudTh+pNcXhV/vp /9bBVBAJHlulw== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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/23 06:23:18 X-ACL-Warn: Detected OS = Windows 7 or 8 [fuzzy] X-Spam_score_int: -70 X-Spam_score: -7.1 X-Spam_bar: ------- X-Spam_report: (-7.1 / 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, 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, 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, Kirti Wankhede , 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" mr->ram_block is NULL when mr->is_iommu is true, then fr.dirty_log_mask wasn't set correctly due to which memory listener's log_sync doesn't get called. This patch returns log_mask with DIRTY_MEMORY_MIGRATION set when IOMMU is enabled. Signed-off-by: Kirti Wankhede Reviewed-by: Yan Zhao --- softmmu/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softmmu/memory.c b/softmmu/memory.c index 403ff3abc99b..94f606e9d9d9 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -1792,7 +1792,7 @@ bool memory_region_is_ram_device(MemoryRegion *mr) uint8_t memory_region_get_dirty_log_mask(MemoryRegion *mr) { uint8_t mask =3D mr->dirty_log_mask; - if (global_dirty_log && mr->ram_block) { + if (global_dirty_log && (mr->ram_block || memory_region_is_iommu(mr)))= { mask |=3D (1 << DIRTY_MEMORY_MIGRATION); } return mask; --=20 2.7.0