Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1186460rdg; Fri, 13 Oct 2023 12:58:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRB2fx0dWzkOZDkNheUk8N0S2/gfGtrZ9tmvvsPNqVwx84fYmRiSnqfYaGyDUrM11GwyPQ X-Received: by 2002:a05:6a21:2723:b0:16b:f8f0:1c0c with SMTP id rm35-20020a056a21272300b0016bf8f01c0cmr16523633pzb.0.1697227101377; Fri, 13 Oct 2023 12:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697227101; cv=none; d=google.com; s=arc-20160816; b=Adb92gwz28burNIP59NrMMnS0fO+tnRI2UBMT8eW6ENFCmk1KklgheVorTdiOWppSB 7MV6hqF7NupcXIKuIentIptSZssbz/A4wRCgrvIR7CJPWZrvjZ5Ms6gMqJ5Fc8/6xiXY bbXJOtYpuss+BfMokDEDGvKZ1SN3vPqcDSkoaHIws5ISv/AguK9LNEsMemy4qJMD2L/c Gs/wfR6afFGI+6iMFxS0Ga+hInZQBOj98UXQ6EEqWXoIx8af4HolnI7oZK/8vQJefdih kn2DeFIrpVdHuGbqtKYztCqmOMehrUIOqWUYZ2JfEy4Fry0AoK38RQeFKjLV5v8nsqZC CQMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ChxwyGqYyTrVtmpYs+W8xWj0pmQUAOAJISxRBQDY6Oc=; fh=+Cb2XQ2PA67VLAGJa+jxW1LjaBXcHfLinB2fMRnx8lg=; b=TUoW17vzkJz+SwizjBQ1GMIgs/XltLQ21L/GIUPwS2qurs0aftl18IUwZHWtEiHhMh EQ8e7VBfvBEUEFP2BjVGlSQ7roQ0KrhC3wsxq8itbG10DqXJVLf7QAl1E1NrElzXiNT5 1dBzynzHjAQYV1h3wSf/Ox6SWeDyZY6mqThi85MbT2dv5PdL2O0G2PVDE4bC5JdM5MKe GVwHKZg+sZo+GIfoveNt1h12kiw6zaP/exLHB4qlVvNj4aaOT5lznSLYnKFoa/lV0y4J pf1L3cR+R1nZnQvfP0BsmrWg6uZfs1hx98GR4P4k5FSYoqF2nHW4FVTDTA119xwMLLyt Byxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SOahBSt8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x5-20020a654145000000b00578afd89ba6si4834786pgp.457.2023.10.13.12.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 12:58:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SOahBSt8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 92BD9834821F; Fri, 13 Oct 2023 12:58:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231922AbjJMT54 (ORCPT + 99 others); Fri, 13 Oct 2023 15:57:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231886AbjJMT5z (ORCPT ); Fri, 13 Oct 2023 15:57:55 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAD9F95 for ; Fri, 13 Oct 2023 12:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697227027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ChxwyGqYyTrVtmpYs+W8xWj0pmQUAOAJISxRBQDY6Oc=; b=SOahBSt8mftpotTnoJCLk6NQClEyyEJljkONj8xnE6IS3odRlV1hawy0PiMnf/zVHDV22q NQHQIMkbQdrSF4MMpIIINxlvyZ/3RKtMVLQM1MJAw0mMmr0epupQB+blbTx4/xi2WsXzu/ I3BE2zdk78UF3AoAfi0Xbjbl6cpk4fw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-357-EesnMxLINtKyF73qNaYtHA-1; Fri, 13 Oct 2023 15:57:06 -0400 X-MC-Unique: EesnMxLINtKyF73qNaYtHA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F4028185A7B4; Fri, 13 Oct 2023 19:57:05 +0000 (UTC) Received: from omen.home.shazbot.org (unknown [10.22.10.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82F3B40C6CA0; Fri, 13 Oct 2023 19:57:05 +0000 (UTC) From: Alex Williamson To: alex.williamson@redhat.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, clg@redhat.com Subject: [PATCH 0/2] vfio/mtty: Add migration support Date: Fri, 13 Oct 2023 13:56:51 -0600 Message-Id: <20231013195653.1222141-1-alex.williamson@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 13 Oct 2023 12:58:18 -0700 (PDT) We've seen a request for CI and development to have access to migratable vfio devices without any specific hardware requirements. One way to do that is to enable migration support on the mtty mdev sample driver, as done here. This device is particularly easy to migrate because it doesn't actually do DMA, or in fact much of anything. Therefore we can claim P2P and dirty logging as well. PRE_COPY support is also included in a similar fashion to hisi_acc. This provides early compatibility testing, which is probably over-done, but perhaps illustrates good practice with matching data stream magic, versioning, and feature flags. These might later be used for backwards compatibility, particularly since I'm not positive that copying the struct serial_port between source and destination is sufficient. Along the way, testing migration where the source and target are incompatible, I fixed an eventfd leak. Thanks, Alex Alex Williamson (2): vfio/mtty: Fix eventfd leak vfio/mtty: Enable migration support samples/vfio-mdev/mtty.c | 610 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 605 insertions(+), 5 deletions(-) -- 2.40.1