From patchwork Tue May 13 21:16:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 348523 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 86603140087 for ; Wed, 14 May 2014 07:17:08 +1000 (EST) Received: from localhost ([::1]:47982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkK4P-00012e-UT for incoming@patchwork.ozlabs.org; Tue, 13 May 2014 17:17:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkK3n-0008EA-NY for qemu-devel@nongnu.org; Tue, 13 May 2014 17:16:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkK3d-00058P-K9 for qemu-devel@nongnu.org; Tue, 13 May 2014 17:16:27 -0400 Received: from mail-qg0-x234.google.com ([2607:f8b0:400d:c04::234]:61754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkK3d-00058J-G3 for qemu-devel@nongnu.org; Tue, 13 May 2014 17:16:17 -0400 Received: by mail-qg0-f52.google.com with SMTP id a108so1327906qge.25 for ; Tue, 13 May 2014 14:16:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4lNrX+c4vcNNZV3/nouZT/lScdHRUAY5Fr7/r0JA5pw=; b=ew6uh4Tk9KIlFUO2P8zmzY2qqlY9SU0lhU1uJ/P1scClKowhZ/f7Yd/4bW4MQGw8WJ er4sTwcm4zLfw1o8uJl4NoRvuPbIzCXScuQuBIPwQhi08dRfkm/RozccovR0M2bViBHN ffbRNzya3ICtkpckxCuzeTmLt/Vx4IB8Y079+3XPmJAyuRxvYpFNsPn3CsYSsa3Vy000 H00zxCj70gTIiawv+TnGgNI8D1x1HzrmzZu+PZARPHsiTtF3KQGfTg+CeObqNzmwEuaS cDo0+eAIGe/GQ9K7ruhAY/vAkq1DXMYFYQdfpGWANd4dDDcxu/n7/dN8wLtyGXsj1WDI Cqig== X-Received: by 10.140.87.207 with SMTP id r73mr17446980qgd.110.1400015777062; Tue, 13 May 2014 14:16:17 -0700 (PDT) Received: from ERROL.ini.cmu.edu (ERROL.INI.CMU.EDU. [128.2.16.43]) by mx.google.com with ESMTPSA id p104sm10022478qga.31.2014.05.13.14.16.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 May 2014 14:16:16 -0700 (PDT) X-Google-Original-From: "Gabriel L. Somlo" From: "Gabriel L. Somlo" To: qemu-devel@nongnu.org Date: Tue, 13 May 2014 17:16:09 -0400 Message-Id: <1400015769-717-4-git-send-email-somlo@cmu.edu> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1400015769-717-1-git-send-email-somlo@cmu.edu> References: <1400015769-717-1-git-send-email-somlo@cmu.edu> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c04::234 Cc: pbonzini@redhat.com, lersek@redhat.com, kraxel@redhat.com Subject: [Qemu-devel] [PATCH v3 3/3] SMBIOS: Fix type 17 v2.7+ field sizes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Fields for configured_clock_speed and various voltage values introduced in v2.7 and v2.8 should be "word", i.e. 16 bits. Reported-by: Laszlo Ersek Signed-off-by: Gabriel Somlo Reviewed-by: Michael S. Tsirkin --- hw/i386/smbios.c | 8 ++++---- include/hw/i386/smbios.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) 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; } 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) */