From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
"Gabriel L. Somlo" <gsomlo@gmail.com>,
Gabriel Somlo <somlo@cmu.edu>,
Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PULL 04/10] SMBIOS: Fix type 17 field sizes
Date: Thu, 5 Jun 2014 20:17:19 +0300 [thread overview]
Message-ID: <1401986505-12359-5-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1401986505-12359-1-git-send-email-mst@redhat.com>
From: "Gabriel L. Somlo" <gsomlo@gmail.com>
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>
---
include/hw/i386/smbios.h | 8 ++++----
hw/i386/smbios.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/hw/i386/smbios.h b/include/hw/i386/smbios.h
index 5583f60..a3f4d88 100644
--- a/include/hw/i386/smbios.h
+++ b/include/hw/i386/smbios.h
@@ -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) */
diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c
index 1793821..b3bedde 100644
--- a/hw/i386/smbios.c
+++ b/hw/i386/smbios.c
@@ -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;
}
--
MST
next prev parent reply other threads:[~2014-06-05 17:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-05 17:17 [Qemu-devel] [PULL 00/10] pc,pci,virtio,qdev fixes, tests Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 01/10] serial-pci: Set prog interface field of pci config to 16550 compatible Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 02/10] SMBIOS: Fix endian-ness when populating multi-byte fields Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 03/10] SMBIOS: Update Type 0 struct generator for machines >= 2.1 Michael S. Tsirkin
2014-06-05 17:17 ` Michael S. Tsirkin [this message]
2014-06-05 17:17 ` [Qemu-devel] [PULL 05/10] pcie_host: Turn pcie_host_init() into an instance_init Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 06/10] virtio-balloon: return empty data when no stats are available Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 07/10] tests: rename acpi-test to bios-tables-test Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 08/10] tests: add smbios testing Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 09/10] qdev: Display warning about unused -global Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 10/10] qdev: Add test of qdev_prop_check_global Michael S. Tsirkin
2014-06-09 12:19 ` Peter Maydell
2014-06-09 13:10 ` Michael S. Tsirkin
2014-06-09 22:53 ` Eduardo Habkost
2014-06-05 21:40 ` [Qemu-devel] [PULL 00/10] pc,pci,virtio,qdev fixes, tests Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1401986505-12359-5-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=aliguori@amazon.com \
--cc=gsomlo@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=somlo@cmu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).