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);