From nobody Sun May 19 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503958519476446.15862633058964; Mon, 28 Aug 2017 15:15:19 -0700 (PDT) Received: from localhost ([::1]:41629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmSJR-0006pf-GQ for importer@patchew.org; Mon, 28 Aug 2017 18:15:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmSGe-0005HE-Bv for qemu-devel@nongnu.org; Mon, 28 Aug 2017 18:12:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmSGb-0000ZU-FU for qemu-devel@nongnu.org; Mon, 28 Aug 2017 18:12:24 -0400 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:38183) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dmSGb-0000YE-A8 for qemu-devel@nongnu.org; Mon, 28 Aug 2017 18:12:21 -0400 Received: by mail-pg0-x243.google.com with SMTP id t3so1273026pgt.5 for ; Mon, 28 Aug 2017 15:12:19 -0700 (PDT) Received: from serve.minyard.net ([47.184.154.34]) by smtp.gmail.com with ESMTPSA id z83sm2130957pfd.10.2017.08.28.15.12.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Aug 2017 15:12:16 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 02AFC283; Mon, 28 Aug 2017 17:12:14 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id E18173023BE; Mon, 28 Aug 2017 17:12:13 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WTeBqdQtfRYcWqJwQfs3vBs8+Sgu29U16AqBLX3IgL8=; b=hJXVP++L1sLxBV+wUKSYmMt9q80wFdHNNOs+L7r31JtM1u7yP9qpMUd3JEts4TSyTX 7o1eq8ntFqB6BIHY7tydCgm39fesM4ZgsXLg/e/pnXXhHq+nOMIHgElaihBW6RqR2q6k 2BO5fShpkynRT1qKW8GZ18OvlvIHd9YSRMwZG2+qPHFCo+Lpd9tiXXFXWhA2gDfPlkdT Tpy25S5ef4s3ZoPzFbgLiwVV6SnGSjRC59+XE9j8c2Vob4X9zTQo+nckSi/opthsSrZn TBpQgr8oHcHV0vO2cHUXFJytuJCickOrIKYlKmCZejCYVAnJAr+Sr3ZsqrIE+DX6ZcCD m1zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=WTeBqdQtfRYcWqJwQfs3vBs8+Sgu29U16AqBLX3IgL8=; b=Q0jWfw7YjK6qSuo7BjwoEdume12xNl2vIAzhEmE40FBHumHKV2QiSSB6tNlInv3/4z 316I6r5VE3h6QBP27wVLtSCPKUkwvl98XPnnYQo1J18len1/EAduxUnUQwK6SYKBm2ZV CDZcLCRhKmdXZdQNUERvJi2hUs/Enpy5r/c6glQAUYB6a0P4x8EZchiz/S0PFWp6kui1 sC2p/+kyjhosWe8I7+MTQ676vHMJrSLepVKYyB/YTWJpb5QZz4OuWBpSMUawrhaWfvYC YOUM88kaQsvdWmCXjoWvjTK2xtIYhhwgpMxI9pGJH8Vh/UwHLTWrmGyZZV/6DIDrqBDr 5JKA== X-Gm-Message-State: AHYfb5hYsCucgWzau02GTiQLQ4V2tCGwFpiRaqjiJPOBaJHQVoJAHuPy 5sYbBseCKmjXSA== X-Received: by 10.84.224.207 with SMTP id k15mr2407979pln.91.1503958338939; Mon, 28 Aug 2017 15:12:18 -0700 (PDT) From: minyard@acm.org To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-devel@nongnu.org Date: Mon, 28 Aug 2017 17:12:08 -0500 Message-Id: <1503958330-14083-2-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503958330-14083-1-git-send-email-minyard@acm.org> References: <1503958330-14083-1-git-send-email-minyard@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::243 Subject: [Qemu-devel] [PATCH v3 1/3] ipmi: Fix SEL get/set time commands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Corey Minyard The minimum message size was on the wrong commands, for getting the time it's zero and for setting the time it's 6. Signed-off-by: Corey Minyard Reviewed-by: C=C3=A9dric Le Goater --- hw/ipmi/ipmi_bmc_sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index 277c28c..cc068f2 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -1802,8 +1802,8 @@ static const IPMICmdHandler storage_cmds[] =3D { [IPMI_CMD_GET_SEL_ENTRY] =3D { get_sel_entry, 8 }, [IPMI_CMD_ADD_SEL_ENTRY] =3D { add_sel_entry, 18 }, [IPMI_CMD_CLEAR_SEL] =3D { clear_sel, 8 }, - [IPMI_CMD_GET_SEL_TIME] =3D { get_sel_time, 6 }, - [IPMI_CMD_SET_SEL_TIME] =3D { set_sel_time }, + [IPMI_CMD_GET_SEL_TIME] =3D { get_sel_time }, + [IPMI_CMD_SET_SEL_TIME] =3D { set_sel_time, 6 }, }; =20 static const IPMINetfn storage_netfn =3D { --=20 2.7.4 From nobody Sun May 19 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503958585505624.2603902797061; Mon, 28 Aug 2017 15:16:25 -0700 (PDT) Received: from localhost ([::1]:41636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmSKV-0007Y7-JL for importer@patchew.org; Mon, 28 Aug 2017 18:16:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmSGe-0005HC-Ap for qemu-devel@nongnu.org; Mon, 28 Aug 2017 18:12:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmSGb-0000Ze-Pq for qemu-devel@nongnu.org; Mon, 28 Aug 2017 18:12:24 -0400 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:32821) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dmSGb-0000ZD-Jg for qemu-devel@nongnu.org; Mon, 28 Aug 2017 18:12:21 -0400 Received: by mail-pg0-x243.google.com with SMTP id m15so1296127pgc.0 for ; Mon, 28 Aug 2017 15:12:21 -0700 (PDT) Received: from serve.minyard.net ([47.184.154.34]) by smtp.gmail.com with ESMTPSA id k75sm2442328pfk.11.2017.08.28.15.12.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Aug 2017 15:12:19 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 4B67EDB3; Mon, 28 Aug 2017 17:12:15 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id CF1023023C0; Mon, 28 Aug 2017 17:12:13 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xEV6SmV/vklWlR0FbWcQCRcVYfv2IMVPXqrDvll5yxI=; b=l4nSMDsGFFSv9FTSDXEU6hRlrGQg9PjUbABXd1hnud8IP3VQWj3zoynQ+TEnzwlyvt HYECBaHUiZwZKnRkKPlx0rP1iIFbLDBY6H5P5Hv3BXTgahVZql7WJK43EcKBdj3uoGvh 7kbbsjjxUxeb/w7sMDznXVXyCJLIUb4hpQIvMQdEfbsn69slO7BdscBRg8D/PrknmYFv 0XrWj4xRq7nKouOOBHuIw+MLGHYNWk9tZpXO0tnzigrdE8EVaj+WnVoxqrNqAj29aTuk 3honndwWTGG/LcTqbVAmb14La4ptdSFqSZaFEKbZrIkW8Evjl051/NNEjYzLHuWpynzF vOew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=xEV6SmV/vklWlR0FbWcQCRcVYfv2IMVPXqrDvll5yxI=; b=XGhdT0XBBRfxDnChtGQrmZoWgO6kwd3W8OdxUR8/wb4ESWJjH0yzQEBaZKoqI/I069 VSN6OCdQ2qsUkDkLpn20WEG9koBBNtyGqP5JLi900gCwemkyJo/AcOD6sKEexuYc1Ej4 T2lCmvbtppQVnVBXw1K1cQrV9t6sbrgvFur8+C6GIHRjL6U7q7Xdq6AabkE8UC7Dp3kf NqohUfX/+/Hy+B5h6PFpz7d9Lpb3evwp7MKY2VMRaTMefNUqV9Wd707qTlqN0Vs57VCm VfVkbjoiEViEMF7awktMidIR7Scx0rr+IxJ1FvEvuPTDQZiEJxIeTCx6+fCoskzubjBe 9qhA== X-Gm-Message-State: AHYfb5gch2mGd6XDGeLvUGQDf1jKAa1FoRnOPJBJk7KQfzm4FHM29v3c y4nlz4b0m9K+0A== X-Received: by 10.84.216.5 with SMTP id m5mr2438607pli.434.1503958340767; Mon, 28 Aug 2017 15:12:20 -0700 (PDT) From: minyard@acm.org To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-devel@nongnu.org Date: Mon, 28 Aug 2017 17:12:09 -0500 Message-Id: <1503958330-14083-3-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503958330-14083-1-git-send-email-minyard@acm.org> References: <1503958330-14083-1-git-send-email-minyard@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::243 Subject: [Qemu-devel] [PATCH v3 2/3] ipmi: Don't set the timestamp on add events that don't have it X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Corey Minyard According to the spec, from section "32.3 OEM SEL Record - Type E0h-FFh", event types from 0x0e to 0xff do not have a timestamp. So don't set it when adding those types. This required putting the timestamp in a temporary buffer, since it's still required to set the last addition time. Signed-off-by: Corey Minyard Reviewed-by: C=C3=A9dric Le Goater --- hw/ipmi/ipmi_bmc_sim.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index cc068f2..a0bbfd5 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -443,16 +443,21 @@ static void sel_inc_reservation(IPMISel *sel) /* Returns 1 if the SEL is full and can't hold the event. */ static int sel_add_event(IPMIBmcSim *ibs, uint8_t *event) { + uint8_t ts[4]; + event[0] =3D 0xff; event[1] =3D 0xff; - set_timestamp(ibs, event + 3); + set_timestamp(ibs, ts); + if (event[2] < 0xe0) { /* Don't set timestamps for type 0xe0-0xff. */ + memcpy(event + 3, ts, 4); + } if (ibs->sel.next_free =3D=3D MAX_SEL_SIZE) { ibs->sel.overflow =3D 1; return 1; } event[0] =3D ibs->sel.next_free & 0xff; event[1] =3D (ibs->sel.next_free >> 8) & 0xff; - memcpy(ibs->sel.last_addition, event + 3, 4); + memcpy(ibs->sel.last_addition, ts, 4); memcpy(ibs->sel.sel[ibs->sel.next_free], event, 16); ibs->sel.next_free++; sel_inc_reservation(&ibs->sel); --=20 2.7.4 From nobody Sun May 19 09:42:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503958428379907.6716509038845; Mon, 28 Aug 2017 15:13:48 -0700 (PDT) Received: from localhost ([::1]:41624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmSHx-0005rg-UW for importer@patchew.org; Mon, 28 Aug 2017 18:13:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmSGe-0005HD-BF for qemu-devel@nongnu.org; Mon, 28 Aug 2017 18:12:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmSGb-0000Z7-3q for qemu-devel@nongnu.org; Mon, 28 Aug 2017 18:12:24 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:36501) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dmSGa-0000Y7-Ts for qemu-devel@nongnu.org; Mon, 28 Aug 2017 18:12:21 -0400 Received: by mail-pg0-x241.google.com with SMTP id 83so1281005pgb.3 for ; Mon, 28 Aug 2017 15:12:19 -0700 (PDT) Received: from serve.minyard.net ([47.184.154.34]) by smtp.gmail.com with ESMTPSA id b29sm2537087pfh.22.2017.08.28.15.12.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Aug 2017 15:12:16 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 2FAD2CFA; Mon, 28 Aug 2017 17:12:15 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id B838B30009D; Mon, 28 Aug 2017 17:12:13 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=789edMDauOWZHbsNILLacYVL9cPRbrYiExCSkLdLCNY=; b=oUv7LJ/ml4gG5f7M5xI3RTEWabIUPmI6458NJY+fZtLrJMH7LItMa38+PbDRxPq1yd KpoKx6NvC2XGkM34QKexfb/WeK71aEksLkFvK9ey/0peOStSX39oTFY80xlEZ499BGeW PxYYiV3zt0aJn2mvYSijb8NwsrGpWsSFnNr66JZJJk/3JqfeZ+7bwftqmGRPXQ41K7Wu jE6rEDroxXOoDshmKGWdH9W+EuZTPCg4AzMQPzvXwIOgSQMp0woanulugGjTqD/31e2y n9kiGXuSNKLf4zZmi3HAU4Gt9g02UXioHf3hQTYm+CpzdBviu6/q3Pf6vyZIw7hJ0oWN HJlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=789edMDauOWZHbsNILLacYVL9cPRbrYiExCSkLdLCNY=; b=baUzIsASQ9vuSS45NWpbsCSJHH0MyNMpI1qnke1V0Povg9dl+3GzPEmi1GDaRzZVt3 PSYH3c04TT61WElgZWfwPMtYaAIMMgdsGU7/fNjhudQM8Xq8MonyiiltnLxsdQu0ngdk vCgXPSo7kEcpQ55k2pOHVqo+aV2JYg8Kg0ZLGyig++CCmBh8mHAVpl1+E2IAUqpMyOOl Mc1iiKh46K/dJyc5af1R5JEsjq1C1BqAfvM+nNU072qGkPjspdDWssGQPpC3tAkU/QVF uxw6awXADdqWub3LfzCP7YJ3CqjILVBnTeoG5+quvuDv0kpNNNmqv+2SdR/2djQa1h/B 4YIg== X-Gm-Message-State: AHYfb5jlsOo2Le5K/AlsXHw1f/r0072RmvXmn+qHo90jiEdjIftVslSI KoLvITy9fXNoNg== X-Received: by 10.84.133.34 with SMTP id 31mr2522156plf.374.1503958338280; Mon, 28 Aug 2017 15:12:18 -0700 (PDT) From: minyard@acm.org To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-devel@nongnu.org Date: Mon, 28 Aug 2017 17:12:10 -0500 Message-Id: <1503958330-14083-4-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503958330-14083-1-git-send-email-minyard@acm.org> References: <1503958330-14083-1-git-send-email-minyard@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [PATCH v3 3/3] ipmi: Add the platform event message command X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Corey Minyard This lets an event be added to the SEL as if a sensor had generated it. The OpenIPMI driver uses it for storing panic event information. Signed-off-by: Corey Minyard Reviewed-by: C=C3=A9dric Le Goater --- hw/ipmi/ipmi_bmc_sim.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index a0bbfd5..e84d710 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -38,6 +38,7 @@ =20 #define IPMI_NETFN_SENSOR_EVENT 0x04 =20 +#define IPMI_CMD_PLATFORM_EVENT_MSG 0x02 #define IPMI_CMD_SET_SENSOR_EVT_ENABLE 0x28 #define IPMI_CMD_GET_SENSOR_EVT_ENABLE 0x29 #define IPMI_CMD_REARM_SENSOR_EVTS 0x2a @@ -1581,6 +1582,28 @@ static void set_sel_time(IPMIBmcSim *ibs, ibs->sel.time_offset =3D now.tv_sec - ((long) val); } =20 +static void platform_event_msg(IPMIBmcSim *ibs, + uint8_t *cmd, unsigned int cmd_len, + RspBuffer *rsp) +{ + uint8_t event[16]; + + event[2] =3D 2; /* System event record */ + event[7] =3D cmd[2]; /* Generator ID */ + event[8] =3D 0; + event[9] =3D cmd[3]; /* EvMRev */ + event[10] =3D cmd[4]; /* Sensor type */ + event[11] =3D cmd[5]; /* Sensor number */ + event[12] =3D cmd[6]; /* Event dir / Event type */ + event[13] =3D cmd[7]; /* Event data 1 */ + event[14] =3D cmd[8]; /* Event data 2 */ + event[15] =3D cmd[9]; /* Event data 3 */ + + if (sel_add_event(ibs, event)) { + rsp_buffer_set_error(rsp, IPMI_CC_OUT_OF_SPACE); + } +} + static void set_sensor_evt_enable(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len, RspBuffer *rsp) @@ -1757,6 +1780,7 @@ static const IPMINetfn chassis_netfn =3D { }; =20 static const IPMICmdHandler sensor_event_cmds[] =3D { + [IPMI_CMD_PLATFORM_EVENT_MSG] =3D { platform_event_msg, 10 }, [IPMI_CMD_SET_SENSOR_EVT_ENABLE] =3D { set_sensor_evt_enable, 4 }, [IPMI_CMD_GET_SENSOR_EVT_ENABLE] =3D { get_sensor_evt_enable, 3 }, [IPMI_CMD_REARM_SENSOR_EVTS] =3D { rearm_sensor_evts, 4 }, --=20 2.7.4