From patchwork Tue Jan 16 00:57:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 124573 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp844380lje; Mon, 15 Jan 2018 17:00:42 -0800 (PST) X-Google-Smtp-Source: ACJfBosYXCgdYN3/zKXd9YpQVfK87+7ZZrCIgUI0acu/bqAoTY8cN30r5uJO7jQ0vUdTpkDypV+T X-Received: by 10.37.94.6 with SMTP id s6mr7478025ybb.323.1516064442039; Mon, 15 Jan 2018 17:00:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516064442; cv=none; d=google.com; s=arc-20160816; b=K2EElWiYUlfzHvb+OBuadH1UmaYRptW6UrLmUMOBqKTLXB1AHmTxvzzQQrfmH60cpC Yr94MPyh4TP2aJ42Jl2rSvbjxj60zGuVz5IuSPx9hS4wOS0Uea8Z6kNhohk5NxMevwiw dKTg1247oCPccpRFpKYsWvk/4cdQFNOw65JO/HQxIgK3GfCCQlTkK8ZRsx6re1S1EHhq dCDpkrFCQnuVfV75hLVXEQ/UBfch0zW8VIZ4cqS4L4OJECYgwuPkEuYgZYLxnsqvtmbS xKmNZ8JvBWJXSKuMHC4ocvoj1Q8wD2LyzitiJuJ3x7fmnd7wZ4KCDv4unP5onzKtUFsb SbtQ== 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=fvUUS/K5Si7YY3aLe/nQaxtRScm9AZyyuviDeoMQvFIpZMSIFjQ3GOSiMwXu9r7EDj CecbrIoWiT/PhuZF5Da05ficxarjRhoZKYzGRfaUDGUIO2BBoMtd03Ps+bPNiIOkb++v YK81pdylHcKWRta0EcozYS/6ec+RYf9TWyBGlnGYccSgSLPYXf3SDwU838Scosu/wMf9 6HuGmOGDYn9f47+WpDraSxNkwzHxwtddvhAU0I2lBOXkEP0N6unNDCiaJDHthx2oXkRj JYcjh9HdroG08t6V94qu3Kkc0Vf9Cma46HRQmnKHkX8nJJ3GYU4kz3c46WCdamsdSIOq oNdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Eu5y3rx6; 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 d7si204112ywb.86.2018.01.15.17.00.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 15 Jan 2018 17:00:42 -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=Eu5y3rx6; 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]:49556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebFcH-0000Oi-F0 for patch@linaro.org; Mon, 15 Jan 2018 20:00:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebFZu-0007sD-Kr for qemu-devel@nongnu.org; Mon, 15 Jan 2018 19:58:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebFZt-0000lz-Hn for qemu-devel@nongnu.org; Mon, 15 Jan 2018 19:58:14 -0500 Received: from mail-ot0-x242.google.com ([2607:f8b0:4003:c0f::242]:33988) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebFZt-0000ls-Dl for qemu-devel@nongnu.org; Mon, 15 Jan 2018 19:58:13 -0500 Received: by mail-ot0-x242.google.com with SMTP id p16so12206718otf.1 for ; Mon, 15 Jan 2018 16:58: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=Eu5y3rx6G4ZVUFhwBfOieSNVqqDsjH82Ysg08sWfGJ5T2IOgJqb46BzuYvVjy7PKkq 65FKvBWk9ndLIrR+Mj5Dtf0q5f+JQHDERxbQAZXRtfdHeiUHIzayqFYCL7jfVo/hbTP7 nANslp7r7IE6lmgWPbDmm0BASs9MP5DbJ+BJRsrcS9wqHytWKPLMLmTZK11bIc+LzHak i3ik9jvKH12cCKNyNST9ynD0djZ0XsU3jxGqFA0QIn6xo52gTyrV6CTCLNAXIuJUgYZj VF0uZjHOR8dZsx+V6BJgkD/1MDuv1csmyoNL063l5JjKinrdhSGRdkj53dDhqfUvx9Pj 5IxQ== 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=pZHla/b4L5BCdID9ALGO12RLQsQeGxTIxZ/og5GPOapem9z0FOBfH82abuzYze55LP xTuB0rCopMh0vqaqUkCx8BkVuFWgdNtehmCeMvjBFU0bxcbkPDnC/1b+iq7SUHd2G8r9 fSaJzey8zZ+oqL3F/IBj56ihrScOj41sQU9T8U61ZPAGmuG8xXiefhzpUv+f1+vw2ION Ge3UiH4uMI7mUjlcDeHiRUrLvZ9txO/R+x3wjMt5Bw0Cnj5FBE4+9UezaCkHwDSmUC5N co+Op4uAxBrIC1GVnwnTKbG6av9JjWFzy9drBhmGXJUqbaUJiwnA2M6ei1NqG6/P8Ao4 eHxA== X-Gm-Message-State: AKwxytd0OHuoHGqrandsD+B9utR2lhyfbkvo8RY7wvQ2ZhgskJ0R5dcX 63+PZDXEItLAge9f3+oFCw== X-Received: by 10.157.11.234 with SMTP id 97mr11196749oth.40.1516064292596; Mon, 15 Jan 2018 16:58:12 -0800 (PST) Received: from serve.minyard.net (serve.minyard.net. [2001:470:b8f6:1b::1]) by smtp.gmail.com with ESMTPSA id f193sm466134oih.28.2018.01.15.16.58.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jan 2018 16:58:09 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 4FF918FC; Mon, 15 Jan 2018 18:58:07 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id E06C130006F; Mon, 15 Jan 2018 18:58:04 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Mon, 15 Jan 2018 18:57:55 -0600 Message-Id: <1516064279-14816-4-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516064279-14816-1-git-send-email-minyard@acm.org> References: <1516064279-14816-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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , 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);