From patchwork Sun Aug 20 21:46:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 110493 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp527166qge; Sun, 20 Aug 2017 14:49:25 -0700 (PDT) X-Received: by 10.200.43.103 with SMTP id 36mr2745058qtv.283.1503265765047; Sun, 20 Aug 2017 14:49:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503265765; cv=none; d=google.com; s=arc-20160816; b=nuppXq1Yj53pyN329xY1Fi/vjUtZV5gIeqE7cYlaFfDXco2x2GIPSY4OJz9bf/D2LU MwOFcULsMNu5W/DkbkcL477YuwxG/Y+fvgvTuRlwVKff/74qLSarzhu+SWYzddTPQddR V5k4HkcRYk7EWR5RpuWb033J/8L6bbL3uBDJ6h5shX2aimiflY/kTm8cfWSc+EtpzbVf 2bRVKUIFK69d6NFPkioRvZKXp0H6/LBfQUwdeSMbyYGLipu+gPrFrPcsquTdOUyJU2mV BFX/37YH3CAWGUkzYc/ZPyp81Xoy8VCgMq1P/XE0FpjJcOn3ERgbIo3lxGkq2s41Owv/ YHSA== 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=czwOPaGGmMP0cp2JlOcZ3xtVBoyviv4Ejdn8oqVPuOlSLn2BMMuDRJldTIh2sY3oA3 z77PEza70AR/iaDPvHQy9A/D9QrcVEv7W/fCk3+OIMjVlCW+ENrYrLrz5dj3w6xJ2nYO CJslQ+mG59lnkMYmx76Uh0uI8B/DA2BS4n8ILd7b6qvZaugP9VMuFUC631fsAFNrdJpM CLmsqydVnOHngdOlW0u21mGe3ILmV+xrAtd+JGkLoUml7VztYNjtS2TSUDwpv6SAgR5J 8qVvBCqT+6oWeNV2f5e9f7qNeM1FWFPL7CGyJRUbq6dJnxMZCWiu2V6SBOUPOlTFJGZa JvSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=BF0m1XnA; 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 t53si1180310qth.67.2017.08.20.14.49.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 20 Aug 2017 14:49:25 -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=BF0m1XnA; 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]:35280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djY5y-00006q-Uw for patch@linaro.org; Sun, 20 Aug 2017 17:49:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djY3e-0007Fc-8z for qemu-devel@nongnu.org; Sun, 20 Aug 2017 17:46:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djY3b-0003qQ-Ae for qemu-devel@nongnu.org; Sun, 20 Aug 2017 17:46:58 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:33784) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1djY3b-0003po-56 for qemu-devel@nongnu.org; Sun, 20 Aug 2017 17:46:55 -0400 Received: by mail-pg0-x244.google.com with SMTP id n4so5970047pgn.0 for ; Sun, 20 Aug 2017 14:46:53 -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=BF0m1XnA7UkFCelreNwiqaSOmgk/Mi+oNek0aPaBU+7zvJEJsyTeHSBNElN46aywi6 2vDtVjANzsPE2/HluPl9FdtvxUkdY6Ucv1I/GBLGjfrlvPYkWE+c0aumnbw5BpIEfrKD t2ro7ZhHF6SIgxIq1ZAzGq5S31gjh1thLmJTvKmWQ9oLEOrmWfgPIlz5xq6wyP8kunpH 3ovYnbhQGuWb8zyrOrVNZk23WC+yBVKLEGvtSz390bjgVQjKwI1b0CI+T/JaTx1PdpQF MI+eEKTZVRQ38rndZWVzI0wuXlavXjk3yLg23Os4hhLceRgbbbrEl6/5pRqb8Y0bBHtD p0jw== 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=mzF1nLAi++AMa9j3rTrOFAa/dkDZScSYaa1GMQiQsQ4KMJueXFQ4yQmbi28v4+9Fzi ThEdfhabqrPSEXArL+uawTWduztHtS+VS0UZPrD8RhVvC0/7UOVglfZulToTsFxbFk3P 9BLaFIOEeYi3Rca7uTxq/ItrCvVfftS5NorZcHngww6r13YzmQtU6bqjyIOUdxCaJ2ft x0apT+3WqLt4FUXZTSIN6mtxypYJQwKI3Ft1tb0kZE8RfC+eyJMdb9SafCX/JNGRIgfB 0FeWQG943TurDMa9Mepg6LonFSAMlFq6DR0z38FRJPIG2/Nf3qxQK/vdOl3muzSH3/PP hoDA== X-Gm-Message-State: AHYfb5jITbpFokcWGvwBd9O92i8VM+VOIskjLbgW3OLvo368+UKVVy5T CWu72ARtgyIxrw== X-Received: by 10.99.170.3 with SMTP id e3mr14477773pgf.411.1503265612837; Sun, 20 Aug 2017 14:46:52 -0700 (PDT) Received: from serve.minyard.net ([47.184.154.34]) by smtp.gmail.com with ESMTPSA id 206sm19555197pfc.61.2017.08.20.14.46.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Aug 2017 14:46:48 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id D5A3495D; Sun, 20 Aug 2017 16:46:46 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 661D8300080; Sun, 20 Aug 2017 16:46:45 -0500 (CDT) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Sun, 20 Aug 2017 16:46:41 -0500 Message-Id: <1503265602-9349-3-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503265602-9349-1-git-send-email-minyard@acm.org> References: <1503265602-9349-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::244 Subject: [Qemu-devel] [PATCH v2 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_Le_Goater?= , 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);