From nobody Sat Feb 7 10:50:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1589853389; cv=none; d=zohomail.com; s=zohoarc; b=Nx37DwMASKf4ZJrq5zfdcsiN98PtI6uVOpTfsjJZZvgp0HdlD0zW/I4fPMXflRWnUw0Mg3BN3ABY5Aw9aKxzieyYchAwY9EvL+688RWPD5dKVP/xso9pmcR6R1QG9tuia9HPaRPj9gibl75XQX9JpdU7ZOfHrGseaA79CyeRiac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589853389; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RY6wcLegoM0K/cf+d7rR6BE972Bl6q9Nr9kajAEhtQU=; b=ar1bOiH6I9DbXUV64qA1SLAL0xI1jxkIEve5EuZuR377vxu+FWewDdDcjDhem+aCJdGtS147UfAj93ZaaKVc6M2E2ch6weSeI13zG/TO8WtJWkAK0EH3XgsoZVOpOgxPMvAkAy+Y2ZxsR8NCO3o1jgDOKMpswXIITasKOqu9loY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1589853389362196.0475797931665; Mon, 18 May 2020 18:56:29 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jarU7-00009H-8o; Tue, 19 May 2020 01:55:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jarU5-00009A-LC for xen-devel@lists.xenproject.org; Tue, 19 May 2020 01:55:57 +0000 Received: from mail-qt1-x842.google.com (unknown [2607:f8b0:4864:20::842]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id deb56f9e-9973-11ea-ae69-bc764e2007e4; Tue, 19 May 2020 01:55:52 +0000 (UTC) Received: by mail-qt1-x842.google.com with SMTP id x12so9905710qts.9 for ; Mon, 18 May 2020 18:55:52 -0700 (PDT) Received: from shine.lan ([2001:470:8:67e:e463:db9c:c6eb:4544]) by smtp.gmail.com with ESMTPSA id q2sm9731898qkn.116.2020.05.18.18.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 18:55:51 -0700 (PDT) X-Inumbo-ID: deb56f9e-9973-11ea-ae69-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RY6wcLegoM0K/cf+d7rR6BE972Bl6q9Nr9kajAEhtQU=; b=SsM8Xfz9X8ftXAmMO3K2D+HZByZc98cziQKaRFGUs1Gu/T9Yph4QEuD9FtYMPzP6IW CVpPOBI3oVZpocFP4HSHXUjDV+lJQNVOVneFVYzhpEE0gGdm6ihTFxmLOoe7ObFKvwVU 2ovyorxvRYxOICjJOgIm+11kP77OwYHLvOt9JIrWs08Er1/yQgBYXvzttP+bCv41R+UB 5p7RibXTXL24ezP1VRbODzk7dKy0g9HjkbFuvNh1iG7/2SAOFOlOjOWIxsp1LZRDWkz3 mLXAUzAWAn+HYbPe3muVnK+/MR7Xp+yhG106aU5cCkumMRVGlGOnXXpcmwyRhSDqDgkT 34dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RY6wcLegoM0K/cf+d7rR6BE972Bl6q9Nr9kajAEhtQU=; b=HhbKefTGFbselbj6QdKWhO9YrWpEdTpv0puqErlV39ABv+Dh26fWI4Srm7jrv70wz3 AD6oQ9fHmoGGNHIsN701v7sZm0sXTRF0xsHBSSARAvgWVGBNUjai5/VkCa1DJIAQe0f2 VuZKA9XJ54UB9LzJsdSwpuV85qrCmEKgMKGF8EKY98BBCo2lpyRIZiIIt0tO/NeWEDa5 cWCmShimiz234IOPUqBMWXnj765IgV+jemdKDwwyoSIam2qjjXmgJmlXwrOYkJ63PmWh didNQ44w/MLXlZK1vyfBSTGVmi+Hlehytkk4a5xLXNHhRQKbJrGrfQ/6yaTprDIcDQ8u 83Tg== X-Gm-Message-State: AOAM533sV5JUX+mHwPUGUp4Wcw3XHgvWX0wsoFfqBCJeFCh5ka9DvHUh m70Jf/3koun7BqcTO5sHXqDxHeRX X-Google-Smtp-Source: ABdhPJz9SwvFInDwhZCq7+sLwCbi3noQSsm8AYUsROaamQ7COBgQpKKaYKmnKgTpCzzQWAnO08ED/w== X-Received: by 2002:ac8:554c:: with SMTP id o12mr18747723qtr.89.1589853351842; Mon, 18 May 2020 18:55:51 -0700 (PDT) From: Jason Andryuk To: xen-devel@lists.xenproject.org Subject: [PATCH v7 02/19] Document ioemu Linux stubdomain protocol Date: Mon, 18 May 2020 21:54:46 -0400 Message-Id: <20200519015503.115236-3-jandryuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200519015503.115236-1-jandryuk@gmail.com> References: <20200519015503.115236-1-jandryuk@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Jason Andryuk , Andrew Cooper , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , George Dunlap , Jan Beulich , Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marek Marczykowski-G=C3=B3recki Add documentation for upcoming Linux stubdomain for qemu-upstream. Signed-off-by: Marek Marczykowski-G=C3=B3recki Signed-off-by: Jason Andryuk Acked-by: Ian Jackson --- Changes in v6: - Add Acked-by: Ian Jackson - Replace dmargs with dm-argv for xenstore directory - Explain $STUBDOM_RESTORE_INCOMING_ARG for -incoming restore argument --- docs/misc/stubdom.txt | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/docs/misc/stubdom.txt b/docs/misc/stubdom.txt index 64c77d9b64..c717a95d17 100644 --- a/docs/misc/stubdom.txt +++ b/docs/misc/stubdom.txt @@ -75,6 +75,58 @@ Defined commands: - "running" - success =20 =20 +Toolstack to Linux ioemu stubdomain protocol +-------------------------------------------- + +This section describe communication protocol between toolstack and +qemu-upstream running in Linux stubdomain. The protocol include +expectations of both stubdomain, and qemu. + +Setup (done by toolstack, expected by stubdomain): + - Block devices for target domain are connected as PV disks to stubdomain, + according to configuration order, starting with xvda + - Network devices for target domain are connected as PV nics to stubdomai= n, + according to configuration order, starting with 0 + - [not implemented] if graphics output is expected, VFB and VKB devices a= re set for stubdomain + (its backend is responsible for exposing them using appropriate protocol + like VNC or Spice) + - other target domain's devices are not connected at this point to stubdo= main + (may be hot-plugged later) + - QEMU command line is stored in + /vm//image/dm-argv xenstore dir, each argument as separate= key + in form /vm//image/dm-argv/NNN, where NNN is 0-padded argu= ment + number + - target domain id is stored in /local/domain//target xenstor= e path +?? - bios type is stored in /local/domain//hvmloader/bios + - stubdomain's console 0 is connected to qemu log file + - stubdomain's console 1 is connected to qemu save file (for saving state) + - stubdomain's console 2 is connected to qemu save file (for restoring st= ate) + - next consoles are connected according to target guest's serial console = configuration + +Environment exposed by stubdomain to qemu (needed to construct appropriate= qemu command line and later interact with qmp): + - target domain's disks are available as /dev/xvd[a-z] + - console 2 (incoming domain state) must be connected to an FD and the co= mmand + line argument $STUBDOM_RESTORE_INCOMING_ARG must be replaced with fd:$F= D to + form "-incoming fd:$FD" + - console 1 (saving domain state) is added over QMP to qemu as "fdset-id = 1" (done by stubdomain, toolstack doesn't need to care about it) + - nics are connected to relevant stubdomain PV vifs when available (qemu = -netdev should specify ifname=3D explicitly) + +Startup: +1. toolstack starts PV stubdomain with stubdom-linux-kernel kernel and stu= bdom-linux-initrd initrd +2. stubdomain initialize relevant devices +3. stubdomain starts qemu with requested command line, plus few stubdomain= specific ones - including local qmp access options +4. stubdomain starts vchan server on /local/domain//device-mod= el//qmp-vchan, exposing qmp socket to the toolstack +5. qemu signal readiness by writing "running" to /local/domain//device-model//state xenstore path +6. now device model is considered running + +QEMU can be controlled using QMP over vchan at /local/domain//= device-model//qmp-vchan. Only one simultaneous connection is sup= ported and toolstack needs to ensure that. + +Limitations: + - PCI passthrough require permissive mode + - only one nic is supported + - at most 26 emulated disks are supported (more are still available as PV= disks) + - graphics output (VNC/SDL/Spice) not supported + =20 PV-GRUB =3D=3D=3D=3D=3D=3D=3D --=20 2.25.1