From patchwork Sat Aug 19 21:40:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 110463 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2528762qge; Sat, 19 Aug 2017 14:41:15 -0700 (PDT) X-Received: by 10.200.38.212 with SMTP id 20mr17953768qtp.112.1503178875485; Sat, 19 Aug 2017 14:41:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503178875; cv=none; d=google.com; s=arc-20160816; b=0kxDFyY1W+vHkZD/DcmTz2myUztG8MVNzwOUkRnoV8qNgXYnrC1nRsdzVaGRloT9wm 9/EHckq2JciAl4NT2IoBVZutJwfHk/6i91OisY/8GXwSDOHmRYPrM6SnqmBsM+L7snYI FS2sDv6Y9WdZv2FbJD4cct7ssYn6yF35JVSMKfjuKIX3w5Jyv4T0hbsWXeUHw3VimgNB jr2aFc25jYXZ6PJoutUMb9F63DrS/tWL+JcJkFs0WlZiqzgLE9/Nuecko+NqmZcO1XO7 fKwYVC8FpJCc4t3z/lsvy3dVlCPV85r65mFVge5svLVuxnGvFgAQ7F67FenKXfjJzA9+ lPzA== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=Gceo575WI+St4thpyUhuA2+zA0s1j8PrafQh3G3ffuM=; b=IrHgDFZLyNObspaAeTju0guWvLNmZV2zEF+6SX6mAP44tm9gpIwS57780+Lrs6okLb lcNfZGnj8i048l3iie+avk17dQ4Te8xU92pzbUOo/koveWZ7DH7QYZ1/zrbtlaNwv/z5 wkmH6sRCh0ja+v2uYLTP1Ezd9eBFscOj0ylYsC3C645d+yb2ajLRXepACeKenosn6h2d KvakYCR/SwKrdmIwRHceho0fPtiucdbiZqZZKqDthBdiXzOAq1cd3x8v4tDjTRZJZh7r 4/gmxOemlQqlg0EJjLwTxt+qOjAUIOsG0Rt+vPU0jtwGb6io4VtZqb/umBnxQRmrb00D s9YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Ajszst3U; 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 k65si8194613qkd.252.2017.08.19.14.41.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 19 Aug 2017 14:41:15 -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=Ajszst3U; 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]:38160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djBUX-0000FW-Cw for patch@linaro.org; Sat, 19 Aug 2017 17:41:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djBUD-0000DV-AJ for qemu-devel@nongnu.org; Sat, 19 Aug 2017 17:40:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djBUB-0007Gb-DM for qemu-devel@nongnu.org; Sat, 19 Aug 2017 17:40:53 -0400 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:37961) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1djBUB-0007FT-6L for qemu-devel@nongnu.org; Sat, 19 Aug 2017 17:40:51 -0400 Received: by mail-pg0-x243.google.com with SMTP id 123so18973679pga.5 for ; Sat, 19 Aug 2017 14:40:51 -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; bh=Gceo575WI+St4thpyUhuA2+zA0s1j8PrafQh3G3ffuM=; b=Ajszst3U90YW0K0Y1cE85SqOjOjjtv7SQDQ4IgVjN4XQCM1AsnqoiKink7s0mEOZMG SOJt8z/kFUvNj1JE2Vrs5czFt8IeLZOOKwYatPwAHUVwqLpAmalT49JAfYaHag/t3s1a ejllSEQ8cKPZfC3ZMNIQQAdZVHPjy8OHzHXL+fo8L9+gn73DeHHW84kQ/+jnLJSZDP3s URIKaEhOcl3O0CNLNU6Hv0+BTSffa8Q634bDRxI22WqPP3kMBbhzZkRmY+0ybVFL0OX3 mdX0T3BpenFRqrR8mK4/vwmEV5eXBUykZr2qzMbqGd0i+6QWwVZcnYhzEiLAd7vd86I4 TeIg== 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; bh=Gceo575WI+St4thpyUhuA2+zA0s1j8PrafQh3G3ffuM=; b=U0LLjI3MC2dkWxEmQGfVJ1lRBfrBHSq2Kvaxdc0NgLly9nzlfEhZKX7Ji8gIXBI326 dqA7BIr67GvpvEFsg8EiUTobGVVy6CaTeqMG93BsQKinOuuLTp7RAlIrdP5pzVdmnHbm h8IkW7tVf8bSTPXQCAqLuE80DUjgVpjRyBTtBlP5u4m58uJPySEdaTTx7e6pYZhCooiF sVHc712HeFA4TXecA/j6Ezrxj/si4UgmkxWPndSscGRhQs6pbDHbqhEbL213Tv1ymidD 4QMzu/z/uXVO2NzdYKiHtDX/EhCsdBF5WT85QOcNMU+wQf5UPTcacyd6snm9ZSRJcEFZ 68nQ== X-Gm-Message-State: AHYfb5jlWfJkTmX4mWw9q7PESWwEkkqnYR+MMxf5+DKJbPKRaPjaQPh4 w5Ype0O0an+zgQ== X-Received: by 10.84.231.140 with SMTP id g12mr14497038plk.256.1503178850176; Sat, 19 Aug 2017 14:40:50 -0700 (PDT) Received: from serve.minyard.net ([47.184.154.34]) by smtp.gmail.com with ESMTPSA id d86sm17531478pfk.43.2017.08.19.14.40.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Aug 2017 14:40:49 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id EC44195F; Sat, 19 Aug 2017 16:40:44 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 3E3B1300013; Sat, 19 Aug 2017 16:40:42 -0500 (CDT) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Sat, 19 Aug 2017 16:40:38 -0500 Message-Id: <1503178840-21512-2-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503178840-21512-1-git-send-email-minyard@acm.org> References: <1503178840-21512-1-git-send-email-minyard@acm.org> 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 1/3] ipmi: Fix SEL get/set time commands 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 The minimum message size was wrong for both commands, for getting the time it's zero and for setting the time it's 4. And the data was being pulled from the wrong place in the set time message, it should be the first four bytes. Signed-off-by: Corey Minyard --- hw/ipmi/ipmi_bmc_sim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index 277c28c..1c732aa 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -1571,7 +1571,7 @@ static void set_sel_time(IPMIBmcSim *ibs, uint32_t val; struct ipmi_time now; - val = cmd[2] | (cmd[3] << 8) | (cmd[4] << 16) | (cmd[5] << 24); + val = cmd[0] | (cmd[1] << 8) | (cmd[2] << 16) | (cmd[3] << 24); ipmi_gettime(&now); ibs->sel.time_offset = now.tv_sec - ((long) val); } @@ -1802,8 +1802,8 @@ static const IPMICmdHandler storage_cmds[] = { [IPMI_CMD_GET_SEL_ENTRY] = { get_sel_entry, 8 }, [IPMI_CMD_ADD_SEL_ENTRY] = { add_sel_entry, 18 }, [IPMI_CMD_CLEAR_SEL] = { clear_sel, 8 }, - [IPMI_CMD_GET_SEL_TIME] = { get_sel_time, 6 }, - [IPMI_CMD_SET_SEL_TIME] = { set_sel_time }, + [IPMI_CMD_GET_SEL_TIME] = { get_sel_time }, + [IPMI_CMD_SET_SEL_TIME] = { set_sel_time, 4 }, }; static const IPMINetfn storage_netfn = {