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: 10195907 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4CDEA60380 for ; Thu, 1 Feb 2018 18:54:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28DE728BCE for ; Thu, 1 Feb 2018 18:54:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1958F28BCD; Thu, 1 Feb 2018 18:54:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6632E28BCE for ; Thu, 1 Feb 2018 18:54:47 +0000 (UTC) Received: from localhost ([::1]:54710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehK0U-0004bc-MC for patchwork-qemu-devel@patchwork.kernel.org; Thu, 01 Feb 2018 13:54:46 -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-Google-Smtp-Source: AH8x226H5Tw8hsXogeUGx+evN9li//prrJh1skDuCH6FHx5gl6ENPub1rBlZ8BcCWXQpkP/SY8TmwQ== 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);