From patchwork Thu Feb 1 18:52:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 126579 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1973976ljc; Thu, 1 Feb 2018 10:53:44 -0800 (PST) X-Google-Smtp-Source: AH8x226DOj2bByL/09o9IUSEC79/G4Pco5gGUHuuVylrctEkkBgNpRX5EBnu1k3qmQZMX8Qvn2Mw X-Received: by 10.37.133.12 with SMTP id w12mr17209907ybk.213.1517511224641; Thu, 01 Feb 2018 10:53:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517511224; cv=none; d=google.com; s=arc-20160816; b=YbdcnHvIYgkCWz0jwCZVH+CCoXUhOaR/NaMpIvtUdY/mA3DlU21y+SpJybQVmLYADr H4KV0Y2yRruEgxBXh0roe0Tf7jC8fiu+TTSYvZEzeD7fFnCzAgrpuKXOM88NyWPZw17R 3xcYD+da/Brw9DUcWRBmvF6yhVYW0PROuUbKiQK85PaXoASNtHEwoyagmTmTvp2D1F6o YiuTj1jYasPt4XBUXC4E6bYw/sWPwlE0Kj0I5RvD0BdQu0bdoqRtCJlyqKj9c4I2W1wq NvIBDrEGgLP+oEToJ/gwcdC3HpNFJfqP5cNx9udFNWo2zpcBZb6IJWhrVwZkmGx93iyF W83g== 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=uwqo5NVG6CRApG3rkfoRj6f5Rg6WyI4Ojnju1q/aWFp9czS+GgTSJZGcqs3hQvjyzh sa27MqJ4jjeiyl+nuHUSLKHXwU26BssPnuhg62+wHmxDsWddqZQ85vDEk9izInp7ejHa YXLiG8SqQx9JCn8B78uWYTGs0GrbY57g4q9z8aUqNR6FKhzpOkB4FfHIvH1NkaGz1HIS 2YYPxSRZ7rZ9ZfzZzpTLFye1tEELWt+HU5QF+fnuLDB6MOinbbgo6Dk5LtAMmzdgtCHT S+GjyLDTG7jPuuwfQK184KOv5+ziHKe8XfJFU+DwLmJoowLXXmlBigK+vbfnzVZrLXA/ NLzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=DYE2iQcw; 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 h11si44306ywm.613.2018.02.01.10.53.44 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:53:44 -0800 (PST) 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=DYE2iQcw; 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]:54682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJzT-0003IS-Va for patch@linaro.org; Thu, 01 Feb 2018 13:53:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJz0-0003Fw-E4 for qemu-devel@nongnu.org; Thu, 01 Feb 2018 13:53:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJyz-0000A6-Fg for qemu-devel@nongnu.org; Thu, 01 Feb 2018 13:53:14 -0500 Received: from mail-ot0-x242.google.com ([2607:f8b0:4003:c0f::242]:45712) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJyz-00009R-BD for qemu-devel@nongnu.org; Thu, 01 Feb 2018 13:53:13 -0500 Received: by mail-ot0-x242.google.com with SMTP id 73so8756343oti.12 for ; Thu, 01 Feb 2018 10:53:13 -0800 (PST) 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=DYE2iQcwwpjXneKhB842DlrpNfrXwUs6VCk83c3cLEpHtV3y8mOUgtvsUo0TG7HkIV nsd2F3eljEnK7UxIJgh4hCCOcQOMYT6RfTIcN/LZ2PGRms6XVmdeLHhD4Rqfcq8pLAiS 9IK5NqWxN7H2BbwDwSi+qoow46LJX1si8QKwVTS+DDO+g4Mtw4PgrEAAlSs1GHLvNdAf owi7EfoCin/HtQ0J9+satfGlOLmuL4ruDvNe2ty1BgqEvCITM/n9tEgjlqOViokKnWyU s3XH4R3yHjwg3c88fE4PhIfKOzE8SgVdyIE/j/x5G1N01yTBmikccC/vycZLmq/YRb/q mfJw== 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=EIDu2wZU4AXkWE0gewwyEJlstBQSwFw1CZEZIx72YowLP+iNTRn9THc9Hv6mOLBSKR mE+uLLV5LEjGjY3BxDOFagypEu23PLpTmWbBmz2T3MUlxZJOthhKGziRKvQM9raUvMxi BbXARB9UlCmSbK7uYFjPBu3Y7YHmc+izQvJf9XaJGMZc/9UWwAXj63vZg6RyzACM4vV1 GsIl+jYVqPA+NxUFVW/KHWmguUQey7qXvIv1/Bc1d955XDMQPaMj4V5o9HHOKuoQ3F0R a7nXSqAFZLuV6mp09viqnf1mxXhg/Nl9fuO7Sss3TcS6t5Yl9U++4oW9OzQTHTv1ZV8r 4yvA== X-Gm-Message-State: AKwxytfh3TVN+4jmceKngkgWkNiy89L/ScVO4ZldfokZMhnThAOB4A8Y C5DSaUcypcNASflcdpRJ6w== X-Received: by 10.157.89.205 with SMTP id u13mr5895132otg.339.1517511192466; Thu, 01 Feb 2018 10:53:12 -0800 (PST) Received: from serve.minyard.net (serve.minyard.net. [2001:470:b8f6:1b::1]) by smtp.gmail.com with ESMTPSA id x4sm98221oie.41.2018.02.01.10.53.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:53:11 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 2ABE0D3B; Thu, 1 Feb 2018 12:53:07 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id ECE403000A6; Thu, 1 Feb 2018 12:53:04 -0600 (CST) From: minyard@acm.org To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 1 Feb 2018 12:52:58 -0600 Message-Id: <1517511182-9944-4-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517511182-9944-1-git-send-email-minyard@acm.org> References: <1517511182-9944-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:4003:c0f::242 Subject: [Qemu-devel] [PATCH 3/7] 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 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);