From patchwork Thu Dec 7 21:30:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 121080 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8887513qgn; Thu, 7 Dec 2017 13:33:28 -0800 (PST) X-Google-Smtp-Source: AGs4zMamPZOEZGGiMMVXkpHjdQNTbdhUDDbVgER15nqsdbwO73zhO5dUvr6h0ubFHL39WBpIF9d+ X-Received: by 10.129.101.138 with SMTP id z132mr19055011ywb.43.1512682408598; Thu, 07 Dec 2017 13:33:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512682408; cv=none; d=google.com; s=arc-20160816; b=u3j5dIwxwjMHk77ymXgz+xbBKQ879JLizfRhOptEj/V+erv6o8Ya96i61m9+/tQTpt 9ofvaj/z7eakvra4+qK8QkSUkqtseNQ+wOlHsrGPrBvYeYYlskKcl+g7GTc3zxEQtkn2 JjzS7Zl3aCpzQsdpE7MoTDsIoEr6ZPLrJ9P7SMmmSNrFtl16oKUJyNaK9xW9Bc0hsp52 G225llykCayX9e2CKXQHekaO9POUrlt+LnLFWpuvz7xP6B5+iPIv291WvLNonjNNOCR8 Fl3BdC+19rmHx0Mf9PK3y6tssdFplkU/SwzIuX0XIFMC9rtd2V16fQNwhWniIJql7FUc JR/A== 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=q3TtOI5kLa0ceVfLj2x0ikL3H3la6/C/wp8cLDhhk6NCy0j8Xp8hX5PY3ejNSq8qYk hK+Mv2vejEnmJvS8r8urK1yS0JZtQiHTFuiw7thDIdcuQk0BPF8dNRiI7BfnxUAFWNhw dlNrCrTSdRXrCtFfW83dTUIUWJZ2w/znYbAxKZ5uT/QGGcPWtI7ktJXfVl19Dz26inDh 4ZEE7wbS3YOXVaUqkUSVRN8ecxQlE/fYXt0+Pzuwzfb15saJRdpVnZm0xo1NGXCElj2R xRXZ0pG3e2i4xhK2rOfb6RYclDN2axOYh5V6XtM7RiK8j9CeKLW+5RCnV+Gzer0C4BkQ mEMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=UXUEolZn; 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 190si1311918ybi.585.2017.12.07.13.33.28 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Dec 2017 13:33:28 -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=UXUEolZn; 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]:34409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eN3nM-0006hn-3L for patch@linaro.org; Thu, 07 Dec 2017 16:33:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eN3kS-0005YW-OZ for qemu-devel@nongnu.org; Thu, 07 Dec 2017 16:30:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eN3kQ-0001w4-IM for qemu-devel@nongnu.org; Thu, 07 Dec 2017 16:30:27 -0500 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:44678) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eN3kP-0001vK-TA for qemu-devel@nongnu.org; Thu, 07 Dec 2017 16:30:26 -0500 Received: by mail-pg0-x243.google.com with SMTP id j9so5352150pgc.11 for ; Thu, 07 Dec 2017 13:30:25 -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=UXUEolZncxDn0BUGaWiGJEazVdhyzLRRERMw/C1HqucXd3LFJinv9N2+aPmO+NhEBe 6gtK0Gr183CY0WywSKh8IgU0gpi92zZSbkf567PDKQEavOwph7pM4uN1UGVICXUyDlZ4 9wIDtXxOUoaClfkUyFtQgyHmPZ5MoxwByOBvNBos1a+PDVwLnWuk16nz03yhypXwDgOU 1ZNi9lPOr5PVo8SPDdwwQLEt27MuXiNu6h5GLwpH1JQdMeCzeN5XAuAtsH0O/xT9Pw4I fptxwWLKmC2Ac3mYgY/ZQ0UK8TrsU6U83KQD/cqQDnyrUq1pTLTgZCuI9OznwtKqHXgI +KkQ== 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=LxBa8Dpbt2JCJpQyQkwDKad/xr0k7AZmwjPHdWgs7j3ZZu1+w09JBSPifIZewSJFjH aYAThEyrBRxPnrKI2xOX9emG9nLH4Ptdv6IMCRCWBc0YcnoOupQEZHopVGMHJ3w22j7q 4NxygBaZBT3RHoeQvPmHlkeoMbuShjO6Gm7IkLuJkGiI+apvDaqx9YGt/PC1dZgBwxPt PSPzabhhk4/tMN9lJhnaZm9gXv6haXt7UTZUee91YiprJ+QuOOe2GtYP8uria/lNg9C0 ypMqLqlxQjpXW9DlPKkGefrMBdpz37NmsZ69Uw+e+EgJ3lUfaoZ5UDDiPW1eU0Q5Y5JC OMZA== X-Gm-Message-State: AJaThX5nQXTAkFBLhHDGiQw7026DUhIxGxOZ1mK4zz4e+jN4XHgzLcas A0LX1r050I/hZZouezJZVD4NJp0= X-Received: by 10.99.121.4 with SMTP id u4mr27365483pgc.235.1512682224805; Thu, 07 Dec 2017 13:30:24 -0800 (PST) Received: from serve.minyard.net ([47.184.168.85]) by smtp.gmail.com with ESMTPSA id o184sm9349744pga.3.2017.12.07.13.30.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2017 13:30:23 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id A7F42B76; Thu, 7 Dec 2017 15:30:20 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id 89B71302366; Thu, 7 Dec 2017 15:30:17 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Thu, 7 Dec 2017 15:30:07 -0600 Message-Id: <1512682213-4354-3-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512682213-4354-1-git-send-email-minyard@acm.org> References: <1512682213-4354-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 2/8] 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);