Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796373337; b=AyI0tecSPFaWeYbeuVBu5dBXAj8/cAoOVkPlZByFP7dEvlbUntZREOf2gA9WAdyWjLoH yJPtJdt0NERvEE/xQ2dYL3PWf7XvdWrEzsEcCqr/K2G0Sr6ZjHYs9i+sMJurpvWJ/DxlR e9Ju6TTut3c+OXw3kl65p5JWZNLUa21xeMKfYPaRmyZ2i8eelTWJaPqbUhz/cTZseAPwc A4OWsmMzBTbnSsd5lxS3mY5KeMTo7S7mQV3km+LuihL2BBWFZJfQHTD7baDhbv2Dj7vmf pMfzvwbdEA2Zhd5ChC7n1L/QM6zDDf06oQYgRgix87fRkkPGxlMKfJG97znSEg6YPVQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796373337; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:Content-Transfer-Encoding:User-Agent:MIME-Version; bh=thcBWwRRTIKagPwJRD+ckK7HTj44hTrhHEkxFx6BRew=; b=tH7SzIEDLZJCYE5sun0csyTlw9GPVUb7klXR/t/5+nPNtkUtd8nsJdQFWzQ9QUwXmHj5 n9pSJnA0jqPg0U0kQquxAd38KUFUBM9KLt+Xx8oPykUrXaGUDnVLl5rlvrP75CYgznF9l t6JM6foohtYTBFUKIIulXM0V2y5mgkhGgXtT6REdIJcQPHvwg+iZllLeUGpsz5vx1Zf8t P9NZho3NqFcLX08g65sYQzuHH1AE6DKEBU4VMETg9NQWZqDnT3AVGJWmBN8uEyH+TBAGy J3cKkaKWjDNea6T/Cymt8aQr6AOy14atH90d7CdOoVG9cGMewxMiKQrB1dcIqPoKU4g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rQwv14u6; arc=none smtp.remote-ip=209.85.221.48 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED8FB606A322 for ; Fri, 4 Dec 2026 08:35:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ED8FB606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rQwv14u6 Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-4ac109a8a12so382122f8f.3 for ; Fri, 04 Dec 2026 00:35:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796373335; x=1796978135; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to:content-type; bh=thcBWwRRTIKagPwJRD+ckK7HTj44hTrhHEkxFx6BRew=; b=rQwv14u6RjyJBomI4FH3qLIF6GCHgBbZY08Y/ppYfPaMOAojSNFduEIQd+ZPWFTwSW qtJpsrnWvcSMWOX6QUFS79kZ3ud5bmew9NMIjtInjhBfLD1/37yncHKoeIUqSe96/oFO BIL363XodZ2Q8xB4j0iygoEFahITtKrvs4a0KrvXYo7/Yx66gXPKCZrP+AcLYbU0jArk eA6mdgxBOum4rKfjgCsDtOHxDpLaColcf37zWI7Uowry7xqLXdCJGYjzTnIjY03GAC47 MXPwSesslmOAN/zWUxcaojjzehPsu8NuFVZaWEKowGQ8mK8s+LLpJf0WDQ0MoeM9PglN 9Rqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796373335; x=1796978135; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=thcBWwRRTIKagPwJRD+ckK7HTj44hTrhHEkxFx6BRew=; b=L4Ujodig+trwX4aEiUq5xRZUm8J3VjJZ7/qNEjogoIoTrhheJPy/aD8jSefeczLQB0 1iFWmTtUK0+jjOrUdiS6JpoHyHr4mYLxiUpiwll8X9iHqsm8A+tOQcoHOY6Nao33ByR4 LVQX8eQ+BbDpAg0pL/AW4mCUHgMQQ/px7129oISOH1BVyFErzIlv6fO0o7+4UgBV2Zrb oZ7+6XvcJmLpY9s2bYcAXA70BX5O4h8O2PXvmMYfzGHs46qkeLIOFdBtDl+fWplGIZOU Uq4bXQUmvaAH/9i/jl40DHy2YRX48wyksRrA/tpYTWuQfQnr/EeyvqD8KeNf9FSj7zMf wI+Q== X-Forwarded-Encrypted: i=1; AL+hErF4BI3GfXYWxk6s9gEyNi9AQxIjDQI1xEDfKraQmwAokEAzaX0XpQWZT5iScs4CatT0FrU=@vger.kernel.org X-Gm-Message-State: APuU4Z8vExQyU7ob1BKQzzMloM3CVQUXeffppaQw5nGG8shbCqeAYoWF G4LPFe2XGbJjd1q3RRhrfOxiqzkKiyPy5fmH+fOXasrKSvMlDtbHnhDV X-Gm-Gg: AZFdTZfg7r/X4KlEYPiIK9GgkY+Eim2Fk/6TJUdrG281TlKvJb6KcHU74B+HfytOl9z UszuPVONg6yKu+zVUHvxYe49aQVdCbdvwhisLOAyhQElGElMVdlLBrxos8fcWUD5ulpe2bcjmUa tFEGsyDInJrVsLNYum1x0wPdyVg9Z5HEHt5QC8C/GoBm56/g0b3+FbU0gUFQsnoKv011Z+GKExM tx/Y8vgJ5qQ8HSKP6PBzwQApsc90Ek5Xoxy6Zee8Ysoh1nn9ZtzRuyyCmsq39yPy1lJ8XmpJuVX jSHF2ViIj1FNd3u8Tzw19NYQqolSesZhYjjFIEOcxTfPferYQYYLsDPVoVHLjQAy5bCIhLUbmB9 qtd3sw1+zkgZUm66IpBtcIjdRdQu3NlbD4qONkFvol+LLXtdG2Fx93U+wcjdoH1YF3pY+DuJ7J9 oolpvgsDz50BxPc0xrish7urVH6cOFYzDrwEfn1LcjG7/A3oSMAazBTgbmKJ5CT/f24BqVff5K+ OxmlVtbi9z6vFbMcJWr7oHzYSgnfh0ds7YlUW2r5zfSjB8IIVzWeuEKkUzw+kin4LPwL8RU8Agh TPr4Omgrjzo4NTAPvmwIy6sns8UYkyrw X-Received: by 2002:a05:6000:2313:b0:4a7:ed95:7c9f with SMTP id ffacd0b85a97d-4d1e909a62bmr2115554f8f.22.1796373335067; Fri, 04 Dec 2026 00:35:35 -0800 (PST) Received: from [10.245.244.227] ([134.191.227.48]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d1738cfb80sm3889971f8f.36.2026.12.04.00.35.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 00:35:34 -0800 (PST) Message-ID: <624484155e54df363cf6e537a060fa860edbc231.camel@gmail.com> Subject: Re: Negotiation Model From: Artem Bityutskiy To: "Serge Hallyn (AMD)" Cc: Mathias Brossard , Peter Xu , Tony Lindgren , Kishen Maloor , "Serge E. Hallyn" , Paolo Bonzini , Sean Christopherson , Fabiano Rosas , Jon Grimm , Pankaj Gupta , Tom Lendacky , Marc Zyngier , Oliver Upton , Steven Price , Anup Patel , Samuel Ortiz , Jakub =?UTF-8?Q?R=C5=AF=C5=BEi=C4=8Dka?= , =?ISO-8859-1?Q?J=F6rg_R=F6del?= , Vishal Annapurve , Elena Reshetova , Kai Huang , Mika Westerberg , Peter Fang , Rick Edgecombe , Xiaoyao Li , Xu Yilun , "kvm@vger.kernel.org" , "David.Kaplan@amd.com" , "tycho@kernel.org" , "Adam, Mahmoud" , Daniil Egranov Date: Fri, 04 Dec 2026 10:35:30 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.2 (3.60.2-3.fc44) 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 On Thu, 2026-12-03 at 10:55 -0600, Serge Hallyn (AMD) wrote: > On Wed, Dec 02, 2026 at 03:31:52PM +0200, Artem Bityutskiy wrote: >=20 > > - Direct negotiation: the platform security component (e.g. the TDX > > module) negotiates with its peer itself. QEMU drives it with > > KVM_MIGRATE_NEGOTIATE, relays opaque blobs between the source and > > destination, and provides an attestation quote when asked. > >=20 > > - Agent negotiation: negotiation agents on the source and destination > > negotiate with each other, then install the migration keys into the > > platform security component. QEMU of the migrated guest does not > > take part and does not call KVM_MIGRATE_NEGOTIATE. >=20 > Oh. FWIW I had assumed that for agent negotiation, qemu would still driv= e > the negotiation over its migration buffer using KVM_MIGRATE_NEGOTIATE > steps, and the hypervisor through the platform would communicate with > the agent. Guess that's kind of silly. But it was a simple way to > allow the qemu buffer to be used for it, so the MAs dont' have to > initiate their own connection. Hmm, actually there are 2 separate aspects here. 1. Do agents have their own network, or does their negotiation traffic go via the QEMU handshake transport? I assumed the former, but indeed the latter should be possible too. 2. Whether agent negotiation is initiated via KVM_MIGRATE_NEGOTIATE. If agents are separate VMs, the role of KVM would be just to relay the "negotiate now" request from QEMU to the agent VM. Unless this is absolutely required by the security model (which does not seem to be the case), I'd say KVM does not need to be involved. >=20 > > # The negotiation phase model > >=20 > > ## Direct negotiation > >=20 > > QEMU calls KVM_MIGRATE_NEGOTIATE in a loop on both the source and the > > destination. Each call returns what QEMU should do next: > >=20 > > - send this blob to the peer > > - provide an attestation quote > > - done. >=20 > And "cancel/reject" ? Indeed. So first of all, the secure platform can reject migration for many reasons, like a failed migration policy check, or a bad attestation quote. I guess this is the reject: the ioctl (e.g. KVM_MIGRATE_NEGOTIATE) returns a generic error code + a platform specific status. And second, QEMU/VMM may decide to cancel, and that's the KVM_MIGRATE_ABORT ioctl. I see it as a generic abort ioctl, which knows how to abort on this specific platform, and at the current stage of migration. In the TDX case, an abort during the negotiation phase requires the TDH.MIG.SETUP.ABORT seamcall. But a late abort, after the source generated the start token, requires an abort token from the destination. AMD ARG seems to have the same concept. I assume the same KVM_MIGRATE_ABORT ioctl can work for all situations. It can return a "deliver me the abort token" exit code on the source, and it can be used to request the abort token on the destination. I need to think it through more carefully, but this is the high-level vision. > > The QEMU<->agent API is not part of the KVM uAPI. >=20 > So, if every platform is going to have such an API, do we want to > have a separate conversation on qemu-devel about a platform agnostic > API for that? Yeah, it probably belongs to qemu-devel, not here. I did not really think about the agent negotiation scenario in detail, because we were not plannin= g to implement the MigTD support. But I am open to a discussion on this too. Thanks! Artem.