From patchwork Mon May 18 01:13:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jason Andryuk X-Patchwork-Id: 11554487 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92ED1912 for ; Mon, 18 May 2020 01:16:58 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6E6E62067D for ; Mon, 18 May 2020 01:16:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eSkNWqdb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E6E62067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jaUMh-0008SL-Cl; Mon, 18 May 2020 01:14:47 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jaUMg-0008SG-QU for xen-devel@lists.xenproject.org; Mon, 18 May 2020 01:14:46 +0000 X-Inumbo-ID: f47536d6-98a4-11ea-b9cf-bc764e2007e4 Received: from mail-qt1-x842.google.com (unknown [2607:f8b0:4864:20::842]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f47536d6-98a4-11ea-b9cf-bc764e2007e4; Mon, 18 May 2020 01:14:43 +0000 (UTC) Received: by mail-qt1-x842.google.com with SMTP id p12so6807444qtn.13 for ; Sun, 17 May 2020 18:14:43 -0700 (PDT) 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=Y63NCLIHxjj8BP4Xs3EPNGxMJKsqwIK/ULA13gyh9ao=; b=eSkNWqdbswfyDAji7MFKscHPl69O8wGmYPQmhFSpff0pcoiWJUbVrg3VRBpFW2kfno 8fZ3kAE2AWhyj5m0TZtbB0rKrLY1fgkIYUTdAhbYERSdsuuTYDCCdYNiUTl/F/2RlEL9 nYyXOAgv3bXQRJPCfjLMejeteMUjOa8l/BDh5IT/16ory2Gw7B5Mhd6uyy9R0gSTqrC/ ZZz6L8Honi6qGiqsvGJSLRLnT8ssqbBU853PdYXFMbTcEMQlZ4ED4Sh5QQI1NzCXRgQv PLH1mEAN5TSG6VAVZDHjJpaSZfu1WP7QMObtk3hEJXwV3dfQbjSfkBLuvQ6BFeEOT7i1 N7Ig== 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=Y63NCLIHxjj8BP4Xs3EPNGxMJKsqwIK/ULA13gyh9ao=; b=TFTKogHbyLbDdvhcTEpxTzGsSxeQMNd/X+oM9oYOPF+zSI6yHepB8AYE8rqEvz42J0 2EDv1S1K4z4LxuQA4tewOYQIcMX1tBdYR8hep32a1IHDxzqS7usjNHyYNrQdubq7g49j 0ms2k/Mqr4/7N0NTOwIaLkury+w1NnfMCAcS27AKfGXu38CnVLpYlPxaxhZAr6i3ZzOs 1s2IxoJZmZ+MMUuLeEkMKpXcChC4qQv8yajDTDLrL34RoEVuUSxa8TUN3EY3PtW8kK46 QTL1dnAPnEeGrDZjUajfWWvhaqj06PmPUSpjJkZxNGOLpKEqpTnyf+jTzJ3Xd8lbf7fu +xQw== X-Gm-Message-State: AOAM530dPUCuT+rUPgA0icMg6+q4wEJ1UTXGBgG8w6XdOOn/KDe6wdjd s5ITgKxUJIMAcM3XRl7omLrAdsQu X-Google-Smtp-Source: ABdhPJzgBKtNE4UuZ+JccVPVxVfMOGB9LaK0mJCPZqbJO7XGSDTxnkecYW5ina97e/LH7ZQzpeVZoQ== X-Received: by 2002:ac8:4741:: with SMTP id k1mr14158535qtp.250.1589764482565; Sun, 17 May 2020 18:14:42 -0700 (PDT) Received: from shine.lan ([2001:470:8:67e:ec68:c92e:af5a:2d3a]) by smtp.gmail.com with ESMTPSA id l2sm7072864qkd.57.2020.05.17.18.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2020 18:14:41 -0700 (PDT) From: Jason Andryuk To: xen-devel@lists.xenproject.org Subject: [PATCH v6 01/18] Document ioemu MiniOS stubdomain protocol Date: Sun, 17 May 2020 21:13:36 -0400 Message-Id: <20200518011353.326287-2-jandryuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200518011353.326287-1-jandryuk@gmail.com> References: <20200518011353.326287-1-jandryuk@gmail.com> MIME-Version: 1.0 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_Marczykowski-G?= =?utf-8?q?=C3=B3recki?= , George Dunlap , Jan Beulich , Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Marek Marczykowski-Górecki Add documentation based on reverse-engineered toolstack-ioemu stubdomain protocol. Signed-off-by: Marek Marczykowski-Górecki Signed-off-by: Jason Andryuk Acked-by: Ian Jackson --- Changes in v6: - Add Acked-by: Ian Jackson --- docs/misc/stubdom.txt | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/docs/misc/stubdom.txt b/docs/misc/stubdom.txt index 882a18cab4..64c77d9b64 100644 --- a/docs/misc/stubdom.txt +++ b/docs/misc/stubdom.txt @@ -23,6 +23,59 @@ and https://wiki.xen.org/wiki/Device_Model_Stub_Domains for more information on device model stub domains +Toolstack to MiniOS ioemu stubdomain protocol +--------------------------------------------- + +This section describe communication protocol between toolstack and +qemu-traditional running in MiniOS stubdomain. The protocol include +expectations of both qemu and stubdomain itself. + +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 stubdomain, + according to configuration order, starting with 0 + - if graphics output is expected, VFB and VKB devices are 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 stubdomain + (may be hot-plugged later) + - QEMU command line (space separated arguments) is stored in + /vm//image/dmargs xenstore path + - target domain id is stored in /local/domain//target xenstore 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 state) + - next consoles are connected according to target guest's serial console configuration + +Startup: +1. PV stubdomain is started with ioemu-stubdom.gz kernel and no initrd +2. stubdomain initialize relevant devices +3. stubdomain signal readiness by writing "running" to /local/domain//device-model//state xenstore path +4. now stubdomain is considered running + +Runtime control (hotplug etc): +Toolstack can issue command through xenstore. The sequence is (from toolstack POV): +1. Write parameter to /local/domain//device-model//parameter. +2. Write command to /local/domain//device-model//command. +3. Wait for command result in /local/domain//device-model//state (command specific value). +4. Write "running" back to /local/domain//device-model//state. + +Defined commands: + - "pci-ins" - PCI hot plug, results: + - "pci-inserted" - success + - "pci-insert-failed" - failure + - "pci-rem" - PCI hot remove, results: + - "pci-removed" - success + - ?? + - "save" - save domain state to console 1, results: + - "paused" - success + - "continue" - resume domain execution, after loading state from console 2 (require -loadvm command argument), results: + - "running" - success + + + PV-GRUB =======