From nobody Sun Nov 24 21:48:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=reject dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1720785008; cv=none; d=zohomail.com; s=zohoarc; b=EGZyi2ClZ9NFUyqgJywI/VSZ0pbF2jVZfBXm1aDoBCTJgI323cjF6u1IAC+80S2oRTAKszUTltLg4toLL2rlOw+AaKLTr4fCQ7JAUmn5RjFT4tekUwhl/UIGmL2C+RqVweHxRhV5GA2aN0ReNHe7Hu8roUOX1Cf8kMKCP3OKEvI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720785008; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=F9qEY422bL/t8pTSoUsLhV9ChrXPulROskOlqOD/lAQ=; b=MtzoyvhwQbRQTXB6pIciaSrjupViZZ+zJVbjLXpgNWTnLjxtTfrOi1hxUYOXSOQzsRIrJYxeByqMAnT7tz6ia7HTpGEAfF3eiXNTiGIkXA5WYfbYd5JsuDHayqLdVNTD0jxR3qXIHDA3QLnIr5QH3QVtlxao3ecWa/eq/iI3JTM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720785008360925.8974179715476; Fri, 12 Jul 2024 04:50:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSEkp-0006IO-4d; Fri, 12 Jul 2024 07:47:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sSEke-0005dD-Cz for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:47:48 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sSEkc-0007ro-Ox for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:47:48 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46CBhSQa016077; Fri, 12 Jul 2024 11:47:44 GMT Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 406wknuq6r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2024 11:47:44 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46CB9scu022104; Fri, 12 Jul 2024 11:47:43 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 409vv3pqan-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2024 11:47:43 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 46CBlCCo008041; Fri, 12 Jul 2024 11:47:42 GMT Received: from joaomart-mac.nl.oracle.com (dhcp-10-175-0-59.vpn.oracle.com [10.175.0.59]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 409vv3ppxv-12; Fri, 12 Jul 2024 11:47:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=corp-2023-11-20; bh=F 9qEY422bL/t8pTSoUsLhV9ChrXPulROskOlqOD/lAQ=; b=k4D+W686jTKgJpAnF bdd4Mio3Bsn9v6Od+fACOnib1hU0BWO591ClnZ9MHJ2C7krqBt8HrgdEiKDTvcXg MuOKSrT1Qhwsm0pVyOz8EcxMZaPvrtZBFTdDLBs3hSlvaiv7E5x4PpVz1B/yb7zn VO4zYVuwYv2ltudIvhi8mJbLRbE+ZZTmvEtqlyHGTGmaHhK2vLDUtB3Tagps6c12 PVfkj61OfDtMz6caKGfY+tofVRADNfCzMFhK4igHB/3iBg8a97xvW5V40+2kpKvk Xrv1AhmMpBKzBfVQxWrpOP3lNwoydCSb+7Lqwmmfbvmz5coSskeLEcKnYxck4m4o QOd6A== From: Joao Martins To: qemu-devel@nongnu.org Cc: Yi Liu , Eric Auger , Zhenzhong Duan , Alex Williamson , Cedric Le Goater , Jason Gunthorpe , Avihai Horon , Joao Martins Subject: [PATCH v4 11/12] vfio/migration: Don't block migration device dirty tracking is unsupported Date: Fri, 12 Jul 2024 12:47:03 +0100 Message-Id: <20240712114704.8708-12-joao.m.martins@oracle.com> In-Reply-To: <20240712114704.8708-1-joao.m.martins@oracle.com> References: <20240712114704.8708-1-joao.m.martins@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-12_08,2024-07-11_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=801 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2407120080 X-Proofpoint-GUID: Ch8nmwXqntVhXG834lVTThQfRORlh-4N X-Proofpoint-ORIG-GUID: Ch8nmwXqntVhXG834lVTThQfRORlh-4N 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=205.220.177.32; envelope-from=joao.m.martins@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1720785009613116600 Content-Type: text/plain; charset="utf-8" By default VFIO migration is set to auto, which will support live migration if the migration capability is set *and* also dirty page tracking is supported. For testing purposes one can force enable without dirty page tracking via enable-migration=3Don, but that option is generally left for testing purposes. So starting with IOMMU dirty tracking it can use to acomodate the lack of VF dirty page tracking allowing us to minimize the VF requirements for migration and thus enabling migration by default for those too. Signed-off-by: Joao Martins --- hw/vfio/migration.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 34d4be2ce1b1..ce3d1b6e9a25 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -1036,7 +1036,8 @@ bool vfio_migration_realize(VFIODevice *vbasedev, Err= or **errp) return !vfio_block_migration(vbasedev, err, errp); } =20 - if (!vbasedev->dirty_pages_supported) { + if (!vbasedev->dirty_pages_supported && + !vbasedev->bcontainer->dirty_pages_supported) { if (vbasedev->enable_migration =3D=3D ON_OFF_AUTO_AUTO) { error_setg(&err, "%s: VFIO device doesn't support device dirty track= ing", --=20 2.17.2