From patchwork Mon Aug 28 22:12:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 111179 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp5442110ybm; Mon, 28 Aug 2017 15:15:24 -0700 (PDT) X-Received: by 10.200.13.142 with SMTP id s14mr2982537qti.162.1503958524469; Mon, 28 Aug 2017 15:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503958524; cv=none; d=google.com; s=arc-20160816; b=VXMwyb8+bG4kQP7I3hOXi2+h1vognZJzhUnuNcUw5VQAeGbss8i8ANtuXfudVtKRrQ +tc7edLPEfYf30eMRy2zJdZtq1argak5P3mGSnsOlgKinUicQ/ip2ZcuJ0d0BLk3ut5V hJbo1lcpOL20eupKIY/VXfI3vmLqhvrft7sPU+zkTvQZ6A65W3o7B8cgZBpKj6eWJMyW 953c6Ze6fLPn3ckeifCYB91C/+ujnJj9gTeHngltzDBo13Q3+EvSSKaLFmicRpOe3bKd FrRVlxK04z3rNi2MQAXwznVBsunVScbRn31dXNyBQjPkGOeC4ToC5ijN7YZXP2+gPjtl QcDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=WTeBqdQtfRYcWqJwQfs3vBs8+Sgu29U16AqBLX3IgL8=; b=TJWMLSjUfi1EPPoE0B8HfxIyMeHJthpsfjICgWhvmopBfMRqiU8iK5EbXyQVfpLMtn iFBilreHlepF6SqqhUijMvaDOg6zAg9r2toq0O5iB62a1sRAKxBp38uAfGc0h2qH8zt+ sRVBOkeCZN7cHmFeDWqCiTCKK36+/7EDLpJ4iBH5hV4wB7E/YLe8jh0i1YMYI0KIdY3h GVsiN4SFuMuG/QehDpzhAVlZoUSiU7qqJ2AZlsb5mP8yQGxBtihxAzD7JWzhsNuSHf6E xptzZxwvnQVpZkp3KZr6PuBMM4tFeHcr46s5BWJk/3g7dbhZk62nk5OlRdTrXY6Pe0VX 8Mfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hJXVP++L; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 74si1455498qkt.443.2017.08.28.15.15.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Aug 2017 15:15:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hJXVP++L; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:41629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmSJW-0006pf-Eq for patch@linaro.org; Mon, 28 Aug 2017 18:15:22 -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) 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) 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) From: minyard@acm.org To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , 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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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édric Le Goater --- hw/ipmi/ipmi_bmc_sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 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[] = { [IPMI_CMD_GET_SEL_ENTRY] = { get_sel_entry, 8 }, [IPMI_CMD_ADD_SEL_ENTRY] = { add_sel_entry, 18 }, [IPMI_CMD_CLEAR_SEL] = { clear_sel, 8 }, - [IPMI_CMD_GET_SEL_TIME] = { get_sel_time, 6 }, - [IPMI_CMD_SET_SEL_TIME] = { set_sel_time }, + [IPMI_CMD_GET_SEL_TIME] = { get_sel_time }, + [IPMI_CMD_SET_SEL_TIME] = { set_sel_time, 6 }, }; static const IPMINetfn storage_netfn = { From patchwork Mon Aug 28 22:12:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 111180 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp411652qge; Mon, 28 Aug 2017 15:16:30 -0700 (PDT) X-Received: by 10.233.239.209 with SMTP id d200mr3119359qkg.246.1503958590732; Mon, 28 Aug 2017 15:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503958590; cv=none; d=google.com; s=arc-20160816; b=J82lnxxm1bo9RN4hX1aZFGjxZcd2K5NpJNPbJiSPt6UyEOXYsS0zHAtt4Uoh9TB3n8 vMn8K9IozkZkmu/DmWnRdFinGdsemTgYZsKjRZPNDbMfSkzfh3gDTUm32Z7rAxO5QfAH 9yzm1UDOj9WYM+gVJ//taR5n3ZPM3Icrz47Xt6huDlVeqTIbQg+kaXtHDn1Pm+wevuRO fQySDZeBLc2VRHAPkn0xAvY7/88hQJIoAf3LqHNN/CujwGSNoHeRypNYqVSg0D+ndC3Q CoH99BGjDis51v8eBbqbCNF9HRBT95T+LVXKfQC/DSThEI0nkcrCXxXd4kzsM5wYs2cP sq4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=xEV6SmV/vklWlR0FbWcQCRcVYfv2IMVPXqrDvll5yxI=; b=aCs/Yh4GVneD4pM4G0+3qacx39r1ZN5g7B8QVQWo7wb+SFLJ9BEit4OXGs+ev5nomK vgkOmRViEufUtlMH0wu/Mij8kD1t3TYrJXMXAX1/NUXNOANBYepknt5ISiGC5B2Ymvk6 qzz6VCMe+/vNK7qNsF91oQ/RISkuy/17QxhFP1G92JbGUpzclaIK4f8gWogTetIlx0Py AL0MB4dnT30YbCoWcPkfYz/guc89J5HNK9jCfjhg5kz8q2Z7AUsL76Q0pVyI5hwsOOpl 5xasJcVyGdwi0e/1OLF0I4zweB9AFBGvONQ7NM85pYiCCDdF55OnJYkNP3ZfHfUdFrgj aYXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=l4nSMDsG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g124si1346887qkd.13.2017.08.28.15.16.30 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Aug 2017 15:16:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=l4nSMDsG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:41636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmSKa-0007Y7-Dg for patch@linaro.org; Mon, 28 Aug 2017 18:16:28 -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) 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) 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) From: minyard@acm.org To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , 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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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édric Le Goater --- hw/ipmi/ipmi_bmc_sim.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.7.4 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] = 0xff; event[1] = 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 == MAX_SEL_SIZE) { ibs->sel.overflow = 1; return 1; } event[0] = ibs->sel.next_free & 0xff; event[1] = (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); From patchwork Mon Aug 28 22:12:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 111178 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp5439622ybm; Mon, 28 Aug 2017 15:12:46 -0700 (PDT) X-Received: by 10.55.73.213 with SMTP id w204mr2757127qka.231.1503958366634; Mon, 28 Aug 2017 15:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503958366; cv=none; d=google.com; s=arc-20160816; b=GO9KYTkm6ocyiLJOMEznXPuwuHt0M3SJ/ATvPBiJdl+2K38pAxGMPdhYO+x2FVzMaP 0wcKyl4WLLgx9pPIFJqnookvkoZY4ETyLVtWs43nIQlzctWTfN4dIcYTGDNCEhQnBs7H WtwyQM5OS4qgdHlw8C9quNAa8xwkVkY6ve5r78OwM4SwHdM2RrLnyH0M0jfzP2bd7K7i yL0P22/AozprQOtaSDRmzG/nkAHLuBGTJmIL9rJhe9dKi38dEy7ktV8mdo4adXIwaOcj X76CZSmdhZmUowkm8dAaFRoomc7AxZ0O+Od/L8ObOtU92s/Yjvutr4u0y6PAJkmRzBSd /olw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=789edMDauOWZHbsNILLacYVL9cPRbrYiExCSkLdLCNY=; b=jeQpORnOyk6s2vssRiXg1cd0+OaF6rwaASstmrKC3cfDph0QcNyhNErJHNKIoQZfIu 4d2eCvizKJnaqCT7im+taJ0zQ4lvOtttngLEk+wlRI4AxDB9R3qAJWvllgRGOjZkg0Rb RukkeCIvBcXewgAGl5WsqCDExkgePEIjwdtGAyqrpDUh+EbJMUWpFX8U0sNPW8HI00C3 Ops7bwUZFOOdDwLZvi3gqHpUFU/bZUhPJkFJyXeE42ivcYouutxZ/QxOV+b0jMslcvkc eEjsF8c8xCnv02ILuGuXsrxwql06F6AiaI7iZNtGx8vZDXMSuE59NDPBr0P1m2pdC4ny TEiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=oUv7LJ/m; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a49si1311437qtc.359.2017.08.28.15.12.46 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Aug 2017 15:12:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=oUv7LJ/m; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:41622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmSGy-0005I3-Jb for patch@linaro.org; Mon, 28 Aug 2017 18:12:44 -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) 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) 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) From: minyard@acm.org To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , 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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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édric Le Goater --- hw/ipmi/ipmi_bmc_sim.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) -- 2.7.4 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 @@ #define IPMI_NETFN_SENSOR_EVENT 0x04 +#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 = now.tv_sec - ((long) val); } +static void platform_event_msg(IPMIBmcSim *ibs, + uint8_t *cmd, unsigned int cmd_len, + RspBuffer *rsp) +{ + uint8_t event[16]; + + event[2] = 2; /* System event record */ + event[7] = cmd[2]; /* Generator ID */ + event[8] = 0; + event[9] = cmd[3]; /* EvMRev */ + event[10] = cmd[4]; /* Sensor type */ + event[11] = cmd[5]; /* Sensor number */ + event[12] = cmd[6]; /* Event dir / Event type */ + event[13] = cmd[7]; /* Event data 1 */ + event[14] = cmd[8]; /* Event data 2 */ + event[15] = 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 = { }; static const IPMICmdHandler sensor_event_cmds[] = { + [IPMI_CMD_PLATFORM_EVENT_MSG] = { platform_event_msg, 10 }, [IPMI_CMD_SET_SENSOR_EVT_ENABLE] = { set_sensor_evt_enable, 4 }, [IPMI_CMD_GET_SENSOR_EVT_ENABLE] = { get_sensor_evt_enable, 3 }, [IPMI_CMD_REARM_SENSOR_EVTS] = { rearm_sensor_evts, 4 },