From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796062603; b=XieOF+8vc3Ago1eIumCCWfSZbwFDAOX6xrt567A5xzhTFDnch4rxqTctK1JkyFDezdx2 rnB6iNbKfwZbhIYifd6886+1z680T9GH9Y4ZT3rnlPxD6lBHmLeUXCuFtJwxzl3dikxOX dSK/sVe740DXnAsSSfjoQu/CDNjEJ/NqbVVoHZ3OmPHaSKrcBQ0FkAAeGWi9dOkTfT0ei 6QgJY3zWcqfjoFlA75lFwecDPYXoHR2psVX3BMOiwCBLUXIVCok27uQ9lz50sP45FoG9n jKfNR5BnunzumZdnwXWJJQi/DAOTTM1+EfteUFaVU379ePR+NuAE13cldb2JM1LT9SQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796062603; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=KPGQEbGrDFdY/Pl9uA47BRMTzCB/RJe9IYWExr6A2Xo=; b=KU1I2vhauQQMTHRXRz4FgWblOaLnqh5BPY/f1g5gDIWVJmrVF9jcK2MWBO5DZDRL+Kq9 ZVa54eGUzpCs93J+0vmkodNCbolTWdxpzU1QfuM1FgFblrs3WdHZK4mXidHobZRzyqVc8 OV5FdakjYhksy8HGQFTyq2Moew1PbD+ory9qT/tbyfvOqx5V2Tod4Z+AxTZB5EiPxdfG0 VBHhwEtJwETsfGDMjy0sWHYeEqbBy99KS3sLZjTjfm4bwc9/UHIAl1NeCMP2UzQ7EGIZ0 oIrhlUo+cIX9DZb1f18BkOgVX6755LOQMN3up/auqGIVqQk1M/7j91OyUvLm533PEKA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=T1G2OBsL; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B4B2606A31C for ; Mon, 30 Nov 2026 18:16:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=T1G2OBsL Received: by smtp.kernel.org (Postfix) with ESMTPSA id 524A01F0089A; Mon, 30 Nov 2026 18:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796062602; bh=KPGQEbGrDFdY/Pl9uA47BRMTzCB/RJe9IYWExr6A2Xo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=T1G2OBsLJLZsJ0aV2DZJjlOCrigEyMezwNAj4GnfRMx6o4jGP8R9xNKKfsv+d30rU rFm0NxRcaAmgqNFa7cRn39H0+uVimGHaKZ7PiUqF1HGYx6QSdmHEznBDD12A/ACLb+ z2rKTlqroa2hY04lFIqOJCSeIdkrRKVbe2aZtyZ9Pfb8eR14TKCYrOJQcMq0e+2iz1 vP8adm7uhdb3ZgQ6GP572uMTiHLjAcsKgFk7XmzNdvwjU4IFUKy2Ia+wT2K1HbOcBp lmx+4SsiMmitO3uUeCJ9BzfaCjXYi+nAIZpCgNl4mcJzW9kzg4aKtGyfEidtBiI/7p GRilZxW4Tq+HQ== Date: Mon, 30 Nov 2026 12:16:36 -0600 From: "Serge Hallyn (AMD)" To: Artem Bityutskiy Cc: Tony Lindgren , Paolo Bonzini , Sean Christopherson , Peter Xu , Fabiano Rosas , Jon Grimm , Pankaj Gupta , Tom Lendacky , Marc Zyngier , Oliver Upton , Steven Price , Anup Patel , Samuel Ortiz , Jakub =?utf-8?B?UsWvxb5pxI1rYQ==?= , =?iso-8859-1?Q?J=F6rg_R=F6del?= , Vishal Annapurve , Elena Reshetova , Kishen Maloor , Mika Westerberg , Peter Fang , Rick Edgecombe , Xiaoyao Li , Xu Yilun , kvm@vger.kernel.org Subject: Re: [RFC PATCH v2 2/4] KVM: x86: Add optional KVM_CAP_LIVE_MIGRATION and KVM_MIGRATE_CMD Message-ID: References: <20260831071304.762939-1-tony.lindgren@linux.intel.com> <20260831071304.762939-3-tony.lindgren@linux.intel.com> <74c6eec32fec9b7db75a8b4cd7f8e00d581eab5f.camel@gmail.com> X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <74c6eec32fec9b7db75a8b4cd7f8e00d581eab5f.camel@gmail.com> On Fri, Nov 27, 2026 at 10:33:40AM +0200, Artem Bityutskiy wrote: > On Mon, 2026-08-31 at 10:13 +0300, Tony Lindgren wrote: > > +struct kvm_migrate_cmd { > > + __u16 command; > > + __u16 flags; > > + __u32 reserved; > > + struct kvm_transfer_buffer buf; > > +}; > > In addition to dropping 'struct kvm_transfer_buffer', we need separate > input and output buffers. Reasons: > > - TDX requires them to be separate: using one buffer for both does not work > in corner cases such as update-while-setup. > - We can't assume other CoCo implementations can use the input buffer as > the output buffer either. Indeed. I figured that at least for AMD the sev driver would take care of that opaquely behind the KVM_MIGRATE_CMD API, but separate buffers is good for us, too. In September, you had mentioned Intel requiring output space for both output and metadata. The same is of course true for AMD (you can see the details for SNP_ARG_EXPORT_PAGE in chapter 6 at https://docs.amd.com/api/khub/documents/Gzue7GL~KH3204rrtW369g/content ) and I would imagine every implementation would export some metadata. So, do we actually want three buffers? If not, of course, userspace can just pass in a larger contiguous buffer for both, but perhaps it keeps things simpler and cleaner to separate them. > - It is also a cleaner API. > > So I'd like the next version to have two buffers, each with its own pointer > and size: one for input, one for output. > > Artem -serge