Skip to content

Commit

Permalink
SMBIOS: Fix type 17 field sizes
Browse files Browse the repository at this point in the history
Fields for configured_clock_speed and various voltage values
introduced in spec v2.7+ should be "word", i.e. 16 bits.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
gsomlo authored and mstsirkin committed May 21, 2014
1 parent 8435184 commit 0d73394
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions hw/i386/smbios.c
Expand Up @@ -683,10 +683,10 @@ static void smbios_build_type_17_table(unsigned instance, ram_addr_t size)
SMBIOS_TABLE_SET_STR(17, asset_tag_number_str, type17.asset);
SMBIOS_TABLE_SET_STR(17, part_number_str, type17.part);
t->attributes = 0; /* Unknown */
t->configured_clock_speed = cpu_to_le32(0); /* Unknown */
t->minimum_voltage = cpu_to_le32(0); /* Unknown */
t->maximum_voltage = cpu_to_le32(0); /* Unknown */
t->configured_voltage = cpu_to_le32(0); /* Unknown */
t->configured_clock_speed = cpu_to_le16(0); /* Unknown */
t->minimum_voltage = cpu_to_le16(0); /* Unknown */
t->maximum_voltage = cpu_to_le16(0); /* Unknown */
t->configured_voltage = cpu_to_le16(0); /* Unknown */

SMBIOS_BUILD_TABLE_POST;
}
Expand Down
8 changes: 4 additions & 4 deletions include/hw/i386/smbios.h
Expand Up @@ -182,10 +182,10 @@ struct smbios_type_17 {
uint8_t part_number_str;
uint8_t attributes;
uint32_t extended_size;
uint32_t configured_clock_speed;
uint32_t minimum_voltage;
uint32_t maximum_voltage;
uint32_t configured_voltage;
uint16_t configured_clock_speed;
uint16_t minimum_voltage;
uint16_t maximum_voltage;
uint16_t configured_voltage;
} QEMU_PACKED;

/* SMBIOS type 19 - Memory Array Mapped Address (v2.7) */
Expand Down

0 comments on commit 0d73394

Please sign in to comment.