From patchwork Tue Sep 29 00:39:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)\" via" X-Patchwork-Id: 11804771 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 C15981580 for ; Tue, 29 Sep 2020 00:40:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 0DD0A21734 for ; Tue, 29 Sep 2020 00:40:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="BZ3o1k9N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DD0A21734 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=nongnu.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:39684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kN3hP-0003Xk-H9 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 28 Sep 2020 20:40:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3SYJyXwsKCho7IA8DD4CE4D6EE6B4.2ECG4CK-34L4BDED6DK.EH6@flex--hskinnemoen.bounces.google.com>) id 1kN3gD-0002GG-Is for qemu-devel@nongnu.org; Mon, 28 Sep 2020 20:39:41 -0400 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]:54424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3SYJyXwsKCho7IA8DD4CE4D6EE6B4.2ECG4CK-34L4BDED6DK.EH6@flex--hskinnemoen.bounces.google.com>) id 1kN3gC-0000PR-4F for qemu-devel@nongnu.org; Mon, 28 Sep 2020 20:39:41 -0400 Received: by mail-yb1-xb4a.google.com with SMTP id s128so2930157ybc.21 for ; Mon, 28 Sep 2020 17:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=sYg5Kzsr8KLjdNXvzs0OEoN/iOhrZqYW4HJOWew+/+s=; b=BZ3o1k9NYKMO7qfF55oxjLloDhis/h5uzOHdD1+Glkqmycmr7sdCcWQLIM8oHrLam/ ajvjmoiHKOmluhD5kRvP9yAy8nkLeOn9zNnG+l/kin32Slr+YyXhfrS4vOmw+sO5hTFw 7dH3QsZWfT+1QozINyHSnTShuWvSazI444mwNyCv/r0l3MFyH6OWlCMG0CF4RDrCb1wJ LlgtJkmSd75Gxk+vd3QQHqybpwIXNZFITctH212DCsBAyAxm4yicYhvpez5VKnymXsRp Rmv9V5j3igggOx2UU00uA+7/X3QlP3xfgnEl5KUQHfg9dho2KIiKE/Js7XK2Hq0w2LhD aavw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=sYg5Kzsr8KLjdNXvzs0OEoN/iOhrZqYW4HJOWew+/+s=; b=UbMguYQvh2UDS7Tiky/VdkQgm99QqJSYjqSC2e9LFUYWPOvxUyqZyry+ustPxcH44S xvlq5ZwOzl2nkwnqZ7NNDHO9UOFkX43mrPhfulS7CJP7//1WbfdAJWLuKlzAxH63pitv 0pBf5sBO5LZm1og0WAqE7m1BzvG7goeoIscbzfXfBpJpsUQjrdT2eVPXLZCDPYZy39oN /KcyEyufvhfP809E1GxkSVoF4ZSiW3dujUb3BEjkXRZ5OOZTuporLYZCBd/HBNgvdMjM I6uk7z/3sL3ipF1pz0xTR0iL7WmQIb/zJBZ6S7ErEVLcEqtKBWtyu4VWda12+zdM8V4C 6uiw== X-Gm-Message-State: AOAM532QgsZrdkFiU6MnPlc8pkXGCfXX2uhf306Qo8Bm/PJoedr2jkUf vOwzfh3GEAvRe44BflCu+Yy/F3a8h/v7ZHqiLPZDVhwZtrDX/S2i5hAJICdgODa+usySr12ASmq uaJJmac+9wqF+cVsnQ2zYAEEk3VWs4zRMPH8RS1nMid60OHFx7V+ToF2ypi/YLZTkjYEsDEWp9Q == X-Google-Smtp-Source: ABdhPJxTcetwlCFZyOjMP+C2TBvcHwYdQfNWBOFiw86GDfnqsPDSJMZnoA0+3ma64bpwlR8iehEF39QYoElAnO4qTQ== X-Received: from skybert.c.googlers.com ([fda3:e722:ac3:10:24:72f4:c0a8:3107]) (user=hskinnemoen job=sendgmr) by 2002:a25:d1d4:: with SMTP id i203mr2838876ybg.429.1601339977897; Mon, 28 Sep 2020 17:39:37 -0700 (PDT) Date: Mon, 28 Sep 2020 17:39:14 -0700 In-Reply-To: <20200929003916.4183696-1-hskinnemoen@google.com> Message-Id: <20200929003916.4183696-2-hskinnemoen@google.com> Mime-Version: 1.0 References: <20200929003916.4183696-1-hskinnemoen@google.com> X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [RFC 1/3] docs: enable sphinx blockdiag extension To: qemu-devel@nongnu.org Cc: Avi.Fishman@nuvoton.com, kfting@nuvoton.com, joel@jms.id.au, clg@kaod.org, venture@google.com, wuhaotsh@google.com, minyard@acm.org, Havard Skinnemoen Received-SPF: pass client-ip=2607:f8b0:4864:20::b4a; envelope-from=3SYJyXwsKCho7IA8DD4CE4D6EE6B4.2ECG4CK-34L4BDED6DK.EH6@flex--hskinnemoen.bounces.google.com; helo=mail-yb1-xb4a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -100 X-Spam_score: -10.1 X-Spam_bar: ---------- X-Spam_report: (-10.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.468, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Reply-to: Havard Skinnemoen X-Patchwork-Original-From: Havard Skinnemoen via From: "Zhijian Li (Fujitsu)\" via" Signed-off-by: Havard Skinnemoen --- docs/conf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 0dbd90dc11..7c72f1a074 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -67,7 +67,10 @@ needs_sphinx = '1.6' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['kerneldoc', 'qmp_lexer', 'hxtool', 'depfile'] +extensions = ['kerneldoc', 'qmp_lexer', 'hxtool', 'depfile', 'sphinxcontrib.blockdiag'] + +# Fontpath for blockdiag (truetype font) +blockdiag_fontpath = '/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf' # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] From patchwork Tue Sep 29 00:39:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)\" via" X-Patchwork-Id: 11804773 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 1B35192C for ; Tue, 29 Sep 2020 00:41:05 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 9A65821734 for ; Tue, 29 Sep 2020 00:41:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="HU6erWKP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A65821734 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=nongnu.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kN3hX-0003gs-JG for patchwork-qemu-devel@patchwork.kernel.org; Mon, 28 Sep 2020 20:41:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3S4JyXwsKChw9KCAFF6EG6F8GG8D6.4GEI6EM-56N6DFGF8FM.GJ8@flex--hskinnemoen.bounces.google.com>) id 1kN3gF-0002HA-5x for qemu-devel@nongnu.org; Mon, 28 Sep 2020 20:39:43 -0400 Received: from mail-qk1-x749.google.com ([2607:f8b0:4864:20::749]:55211) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3S4JyXwsKChw9KCAFF6EG6F8GG8D6.4GEI6EM-56N6DFGF8FM.GJ8@flex--hskinnemoen.bounces.google.com>) id 1kN3gD-0000PV-D1 for qemu-devel@nongnu.org; Mon, 28 Sep 2020 20:39:42 -0400 Received: by mail-qk1-x749.google.com with SMTP id r184so1663085qka.21 for ; Mon, 28 Sep 2020 17:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=cQm7cQnpxJnDzr+vk7QqhOO9BS7RbVnXECEf70CLEk4=; b=HU6erWKPw9aMyTgiKxlAcd2qHr20i+LP1CvcEwXrgmv16+zZwShULOzZz/tNutSUZt 530oaldDcj8awRacuv7AyiKzGAQdLZM9UwE24th1UIvUSD6dwtRLILTxXO+/njkIqA1i ywOP7c9c2y0omiqdRTFNZ3U1T8Fxsu0px7oDXDmogJSOY7swrjbT2o5DuPE+QDMOzzo1 JxgZMaRuYSa/k2iG9JwPJf+ywvdVyxHRep0EPsZiHCqcMpcoSGKsedHySRaKUh5e4Vdy QabkwPte1fOi1jwq0AxhEZIcQ6donG8/IQrNAM6g5krup8w5yuFHpVLJnMBfWVrJYSw3 cNJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=cQm7cQnpxJnDzr+vk7QqhOO9BS7RbVnXECEf70CLEk4=; b=nKt97U6VI1oHy/k8rZabb2BRtUNihNHNjl58BbLwHWKvZBc3ZQLzb7c6/mj5P0KjNC KN6JJDsy0FbyyQ28kVOHFeqcQKSVfWIiXVm80fHONkekVTdt0P1AwbgeDR7Ivz78/Yht 7WlVz7Wok5UO2AYYsE6t/arRnzex96bzixgKhrwXEcEYqydciCpl0g26Og0Nqr7fJb4z pgHVxoHlODSFQzI5jlhpLog5agxbK3JoM4a3sTj/k3Z3G+8R8lmJAjaEyFBkj+lj9E37 rcyYnhKILoJO/STRg1mIDBG4fbHRas3jtGY5PntHP0XSmBAW8uN/lLtG8MXMZ2W7GTNZ 9s7A== X-Gm-Message-State: AOAM53287dUGNutQuhpJWINnXhVskiOobXYxSueC9HK0QHZ/m6yh1zHj KurE03jcFZMEO5FoQc5ErfJ2noXFqcPHrMGC7uZZdWbz8OLLXLnBRMhuPBgeJ6i2oVUHvdJgN0D eHXa9iSEYzqsFA4UUy8UgtZ03/Y4RcbOmU6Mr/GU6GzphXXDHIIVgo3dkNIFL4lrwx9YW6qOa8A == X-Google-Smtp-Source: ABdhPJwcbn6pxAJejfFvxdbgXmAxP0hPbeo0iA2hBs+h4G2i5Dafpfg2tOJWLEdp/l7awGmWVQnOjXMeGdwdOPoJoA== X-Received: from skybert.c.googlers.com ([fda3:e722:ac3:10:24:72f4:c0a8:3107]) (user=hskinnemoen job=sendgmr) by 2002:ad4:4b61:: with SMTP id m1mr2320198qvx.11.1601339979400; Mon, 28 Sep 2020 17:39:39 -0700 (PDT) Date: Mon, 28 Sep 2020 17:39:15 -0700 In-Reply-To: <20200929003916.4183696-1-hskinnemoen@google.com> Message-Id: <20200929003916.4183696-3-hskinnemoen@google.com> Mime-Version: 1.0 References: <20200929003916.4183696-1-hskinnemoen@google.com> X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [RFC 2/3] docs/specs: IPMI device emulation: main processor To: qemu-devel@nongnu.org Cc: Avi.Fishman@nuvoton.com, kfting@nuvoton.com, joel@jms.id.au, clg@kaod.org, venture@google.com, wuhaotsh@google.com, minyard@acm.org, Havard Skinnemoen Received-SPF: pass client-ip=2607:f8b0:4864:20::749; envelope-from=3S4JyXwsKChw9KCAFF6EG6F8GG8D6.4GEI6EM-56N6DFGF8FM.GJ8@flex--hskinnemoen.bounces.google.com; helo=mail-qk1-x749.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -100 X-Spam_score: -10.1 X-Spam_bar: ---------- X-Spam_report: (-10.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.468, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Reply-to: Havard Skinnemoen X-Patchwork-Original-From: Havard Skinnemoen via From: "Zhijian Li (Fujitsu)\" via" This document is an attempt to briefly document the existing IPMI emulation support on the main processor. It provides the necessary background for the BMC-side IPMI emulation proposed by the next patch. Signed-off-by: Havard Skinnemoen --- docs/specs/index.rst | 1 + docs/specs/ipmi.rst | 100 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 docs/specs/ipmi.rst diff --git a/docs/specs/index.rst b/docs/specs/index.rst index 1b0eb979d5..9fdb94a578 100644 --- a/docs/specs/index.rst +++ b/docs/specs/index.rst @@ -14,5 +14,6 @@ Contents: ppc-spapr-xive ppc-spapr-numa acpi_hw_reduced_hotplug + ipmi tpm acpi_hest_ghes diff --git a/docs/specs/ipmi.rst b/docs/specs/ipmi.rst new file mode 100644 index 0000000000..e0f9ab20ba --- /dev/null +++ b/docs/specs/ipmi.rst @@ -0,0 +1,100 @@ +===================== +IPMI device emulation +===================== + +QEMU supports emulating many types of machines. This includes machines that may +serve as the main processor in an IPMI system, e.g. x86 or POWER server +processors, as well as machines emulating ARM-based Baseband Management +Controllers (BMCs), e.g. AST2xxx or NPCM7xxx systems-on-chip. + +Main processor emulation +======================== + +A server platform may include one of the following system interfaces for +communicating with a BMC: + +* A Keyboard Controller Style (KCS) Interface, accessible via ISA + (``isa-ipmi-kcs``) or PCI (``pci-ipmi-kcs``). +* A Block Transfer (BT) Interface, accessible via ISA (``isa-ipmi-bt``) or PCI + (``pci-ipmi-bt``). +* An SMBus System Interface (SSIF; ``smbus-ipmi``). + +These interfaces can all be emulated by QEMU. To emulate the behavior of the +BMC, the messaging interface emulators use one of the following backends: + +* A BMC simulator running within the QEMU process (``ipmi-bmc-sim``). +* An external BMC simulator or emulator, connected over a chardev + (``ipmi-bmc-extern``). `ipmi_sim + `_ + from OpenIPMI is an example external BMC emulator. + +The following diagram shows how these entities relate to each other. + +.. blockdiag:: + + blockdiag main_processor_ipmi { + orientation = portrait + default_group_color = "none"; + class msgif [color = lightblue]; + class bmc [color = salmon]; + + ipmi_sim [color="aquamarine", label="External BMC"] + ipmi-bmc-extern <-> ipmi_sim [label="chardev"]; + + group { + orientation = portrait + + ipmi-interface <-> ipmi-bmc; + + group { + orientation = portrait + + ipmi-interface [class = "msgif"]; + isa-ipmi-kcs [class="msgif", stacked]; + + ipmi-interface <- isa-ipmi-kcs [hstyle = generalization]; + } + + + group { + orientation = portrait + + ipmi-bmc [class = "bmc"]; + ipmi-bmc-sim [class="bmc"]; + ipmi-bmc-extern [class="bmc"]; + + ipmi-bmc <- ipmi-bmc-sim [hstyle = generalization]; + ipmi-bmc <- ipmi-bmc-extern [hstyle = generalization]; + } + + } + } + +IPMI System Interfaces +---------------------- + +The system software running on the main processor may use a *system interface* +to communicate with the BMC. These are hardware devices attached to an ISA, PCI +or i2c bus, and in QEMU, they all need to implement ``ipmi-interface``. +This allows a BMC implementation to interact with the system interface in a +standard way. + +IPMI BMC +-------- + +The system interface devices delegate emulation of BMC behavior to a BMC +device, that is a subclass of ``ipmi-bmc``. This type of device is called +a BMC because that's what it looks like to the main processor guest software. + +The BMC behavior may be simulated within the qemu process (``ipmi-bmc-sim``) or +further delegated to an external emulator, or a real BMC. The +``ipmi-bmc-extern`` device has a required ``chardev`` property which specifies +the communications channel to the external BMC. + +Wire protocol +============= + +The wire protocol used between ``ipmi-bmc-extern`` and the external BMC +emulator is defined by `README.vm +`_ from +the OpenIPMI project. From patchwork Tue Sep 29 00:39:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)\" via" X-Patchwork-Id: 11804775 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 7438F112C for ; Tue, 29 Sep 2020 00:43:32 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 24A002184D for ; Tue, 29 Sep 2020 00:43:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="eS4Q8vjX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24A002184D Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=nongnu.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:44850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kN3jv-0005h7-3W for patchwork-qemu-devel@patchwork.kernel.org; Mon, 28 Sep 2020 20:43:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3TIJyXwsKCh0ALDBGG7FH7G9HH9E7.5HFJ7FN-67O7EGHG9GN.HK9@flex--hskinnemoen.bounces.google.com>) id 1kN3gG-0002K3-KB for qemu-devel@nongnu.org; Mon, 28 Sep 2020 20:39:44 -0400 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]:37689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3TIJyXwsKCh0ALDBGG7FH7G9HH9E7.5HFJ7FN-67O7EGHG9GN.HK9@flex--hskinnemoen.bounces.google.com>) id 1kN3gE-0000Ph-Ra for qemu-devel@nongnu.org; Mon, 28 Sep 2020 20:39:44 -0400 Received: by mail-yb1-xb49.google.com with SMTP id x1so3013683ybi.4 for ; Mon, 28 Sep 2020 17:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=IE9YiOAtzWYoZYcMDmL5AUmQ+PJ06ojbARZV342gJy8=; b=eS4Q8vjXUpdO9EMbbN+iv3/haS33YOyKlZo034g1j5iji3pIYcwiYMupM4zGCQIeBV NLE034W5P8xfb6zqLQxMlmw1UVQ6qymDbH17icyXA3oZSqnX0MThtWUXa11rh5j1pNnR HVK5he3pfbYPaoz/yhHnpKtlf9tgO+Mv6j5d1LwbiHrBrxeluXrrjs2uV8xAPyHYBHac Iau+JZsChrNaiDPsa/KsH7I5vZBFefIRvC3v3AKpQZ+H+OnsrpYV4be7UJneLCgfy6pD b8QtZ+4znocqtyvyHVEnCR28vaED7GiJmcKhQxU/yAo7SbhqEy4ISfxGByxFeopZoqPA CSEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=IE9YiOAtzWYoZYcMDmL5AUmQ+PJ06ojbARZV342gJy8=; b=aaEnd6174OtEk8/axTpChRy38Z32uuPcvm7T+P0QDeQsHogNgFAl6EUS1NQVOOqp9V YZoUF9ZXk/uHiBYuUP7KNr6z6ic69+fmTpF/n8olK4nqendSNq9qZNdSm+cPSjNJGTvy 8jQTyaLqRynH2p1VlDUufiFe+Dha661tkWZn2D3B92i77TNC3cZBGC63z86rTBuvcJ2h REGW4cHKqYVDj9++MYOPTGdmkrljUudVQ0bX39S5ls7rWLbQ48cce7qkQbKY/sEQRW1X Cc5T50W/Lmnj1ptn1X0PiGmgbX1z6YB0ICtszqtLkR+3br0ddTdIm1IvJZV9ZbNChrNk YpQQ== X-Gm-Message-State: AOAM533Bpc39VgV9izs7xi0f4bAv7VMTQgOF+rQZjMQ755PURr9ocp2B yBnX2NFujRsZxXkGw7t/I95vewflxdDj3q23UYziapnQptedGCRXvyrQYbLSsyLtfeMAwljgiCF SsaFG33jnGz3jlaHIgsqmle5J6VgsaQ3WsUuCoHkvQfYDXW0IwYQhuzl3Z5evpQPoazBSkkplow == X-Google-Smtp-Source: ABdhPJySV96yQ17e4fJZqw0CTKxsP4G/VCU2QmaKygzlovPsaQQuFlAE6Ni74ez0nqEpfoVfGDD7oUylncpgDKSUFQ== X-Received: from skybert.c.googlers.com ([fda3:e722:ac3:10:24:72f4:c0a8:3107]) (user=hskinnemoen job=sendgmr) by 2002:a25:b78d:: with SMTP id n13mr2876098ybh.152.1601339980945; Mon, 28 Sep 2020 17:39:40 -0700 (PDT) Date: Mon, 28 Sep 2020 17:39:16 -0700 In-Reply-To: <20200929003916.4183696-1-hskinnemoen@google.com> Message-Id: <20200929003916.4183696-4-hskinnemoen@google.com> Mime-Version: 1.0 References: <20200929003916.4183696-1-hskinnemoen@google.com> X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [RFC 3/3] docs/specs: IPMI device emulation: BMC To: qemu-devel@nongnu.org Cc: Avi.Fishman@nuvoton.com, kfting@nuvoton.com, joel@jms.id.au, clg@kaod.org, venture@google.com, wuhaotsh@google.com, minyard@acm.org, Havard Skinnemoen Received-SPF: pass client-ip=2607:f8b0:4864:20::b49; envelope-from=3TIJyXwsKCh0ALDBGG7FH7G9HH9E7.5HFJ7FN-67O7EGHG9GN.HK9@flex--hskinnemoen.bounces.google.com; helo=mail-yb1-xb49.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -100 X-Spam_score: -10.1 X-Spam_bar: ---------- X-Spam_report: (-10.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.468, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Reply-to: Havard Skinnemoen X-Patchwork-Original-From: Havard Skinnemoen via From: "Zhijian Li (Fujitsu)\" via" The IPMI document is expanded with a proposal to emulate BMC-side IPMI devices. This allows a QEMU instance running server software to interact with a different QEMU instance running BMC firmware, which should closely model how a real server system works. The document as rendered by "make sphinxdocs" can be seen here: https://hskinnemoen.github.io/qemu/specs/ipmi.html Signed-off-by: Havard Skinnemoen --- docs/specs/ipmi.rst | 83 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/docs/specs/ipmi.rst b/docs/specs/ipmi.rst index e0f9ab20ba..f45a452ef9 100644 --- a/docs/specs/ipmi.rst +++ b/docs/specs/ipmi.rst @@ -91,6 +91,89 @@ further delegated to an external emulator, or a real BMC. The ``ipmi-bmc-extern`` device has a required ``chardev`` property which specifies the communications channel to the external BMC. +Baseband Management Controller (BMC) emulation +============================================== + +.. note:: This section is just a proposal. QEMU does not yet support BMC-side + IPMI emulation. + +This section is about emulation of IPMI-related devices in a System-on-Chip +(SoC) used as a Baseband Management Controller. This is not to be confused with +emulating the BMC device as seen by the main processor. + +SoCs that are designed to be used as a BMC often have dedicated hardware that +allows them to be connected to one or more of the IPMI System Interfaces. The +BMC-side hardware interface is not standardized, so each type of SoC may need +its own device implementation in QEMU, for example: + +* ``aspeed-ipmi-ibt`` for emulating the Aspeed iBT peripheral. +* ``npcm7xx-ipmi-kcs`` for emulating the Nuvoton NPCM7xx Host-to-BMC Keyboard + Controller Style (KCS) channels. + +.. blockdiag:: + + blockdiag bmc_ipmi { + orientation = portrait + default_group_color = "none"; + class responder [color = lightblue]; + class host [color = salmon]; + + host [color="aquamarine", label="External Host"] + + group { + orientation = portrait + + group { + orientation = portrait + + ipmi-responder [class = "responder"] + npcm7xx-ipmi-kcs [class = "responder", stacked] + + ipmi-responder <- npcm7xx-ipmi-kcs [hstyle = generalization]; + } + + group { + orientation = portrait + + ipmi-host [class = "host"]; + ipmi-host-sim [class = "host"]; + ipmi-host-extern [class = "host"]; + + ipmi-host <- ipmi-host-sim [hstyle = generalization]; + ipmi-host <- ipmi-host-extern [hstyle = generalization]; + } + + ipmi-responder <-> ipmi-host + } + + ipmi-host-extern <-> host [label="chardev"]; + } + +IPMI Responder +-------------- + +The software running on the BMC needs to intercept reads and writes to the +system interface registers on the main processor. This requires special +hardware that needs to be emulated by QEMU. We'll call these device *IPMI +responders*. + +All *IPMI responder* devices should implement the ``ipmi-responder`` interface +to allow an IPMI Host implementation to interact with them in a standard way. + +IPMI Host +--------- + +Mirroring the main processor emulation, the responder devices delegate +emulation of host behavior to a Host device that is a subclass of +``ipmi-host``. This type of device is called a Host because that's what it +looks like to the BMC guest software. + +The host behavior may be further delegated to an external emulator (e.g. +another QEMU VM) through the ``ipmi-host-extern`` host implementation. This +device has a required ``chardev`` property which specifies the communications +channel to the external host. The wire format is the same as for +``ipmi-bmc-extern``. + Wire protocol =============