From nobody Thu May 2 17:46:32 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 1503178957491292.5794492107336; Sat, 19 Aug 2017 14:42:37 -0700 (PDT) Received: from localhost ([::1]:38184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djBVs-0001If-7r for importer@patchew.org; Sat, 19 Aug 2017 17:42:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djBUD-0000DV-AJ for qemu-devel@nongnu.org; Sat, 19 Aug 2017 17:40:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djBUB-0007Gb-DM for qemu-devel@nongnu.org; Sat, 19 Aug 2017 17:40:53 -0400 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:37961) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1djBUB-0007FT-6L for qemu-devel@nongnu.org; Sat, 19 Aug 2017 17:40:51 -0400 Received: by mail-pg0-x243.google.com with SMTP id 123so18973679pga.5 for ; Sat, 19 Aug 2017 14:40:51 -0700 (PDT) Received: from serve.minyard.net ([47.184.154.34]) by smtp.gmail.com with ESMTPSA id d86sm17531478pfk.43.2017.08.19.14.40.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Aug 2017 14:40:49 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id EC44195F; Sat, 19 Aug 2017 16:40:44 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 3E3B1300013; Sat, 19 Aug 2017 16:40:42 -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; bh=Gceo575WI+St4thpyUhuA2+zA0s1j8PrafQh3G3ffuM=; b=Ajszst3U90YW0K0Y1cE85SqOjOjjtv7SQDQ4IgVjN4XQCM1AsnqoiKink7s0mEOZMG SOJt8z/kFUvNj1JE2Vrs5czFt8IeLZOOKwYatPwAHUVwqLpAmalT49JAfYaHag/t3s1a ejllSEQ8cKPZfC3ZMNIQQAdZVHPjy8OHzHXL+fo8L9+gn73DeHHW84kQ/+jnLJSZDP3s URIKaEhOcl3O0CNLNU6Hv0+BTSffa8Q634bDRxI22WqPP3kMBbhzZkRmY+0ybVFL0OX3 mdX0T3BpenFRqrR8mK4/vwmEV5eXBUykZr2qzMbqGd0i+6QWwVZcnYhzEiLAd7vd86I4 TeIg== 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; bh=Gceo575WI+St4thpyUhuA2+zA0s1j8PrafQh3G3ffuM=; b=U0LLjI3MC2dkWxEmQGfVJ1lRBfrBHSq2Kvaxdc0NgLly9nzlfEhZKX7Ji8gIXBI326 dqA7BIr67GvpvEFsg8EiUTobGVVy6CaTeqMG93BsQKinOuuLTp7RAlIrdP5pzVdmnHbm h8IkW7tVf8bSTPXQCAqLuE80DUjgVpjRyBTtBlP5u4m58uJPySEdaTTx7e6pYZhCooiF sVHc712HeFA4TXecA/j6Ezrxj/si4UgmkxWPndSscGRhQs6pbDHbqhEbL213Tv1ymidD 4QMzu/z/uXVO2NzdYKiHtDX/EhCsdBF5WT85QOcNMU+wQf5UPTcacyd6snm9ZSRJcEFZ 68nQ== X-Gm-Message-State: AHYfb5jlWfJkTmX4mWw9q7PESWwEkkqnYR+MMxf5+DKJbPKRaPjaQPh4 w5Ype0O0an+zgQ== X-Received: by 10.84.231.140 with SMTP id g12mr14497038plk.256.1503178850176; Sat, 19 Aug 2017 14:40:50 -0700 (PDT) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Sat, 19 Aug 2017 16:40:38 -0500 Message-Id: <1503178840-21512-2-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503178840-21512-1-git-send-email-minyard@acm.org> References: <1503178840-21512-1-git-send-email-minyard@acm.org> 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 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 , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , 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 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Corey Minyard The minimum message size was wrong for both commands, for getting the time it's zero and for setting the time it's 4. And the data was being pulled from the wrong place in the set time message, it should be the first four bytes. Signed-off-by: Corey Minyard --- hw/ipmi/ipmi_bmc_sim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index 277c28c..1c732aa 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -1571,7 +1571,7 @@ static void set_sel_time(IPMIBmcSim *ibs, uint32_t val; struct ipmi_time now; =20 - val =3D cmd[2] | (cmd[3] << 8) | (cmd[4] << 16) | (cmd[5] << 24); + val =3D cmd[0] | (cmd[1] << 8) | (cmd[2] << 16) | (cmd[3] << 24); ipmi_gettime(&now); ibs->sel.time_offset =3D now.tv_sec - ((long) val); } @@ -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, 4 }, }; =20 static const IPMINetfn storage_netfn =3D { --=20 2.7.4 From nobody Thu May 2 17:46:32 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 1503178956317653.2279484878579; Sat, 19 Aug 2017 14:42:36 -0700 (PDT) Received: from localhost ([::1]:38182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djBVr-0001Hw-41 for importer@patchew.org; Sat, 19 Aug 2017 17:42:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djBUD-0000DY-BF for qemu-devel@nongnu.org; Sat, 19 Aug 2017 17:40:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djBUA-0007Fl-VE for qemu-devel@nongnu.org; Sat, 19 Aug 2017 17:40:53 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:36217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1djBUA-00078d-P7 for qemu-devel@nongnu.org; Sat, 19 Aug 2017 17:40:50 -0400 Received: by mail-pf0-x244.google.com with SMTP id t83so3486688pfj.3 for ; Sat, 19 Aug 2017 14:40:49 -0700 (PDT) Received: from serve.minyard.net ([47.184.154.34]) by smtp.gmail.com with ESMTPSA id h8sm17105881pfe.81.2017.08.19.14.40.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Aug 2017 14:40:46 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id DEE4093F; Sat, 19 Aug 2017 16:40:44 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 56E5930009D; Sat, 19 Aug 2017 16:40:43 -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; bh=Kt85tNs/v/YRp8+R3YmTS4DAlihquaA5HFUEzSSY11w=; b=qBblVHiZY07u15DilQ1jQkzEmi71WO3sI6AIekVWszWhJIrPrKLmAkwLzgfF9kLYnF Gc6RVMrb4s+MmxFzSvg4AwN9c9ejl8E4jpKnCn4qPycgs8gnbALZL57jUM58LrUlbABC wEA/86CdMThY6ZlygDY2IPgN96xS+SApdh+EgAL6n92htKAPWwVZgTVn5p3jrbUujfCv e6z2o/U5kpQmxYrYnbJc7H7+G035Mm86FY77ZVqCaD2uXRTg6STgN1nprE9awf2TvdGP TmvRdaCYWI6r64DRdNj+lRe7pHvUwfV5xaPq4kBf7I842j7ovQFeziAyWx99eH5w/4I9 u14g== 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; bh=Kt85tNs/v/YRp8+R3YmTS4DAlihquaA5HFUEzSSY11w=; b=uQsr6IQoWnlvLEAhfknzWkJcDWzIiyM9YSTzoj3klm4v7v0cbqJiYp7jElmy1JAdxO 3WHKTF7dcAC+yySUUoAo5gsHq2jV/J8LJCbK5G6dC6zUeuhRtMpunYGWR6oprbR9skqK l5pI0FmfhaPFx+zhR/WhV0HKEOOWELD5JI15K54OOpeB7bFWrQMdwjoAByDCxfZcuefD d/hsQOCIMm4q3H6Rqb7LoQVflTyCv6Z/uwQNy5HK2q3+0aBsI8XBL1JGrdv47YdrYH3P D0jZGOn2IAEzzg/nLfSBhgPO9YhZvJfg2WkxP3+v1AMm31b1Kl6YRep9hxXlSuiG51vv 2W+g== X-Gm-Message-State: AHYfb5ipexIstJwQ5hrQlw7Sx4c13DrmVmF2Gra+6nG4Tv7nsF4H39Fg Y0okChZRt+S7RQ== X-Received: by 10.99.49.20 with SMTP id x20mr12444886pgx.102.1503178848258; Sat, 19 Aug 2017 14:40:48 -0700 (PDT) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Sat, 19 Aug 2017 16:40:39 -0500 Message-Id: <1503178840-21512-3-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503178840-21512-1-git-send-email-minyard@acm.org> References: <1503178840-21512-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH 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 , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , 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 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Corey Minyard According to the spec, 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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index 1c732aa..0f191e8 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -443,16 +443,20 @@ 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 these, per the spec. = */ + 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 Thu May 2 17:46:32 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 150317906334788.71226683502982; Sat, 19 Aug 2017 14:44:23 -0700 (PDT) Received: from localhost ([::1]:38354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djBXa-0002sy-6I for importer@patchew.org; Sat, 19 Aug 2017 17:44:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djBUD-0000DW-B3 for qemu-devel@nongnu.org; Sat, 19 Aug 2017 17:40:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djBUA-0007Ei-Ex for qemu-devel@nongnu.org; Sat, 19 Aug 2017 17:40:53 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:33903) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1djBUA-0007BJ-6g for qemu-devel@nongnu.org; Sat, 19 Aug 2017 17:40:50 -0400 Received: by mail-pg0-x242.google.com with SMTP id i12so3691134pgr.1 for ; Sat, 19 Aug 2017 14:40:50 -0700 (PDT) Received: from serve.minyard.net ([47.184.154.34]) by smtp.gmail.com with ESMTPSA id h8sm17105879pfe.81.2017.08.19.14.40.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Aug 2017 14:40:46 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id BEE3E2E5; Sat, 19 Aug 2017 16:40:44 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 4A851300080; Sat, 19 Aug 2017 16:40:43 -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; bh=3XRpYwfC5vuIr0t/BVn21+uhaxomAHENyVwRN9um43c=; b=ne7SBitzqyMxZl7ImYPs2Ye1r8zWN938aqGGuLNl3ZwjN6WstVePq/6pSKWOeqme6Y ujBZpu71tVb6e96wMLMW8tAdFaxNZZtXc5iUyikBdYo6bGfS7a+4ODok/24ZBhqPEhkL wMSEgxDf4Z24jQ4j2VRUgDegRV4uObyuCnFE0aHiEawT6dn5gzICJdz+RmbB0cd4xL5Z hKuH1fiBrKIU5WnRVGFKUqUvaPeDQMM5zfNopPNMHxfG7Bgmvox06JM6dZNFqymzdAYS 8PflHY6SB7IJoWt3gnP/wIsBkKISPvpLL24N6bUbf+IfI4a1duWJIMlRuyi/iaerArn9 d8Cg== 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; bh=3XRpYwfC5vuIr0t/BVn21+uhaxomAHENyVwRN9um43c=; b=nmmMgvu/WqWEcMkvIhkzZDYeUogO9fVumtcwTqLLuxFjsn2jyPNQw5dBU/7mjbHKVt Nm/k1OwVgbFPi4kozSu+Fv1OYKxJUZJFOTxW2Y/Fv7nnxsRexuiJ4TB4eob16tjeAOzY 4XpJwGgt+z69lNFxGCquiSMve9D//Hc04GxJh2jS1HT0k9K0caSSj2s0BxEUxTeKUGcm g78LbKuCgs/5kLkzb2Ci3traXTV5Oey/Dfkgo2mtZg/M3qafnqQxOXvrO/9mJoT7J+A/ 8gfQMLOVZdj2GUU/7T0W7MhdaBsVJA/b+giykB1ZaJt5Fshh8cv10qI1a2gdLX1zuPO7 oXYA== X-Gm-Message-State: AHYfb5gszK34WF1ns64MUXwmt00rEhQ8RMwmNBRS/b9L1ZglArL0Qjih HR+xDrtvak1A1A== X-Received: by 10.99.157.204 with SMTP id i195mr10588547pgd.101.1503178849104; Sat, 19 Aug 2017 14:40:49 -0700 (PDT) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Sat, 19 Aug 2017 16:40:40 -0500 Message-Id: <1503178840-21512-4-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503178840-21512-1-git-send-email-minyard@acm.org> References: <1503178840-21512-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::242 Subject: [Qemu-devel] [PATCH 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 , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , 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 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 --- hw/ipmi/ipmi_bmc_sim.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index 0f191e8..09b15a8 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 @@ -1580,6 +1581,27 @@ 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[0]; /* Generator ID */ + event[8] =3D 0; + event[9] =3D cmd[1]; /* EvMRev */ + event[10] =3D cmd[2]; /* Sensor type */ + event[11] =3D cmd[3]; /* Sensor number */ + event[12] =3D cmd[4]; /* Event dir / Event type */ + event[13] =3D cmd[5]; /* Event data 1 */ + event[14] =3D cmd[6]; /* Event data 2 */ + event[15] =3D cmd[7]; /* 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) @@ -1756,6 +1778,7 @@ static const IPMINetfn chassis_netfn =3D { }; =20 static const IPMICmdHandler sensor_event_cmds[] =3D { + [IPMI_CMD_PLATFORM_EVENT_MSG] =3D { platform_event_msg, 8 }, [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