qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 3/7] ipmi: Don't set the timestamp on add events that don't have it
  2018-01-16  0:57 [Qemu-devel] [PATCH v2] " minyard
@ 2018-01-16  0:57 ` minyard
  0 siblings, 0 replies; 10+ messages in thread
From: minyard @ 2018-01-16  0:57 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Cédric Le Goater, Eric Blake,
	Corey Minyard

From: Corey Minyard <cminyard@mvista.com>

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 <cminyard@mvista.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
---
 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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Qemu-devel] [PULL 0/7] Small IPMI fixes
@ 2018-02-01 18:52 minyard
  2018-02-01 18:52 ` [Qemu-devel] [PATCH 1/7] Add maintainer for the IPMI code minyard
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: minyard @ 2018-02-01 18:52 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel

The following changes since commit 6521130b0a7f699fdb82446d57df5627bfa7ed3c:

  Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2018-01-26-2' into staging (2018-01-30 15:20:01 +0000)

are available in the git repository at:

  https://github.com/cminyard/qemu.git tags/for-release-20180201

for you to fetch changes up to 20b233641d76cc1812064304798ffeb530dc112d:

  ipmi: Allow BMC device properties to be set (2018-01-30 15:52:53 -0600)

----------------------------------------------------------------
Lots of litte miscellaneous fixes for the IPMI code, plus
add me as the IPMI maintainer.

----------------------------------------------------------------
Corey Minyard (7):
      Add maintainer for the IPMI code
      ipmi: Fix SEL get/set time commands
      ipmi: Don't set the timestamp on add events that don't have it
      ipmi: Add the platform event message command
      ipmi: Fix macro issues
      ipmi: disable IRQ and ATN on an external disconnect
      ipmi: Allow BMC device properties to be set

 MAINTAINERS               |  9 ++++++++
 hw/ipmi/ipmi_bmc_extern.c |  5 ++++
 hw/ipmi/ipmi_bmc_sim.c    | 58 ++++++++++++++++++++++++++++++++++++++---------
 hw/ipmi/isa_ipmi_bt.c     | 12 +++++-----
 4 files changed, 67 insertions(+), 17 deletions(-)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] [PATCH 1/7] Add maintainer for the IPMI code
  2018-02-01 18:52 [Qemu-devel] [PULL 0/7] Small IPMI fixes minyard
@ 2018-02-01 18:52 ` minyard
  2018-02-01 18:52 ` [Qemu-devel] [PATCH 2/7] ipmi: Fix SEL get/set time commands minyard
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: minyard @ 2018-02-01 18:52 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Corey Minyard

From: Corey Minyard <cminyard@mvista.com>

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index fe39b30..192d8b8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -940,6 +940,15 @@ F: tests/ahci-test.c
 F: tests/libqos/ahci*
 T: git git://github.com/jnsnow/qemu.git ide
 
+IPMI
+M: Corey Minyard <minyard@acm.org>
+S: Maintained
+F: include/hw/ipmi/*
+F: hw/ipmi/*
+F: hw/smbios/smbios_type_38.c
+F: tests/ipmi*
+T: git git://github.com/cminyard/qemu.git master-ipmi-rebase
+
 Floppy
 M: John Snow <jsnow@redhat.com>
 L: qemu-block@nongnu.org
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Qemu-devel] [PATCH 2/7] ipmi: Fix SEL get/set time commands
  2018-02-01 18:52 [Qemu-devel] [PULL 0/7] Small IPMI fixes minyard
  2018-02-01 18:52 ` [Qemu-devel] [PATCH 1/7] Add maintainer for the IPMI code minyard
@ 2018-02-01 18:52 ` minyard
  2018-02-01 18:52 ` [Qemu-devel] [PATCH 3/7] ipmi: Don't set the timestamp on add events that don't have it minyard
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: minyard @ 2018-02-01 18:52 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Corey Minyard

From: Corey Minyard <cminyard@mvista.com>

The minimum message size was on the wrong commands, for getting
the time it's zero and for setting the time it's 6.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 hw/ipmi/ipmi_bmc_sim.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c
index 277c28c..cc068f2 100644
--- a/hw/ipmi/ipmi_bmc_sim.c
+++ b/hw/ipmi/ipmi_bmc_sim.c
@@ -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, 6 },
 };
 
 static const IPMINetfn storage_netfn = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Qemu-devel] [PATCH 3/7] ipmi: Don't set the timestamp on add events that don't have it
  2018-02-01 18:52 [Qemu-devel] [PULL 0/7] Small IPMI fixes minyard
  2018-02-01 18:52 ` [Qemu-devel] [PATCH 1/7] Add maintainer for the IPMI code minyard
  2018-02-01 18:52 ` [Qemu-devel] [PATCH 2/7] ipmi: Fix SEL get/set time commands minyard
@ 2018-02-01 18:52 ` minyard
  2018-02-01 18:52 ` [Qemu-devel] [PATCH 4/7] ipmi: Add the platform event message command minyard
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: minyard @ 2018-02-01 18:52 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Corey Minyard

From: Corey Minyard <cminyard@mvista.com>

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 <cminyard@mvista.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
---
 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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Qemu-devel] [PATCH 4/7] ipmi: Add the platform event message command
  2018-02-01 18:52 [Qemu-devel] [PULL 0/7] Small IPMI fixes minyard
                   ` (2 preceding siblings ...)
  2018-02-01 18:52 ` [Qemu-devel] [PATCH 3/7] ipmi: Don't set the timestamp on add events that don't have it minyard
@ 2018-02-01 18:52 ` minyard
  2018-02-01 18:53 ` [Qemu-devel] [PATCH 5/7] ipmi: Fix macro issues minyard
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: minyard @ 2018-02-01 18:52 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Corey Minyard

From: Corey Minyard <cminyard@mvista.com>

This lets an event be added to the SEL as if a sensor had generated
it.  The OpenIPMI driver uses it for storing panic event information.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
---
 hw/ipmi/ipmi_bmc_sim.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c
index a0bbfd5..e84d710 100644
--- a/hw/ipmi/ipmi_bmc_sim.c
+++ b/hw/ipmi/ipmi_bmc_sim.c
@@ -38,6 +38,7 @@
 
 #define IPMI_NETFN_SENSOR_EVENT       0x04
 
+#define IPMI_CMD_PLATFORM_EVENT_MSG       0x02
 #define IPMI_CMD_SET_SENSOR_EVT_ENABLE    0x28
 #define IPMI_CMD_GET_SENSOR_EVT_ENABLE    0x29
 #define IPMI_CMD_REARM_SENSOR_EVTS        0x2a
@@ -1581,6 +1582,28 @@ static void set_sel_time(IPMIBmcSim *ibs,
     ibs->sel.time_offset = now.tv_sec - ((long) val);
 }
 
+static void platform_event_msg(IPMIBmcSim *ibs,
+                               uint8_t *cmd, unsigned int cmd_len,
+                               RspBuffer *rsp)
+{
+    uint8_t event[16];
+
+    event[2] = 2; /* System event record */
+    event[7] = cmd[2]; /* Generator ID */
+    event[8] = 0;
+    event[9] = cmd[3]; /* EvMRev */
+    event[10] = cmd[4]; /* Sensor type */
+    event[11] = cmd[5]; /* Sensor number */
+    event[12] = cmd[6]; /* Event dir / Event type */
+    event[13] = cmd[7]; /* Event data 1 */
+    event[14] = cmd[8]; /* Event data 2 */
+    event[15] = cmd[9]; /* Event data 3 */
+
+    if (sel_add_event(ibs, event)) {
+        rsp_buffer_set_error(rsp, IPMI_CC_OUT_OF_SPACE);
+    }
+}
+
 static void set_sensor_evt_enable(IPMIBmcSim *ibs,
                                   uint8_t *cmd, unsigned int cmd_len,
                                   RspBuffer *rsp)
@@ -1757,6 +1780,7 @@ static const IPMINetfn chassis_netfn = {
 };
 
 static const IPMICmdHandler sensor_event_cmds[] = {
+    [IPMI_CMD_PLATFORM_EVENT_MSG] = { platform_event_msg, 10 },
     [IPMI_CMD_SET_SENSOR_EVT_ENABLE] = { set_sensor_evt_enable, 4 },
     [IPMI_CMD_GET_SENSOR_EVT_ENABLE] = { get_sensor_evt_enable, 3 },
     [IPMI_CMD_REARM_SENSOR_EVTS] = { rearm_sensor_evts, 4 },
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Qemu-devel] [PATCH 5/7] ipmi: Fix macro issues
  2018-02-01 18:52 [Qemu-devel] [PULL 0/7] Small IPMI fixes minyard
                   ` (3 preceding siblings ...)
  2018-02-01 18:52 ` [Qemu-devel] [PATCH 4/7] ipmi: Add the platform event message command minyard
@ 2018-02-01 18:53 ` minyard
  2018-02-01 18:53 ` [Qemu-devel] [PATCH 6/7] ipmi: disable IRQ and ATN on an external disconnect minyard
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: minyard @ 2018-02-01 18:53 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Corey Minyard

From: Corey Minyard <cminyard@mvista.com>

Macro parameters should almost always have () around them when used.
llvm reported an error on this.

Remove redundant parenthesis and put parenthesis around the entire
macros with assignments in case they are used in an expression.

The macros were doing ((v) & 1) for a binary input, but that only works
if v == 0 or if v & 1.  Changed to !!(v) so they work for all values.

Remove some unused macros.

Reported in https://bugs.launchpad.net/bugs/1651167

An audit of these changes found no semantic changes; this is just
cleanups for proper style and to avoid a compiler warning.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 hw/ipmi/isa_ipmi_bt.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c
index e098fd5..e946030 100644
--- a/hw/ipmi/isa_ipmi_bt.c
+++ b/hw/ipmi/isa_ipmi_bt.c
@@ -45,21 +45,21 @@
 #define IPMI_BT_B2H_ATN_MASK       (1 << IPMI_BT_B2H_ATN_BIT)
 #define IPMI_BT_GET_B2H_ATN(d)     (((d) >> IPMI_BT_B2H_ATN_BIT) & 0x1)
 #define IPMI_BT_SET_B2H_ATN(d, v)  ((d) = (((d) & ~IPMI_BT_B2H_ATN_MASK) | \
-                                        (((v) & 1) << IPMI_BT_B2H_ATN_BIT)))
+                                        (!!(v) << IPMI_BT_B2H_ATN_BIT)))
 
 #define IPMI_BT_SMS_ATN_MASK       (1 << IPMI_BT_SMS_ATN_BIT)
 #define IPMI_BT_GET_SMS_ATN(d)     (((d) >> IPMI_BT_SMS_ATN_BIT) & 0x1)
 #define IPMI_BT_SET_SMS_ATN(d, v)  ((d) = (((d) & ~IPMI_BT_SMS_ATN_MASK) | \
-                                        (((v) & 1) << IPMI_BT_SMS_ATN_BIT)))
+                                        (!!(v) << IPMI_BT_SMS_ATN_BIT)))
 
 #define IPMI_BT_HBUSY_MASK         (1 << IPMI_BT_HBUSY_BIT)
 #define IPMI_BT_GET_HBUSY(d)       (((d) >> IPMI_BT_HBUSY_BIT) & 0x1)
 #define IPMI_BT_SET_HBUSY(d, v)    ((d) = (((d) & ~IPMI_BT_HBUSY_MASK) | \
-                                       (((v) & 1) << IPMI_BT_HBUSY_BIT)))
+                                       (!!(v) << IPMI_BT_HBUSY_BIT)))
 
 #define IPMI_BT_BBUSY_MASK         (1 << IPMI_BT_BBUSY_BIT)
 #define IPMI_BT_SET_BBUSY(d, v)    ((d) = (((d) & ~IPMI_BT_BBUSY_MASK) | \
-                                       (((v) & 1) << IPMI_BT_BBUSY_BIT)))
+                                       (!!(v) << IPMI_BT_BBUSY_BIT)))
 
 
 /* Mask register */
@@ -69,12 +69,12 @@
 #define IPMI_BT_B2H_IRQ_EN_MASK      (1 << IPMI_BT_B2H_IRQ_EN_BIT)
 #define IPMI_BT_GET_B2H_IRQ_EN(d)    (((d) >> IPMI_BT_B2H_IRQ_EN_BIT) & 0x1)
 #define IPMI_BT_SET_B2H_IRQ_EN(d, v) ((d) = (((d) & ~IPMI_BT_B2H_IRQ_EN_MASK) |\
-                                        (((v) & 1) << IPMI_BT_B2H_IRQ_EN_BIT)))
+                                        (!!(v) << IPMI_BT_B2H_IRQ_EN_BIT)))
 
 #define IPMI_BT_B2H_IRQ_MASK         (1 << IPMI_BT_B2H_IRQ_BIT)
 #define IPMI_BT_GET_B2H_IRQ(d)       (((d) >> IPMI_BT_B2H_IRQ_BIT) & 0x1)
 #define IPMI_BT_SET_B2H_IRQ(d, v)    ((d) = (((d) & ~IPMI_BT_B2H_IRQ_MASK) | \
-                                        (((v) & 1) << IPMI_BT_B2H_IRQ_BIT)))
+                                        (!!(v) << IPMI_BT_B2H_IRQ_BIT)))
 
 typedef struct IPMIBT {
     IPMIBmc *bmc;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Qemu-devel] [PATCH 6/7] ipmi: disable IRQ and ATN on an external disconnect
  2018-02-01 18:52 [Qemu-devel] [PULL 0/7] Small IPMI fixes minyard
                   ` (4 preceding siblings ...)
  2018-02-01 18:53 ` [Qemu-devel] [PATCH 5/7] ipmi: Fix macro issues minyard
@ 2018-02-01 18:53 ` minyard
  2018-02-01 18:53 ` [Qemu-devel] [PATCH 7/7] ipmi: Allow BMC device properties to be set minyard
  2018-02-02 14:52 ` [Qemu-devel] [PULL 0/7] Small IPMI fixes Peter Maydell
  7 siblings, 0 replies; 10+ messages in thread
From: minyard @ 2018-02-01 18:53 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Corey Minyard

From: Corey Minyard <cminyard@mvista.com>

Otherwise there's no way to clear them without an external command,
and it could lock the OS in the VM if they were stuck.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/ipmi/ipmi_bmc_extern.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c
index 8c0535d..bf0b7ee 100644
--- a/hw/ipmi/ipmi_bmc_extern.c
+++ b/hw/ipmi/ipmi_bmc_extern.c
@@ -425,6 +425,11 @@ static void chr_event(void *opaque, int event)
             return;
         }
         ibe->connected = false;
+        /*
+         * Don't hang the OS trying to handle the ATN bit, other end will
+         * resend on a reconnect.
+         */
+        k->set_atn(s, 0, 0);
         if (ibe->waiting_rsp) {
             ibe->waiting_rsp = false;
             ibe->inbuf[1] = ibe->outbuf[1] | 0x04;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Qemu-devel] [PATCH 7/7] ipmi: Allow BMC device properties to be set
  2018-02-01 18:52 [Qemu-devel] [PULL 0/7] Small IPMI fixes minyard
                   ` (5 preceding siblings ...)
  2018-02-01 18:53 ` [Qemu-devel] [PATCH 6/7] ipmi: disable IRQ and ATN on an external disconnect minyard
@ 2018-02-01 18:53 ` minyard
  2018-02-02 14:52 ` [Qemu-devel] [PULL 0/7] Small IPMI fixes Peter Maydell
  7 siblings, 0 replies; 10+ messages in thread
From: minyard @ 2018-02-01 18:53 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Corey Minyard

From: Corey Minyard <cminyard@mvista.com>

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 hw/ipmi/ipmi_bmc_sim.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c
index e84d710..9b509f8 100644
--- a/hw/ipmi/ipmi_bmc_sim.c
+++ b/hw/ipmi/ipmi_bmc_sim.c
@@ -214,8 +214,8 @@ struct IPMIBmcSim {
     uint8_t device_rev;
     uint8_t fwrev1;
     uint8_t fwrev2;
-    uint8_t mfg_id[3];
-    uint8_t product_id[2];
+    uint32_t mfg_id;
+    uint16_t product_id;
 
     uint8_t restart_cause;
 
@@ -867,11 +867,11 @@ static void get_device_id(IPMIBmcSim *ibs,
     rsp_buffer_push(rsp, ibs->fwrev2);
     rsp_buffer_push(rsp, ibs->ipmi_version);
     rsp_buffer_push(rsp, 0x07); /* sensor, SDR, and SEL. */
-    rsp_buffer_push(rsp, ibs->mfg_id[0]);
-    rsp_buffer_push(rsp, ibs->mfg_id[1]);
-    rsp_buffer_push(rsp, ibs->mfg_id[2]);
-    rsp_buffer_push(rsp, ibs->product_id[0]);
-    rsp_buffer_push(rsp, ibs->product_id[1]);
+    rsp_buffer_push(rsp, ibs->mfg_id & 0xff);
+    rsp_buffer_push(rsp, (ibs->mfg_id >> 8) & 0xff);
+    rsp_buffer_push(rsp, (ibs->mfg_id >> 16) & 0xff);
+    rsp_buffer_push(rsp, ibs->product_id & 0xff);
+    rsp_buffer_push(rsp, (ibs->product_id >> 8) & 0xff);
 }
 
 static void set_global_enables(IPMIBmcSim *ibs, uint8_t val)
@@ -1997,6 +1997,13 @@ static Property ipmi_sim_properties[] = {
     DEFINE_PROP_UINT16("fruareasize", IPMIBmcSim, fru.areasize, 1024),
     DEFINE_PROP_STRING("frudatafile", IPMIBmcSim, fru.filename),
     DEFINE_PROP_STRING("sdrfile", IPMIBmcSim, sdr_filename),
+    DEFINE_PROP_UINT8("device_id", IPMIBmcSim, device_id, 0x20),
+    DEFINE_PROP_UINT8("ipmi_version", IPMIBmcSim, ipmi_version, 0x02),
+    DEFINE_PROP_UINT8("device_rev", IPMIBmcSim, device_rev, 0),
+    DEFINE_PROP_UINT8("fwrev1", IPMIBmcSim, fwrev1, 0),
+    DEFINE_PROP_UINT8("fwrev2", IPMIBmcSim, fwrev2, 0),
+    DEFINE_PROP_UINT32("mfg_id", IPMIBmcSim, mfg_id, 0),
+    DEFINE_PROP_UINT16("product_id", IPMIBmcSim, product_id, 0),
     DEFINE_PROP_END_OF_LIST(),
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PULL 0/7] Small IPMI fixes
  2018-02-01 18:52 [Qemu-devel] [PULL 0/7] Small IPMI fixes minyard
                   ` (6 preceding siblings ...)
  2018-02-01 18:53 ` [Qemu-devel] [PATCH 7/7] ipmi: Allow BMC device properties to be set minyard
@ 2018-02-02 14:52 ` Peter Maydell
  7 siblings, 0 replies; 10+ messages in thread
From: Peter Maydell @ 2018-02-02 14:52 UTC (permalink / raw)
  To: Corey Minyard; +Cc: QEMU Developers

On 1 February 2018 at 18:52,  <minyard@acm.org> wrote:
> The following changes since commit 6521130b0a7f699fdb82446d57df5627bfa7ed3c:
>
>   Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2018-01-26-2' into staging (2018-01-30 15:20:01 +0000)
>
> are available in the git repository at:
>
>   https://github.com/cminyard/qemu.git tags/for-release-20180201
>
> for you to fetch changes up to 20b233641d76cc1812064304798ffeb530dc112d:
>
>   ipmi: Allow BMC device properties to be set (2018-01-30 15:52:53 -0600)
>
> ----------------------------------------------------------------
> Lots of litte miscellaneous fixes for the IPMI code, plus
> add me as the IPMI maintainer.
>
> ----------------------------------------------------------------

Applied, thanks.

PS: it would be useful if you could arrange to get your gpg key
signed by more people, as and when you have the opportunity for that.

-- PMM

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-02-02 14:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-01 18:52 [Qemu-devel] [PULL 0/7] Small IPMI fixes minyard
2018-02-01 18:52 ` [Qemu-devel] [PATCH 1/7] Add maintainer for the IPMI code minyard
2018-02-01 18:52 ` [Qemu-devel] [PATCH 2/7] ipmi: Fix SEL get/set time commands minyard
2018-02-01 18:52 ` [Qemu-devel] [PATCH 3/7] ipmi: Don't set the timestamp on add events that don't have it minyard
2018-02-01 18:52 ` [Qemu-devel] [PATCH 4/7] ipmi: Add the platform event message command minyard
2018-02-01 18:53 ` [Qemu-devel] [PATCH 5/7] ipmi: Fix macro issues minyard
2018-02-01 18:53 ` [Qemu-devel] [PATCH 6/7] ipmi: disable IRQ and ATN on an external disconnect minyard
2018-02-01 18:53 ` [Qemu-devel] [PATCH 7/7] ipmi: Allow BMC device properties to be set minyard
2018-02-02 14:52 ` [Qemu-devel] [PULL 0/7] Small IPMI fixes Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2018-01-16  0:57 [Qemu-devel] [PATCH v2] " minyard
2018-01-16  0:57 ` [Qemu-devel] [PATCH 3/7] ipmi: Don't set the timestamp on add events that don't have it minyard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).