From nobody Fri Oct 31 03:47:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1751413550; cv=none; d=zohomail.com; s=zohoarc; b=Lgcf16EM15iC2wANBGRl99evx8LZe+IKDQBFuoHUxDb4jlt2b8VNZtPlqwOMojlQaxlsqkHmJNQydgP9PZnXmSTIprXMsbB9qT+eLpZf9dF9CV7PMYEz2E+S0G9+627X78aZ1Cm8Z9pWJDuaICpPofmO2uNE6JUO17n2/3MIiXk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751413550; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=92xZ3mXFNRETY3/2tgdNdqUaxKhMM421vmXhjEX/B/U=; b=A0/TfDNtpSiRTGIO/Rm3HgMakeIEd8s6NOni8pgzSbMu2/Sd6XLyvj7zA3ahFiHUfk64Tw6psAhIQB8yppfaBDA557UHprkh7pTpkeEB1V8ZRlExKlvD4XKqKKZuWdm1xUxEfJQszJkxVjLfAS46Ccm1fcRaDgJpyyUObNz81qc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751413550937693.1948632940566; Tue, 1 Jul 2025 16:45:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1030119.1403788 (Exim 4.92) (envelope-from ) id 1uWkfM-0000ND-4x; Tue, 01 Jul 2025 23:45:32 +0000 Received: by outflank-mailman (output) from mailman id 1030119.1403788; Tue, 01 Jul 2025 23:45:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uWkfM-0000N4-1C; Tue, 01 Jul 2025 23:45:32 +0000 Received: by outflank-mailman (input) for mailman id 1030119; Tue, 01 Jul 2025 23:45:30 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uWkfK-00085D-Sv for xen-devel@lists.xenproject.org; Tue, 01 Jul 2025 23:45:30 +0000 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [2a00:1450:4864:20::42f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 73e3a3ac-56d5-11f0-a313-13f23c93f187; Wed, 02 Jul 2025 01:45:22 +0200 (CEST) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3a524caf77eso917477f8f.3 for ; Tue, 01 Jul 2025 16:45:22 -0700 (PDT) Received: from lab.home (dynamic-2a00-1028-83a4-4bca-c0bb-96ff-feed-9d50.ipv6.o2.cz. [2a00:1028:83a4:4bca:c0bb:96ff:feed:9d50]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a87e947431sm14509037f8f.0.2025.07.01.16.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jul 2025 16:45:20 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 73e3a3ac-56d5-11f0-a313-13f23c93f187 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751413521; x=1752018321; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=92xZ3mXFNRETY3/2tgdNdqUaxKhMM421vmXhjEX/B/U=; b=DKliCH74jV/m80lT4ZLGL0mtI3BoYKFK8wvEb146fboxrLOdPeFq5I8yP8hZSyOJcl jXIUPJ4ujyC4QH9fU96sYLkPFT+heJLvJkL6/qtA5R37s2sQ1JFE5YhjXjtfwbiRbO0z 6PfptOQdRCjSnMsvyS2dHWfHTXs4PsuCDe9jRk7yJ8Q4G5p97thqfHiBSoqy3PgQk3Qs udJzRgssC8il8uHE1iMiJ8VwafEstxi2UhKb5MDZJHtxdJ7ChT/YlqDXuqlKEKjO01bM 0TiZECiDstvkw8QWpf/uzaGjiQbuAXD0NzUlwDcs/zuRE+FHeShy3Jh0FqAFbCmDYsIy 1a3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751413521; x=1752018321; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=92xZ3mXFNRETY3/2tgdNdqUaxKhMM421vmXhjEX/B/U=; b=IF8wei2alwC2+XDLp2u6hf9E8t5HuHpGOfQA0O00QT2RaATlqTWHNjlKdGmNc4OXqS X6HoYzCvpdL0X5/4Lv28slXilKecYsIvPkM7rfihP7AV3IbMNCJ3ZmSe6r8adA4XQmQ0 NiroibVUU3PZSI1206LpyfKLLfUtEcwTBJHaDXWupeNGN84hOB84jlMWtTOe4ZZe+WQP v01AAgnCgpeyy/sQzkR30qkNTzpRdzzUcN0zr6DbZBGv3mZ6AssKqCjUgBZqzQdFYOO1 3289LfAG1ZyQVWVHXFdiKKFf2G6/V8j3nd6r2gv2WD461Y+7M9jrv/IfTP1Ssd7TfC3m ySoQ== X-Gm-Message-State: AOJu0YxwVCJwt/6QBIf0nPOKHxbrqn0dVJXPvKm8HEuE8omMPaXhhTR9 +iQY08YmVgiugtJzQJOvZ8Trlu8rEVnjqA4AZRJdpmChXelXYxmOzKbIK7E5Sw== X-Gm-Gg: ASbGnctMUsx2ELEGFYlZmEV/i9zpWnAEHBf5pdeY4ZUkUEdjRMCCEt2cvobb1mQePOE Bm4KDjz4pueHShkZiwBhFPhdVxhiQV5k6AyxM9vCyVJ6YJnWDSuDRy0VXwSjSPBoI2qwaqDOcNz UROyPyDt148fvjY3gcC7IGRXHs/xbm9lVqxOBSZCe3hOmfuwTK6u0tpE6QiEXvhQaq6+GQIJuYf BrpPHhpGp5516vS2MIhEMaXPBcBY5urRqYAMzz8ATku70aLjMCc3mQlZjJs//zJmW9S5qHHhR0/ nB4c/aKeQFQmG1n/RFYQErMtY9UkMNQsJssENuiPL/csHGmgiVaBdyiqMkDqpFKshgJge1dRMGx 5UbPjiskagwto1kjFKDaM/njbyto6YFJTFeAgwqVhcj7Zpz/+O5VYdAjx9H6v6g== X-Google-Smtp-Source: AGHT+IG+5cade+22b5bcAnDmgHCu1cUKB3rMPWWhzP6eHMo5Zjn0QhHw5BpN95JqD/SrFg5lGGBS/Q== X-Received: by 2002:a05:600c:3ba7:b0:453:59b5:25cc with SMTP id 5b1f17b1804b1-454a37207a8mr2489015e9.7.1751413521270; Tue, 01 Jul 2025 16:45:21 -0700 (PDT) From: "=?UTF-8?q?Petr=20Bene=C5=A1?=" X-Google-Original-From: =?UTF-8?q?Petr=20Bene=C5=A1?= To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Petr=20Bene=C5=A1?= , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Anthony PERARD Subject: [PATCH 1/3] hvmloader: fix code style violations Date: Tue, 1 Jul 2025 23:45:10 +0000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1751413553366116600 From: Petr Bene=C5=A1 Preparatory commit. No functional change. Signed-off-by: Petr Bene=C5=A1 --- tools/firmware/hvmloader/smbios.c | 56 +++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/tools/firmware/hvmloader/smbios.c b/tools/firmware/hvmloader/s= mbios.c index 97a054e9e3..fc3cdc9a25 100644 --- a/tools/firmware/hvmloader/smbios.c +++ b/tools/firmware/hvmloader/smbios.c @@ -378,18 +378,18 @@ static void * smbios_type_0_init(void *start, const char *xen_version, uint32_t xen_major_version, uint32_t xen_minor_version) { - struct smbios_type_0 *p =3D (struct smbios_type_0 *)start; + struct smbios_type_0 *p =3D start; static const char *smbios_release_date =3D __SMBIOS_DATE__; const char *s; void *pts; uint32_t length; =20 pts =3D get_smbios_pt_struct(0, &length); - if ( (pts !=3D NULL)&&(length > 0) ) + if ( pts !=3D NULL && length > 0 ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE0; - return (start + length); + return start + length; } =20 memset(p, 0, sizeof(*p)); @@ -438,17 +438,17 @@ smbios_type_1_init(void *start, const char *xen_versi= on, uint8_t uuid[16]) { char uuid_str[37]; - struct smbios_type_1 *p =3D (struct smbios_type_1 *)start; + struct smbios_type_1 *p =3D start; const char *s; void *pts; uint32_t length; =20 pts =3D get_smbios_pt_struct(1, &length); - if ( (pts !=3D NULL)&&(length > 0) ) + if ( pts !=3D NULL && length > 0 ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE1; - return (start + length); + return start + length; } =20 memset(p, 0, sizeof(*p)); @@ -496,7 +496,7 @@ smbios_type_1_init(void *start, const char *xen_version, static void * smbios_type_2_init(void *start) { - struct smbios_type_2 *p =3D (struct smbios_type_2 *)start; + struct smbios_type_2 *p =3D start; const char *s; uint8_t *ptr; void *pts; @@ -504,7 +504,7 @@ smbios_type_2_init(void *start) unsigned int counter =3D 0; =20 pts =3D get_smbios_pt_struct(2, &length); - if ( (pts !=3D NULL)&&(length > 0) ) + if ( pts !=3D NULL && length > 0 ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE2; @@ -517,7 +517,7 @@ smbios_type_2_init(void *start) *((uint16_t*)ptr) =3D SMBIOS_HANDLE_TYPE3; } =20 - return (start + length); + return start + length; } =20 memset(p, 0, sizeof(*p)); @@ -591,18 +591,18 @@ smbios_type_2_init(void *start) static void * smbios_type_3_init(void *start) { - struct smbios_type_3 *p =3D (struct smbios_type_3 *)start; + struct smbios_type_3 *p =3D start; const char *s; void *pts; uint32_t length; uint32_t counter =3D 0; =20 pts =3D get_smbios_pt_struct(3, &length); - if ( (pts !=3D NULL)&&(length > 0) ) + if ( pts !=3D NULL && length > 0 ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE3; - return (start + length); + return start + length; } =20 memset(p, 0, sizeof(*p)); @@ -653,7 +653,7 @@ smbios_type_4_init( void *start, unsigned int cpu_number, char *cpu_manufacturer) { char buf[80];=20 - struct smbios_type_4 *p =3D (struct smbios_type_4 *)start; + struct smbios_type_4 *p =3D start; uint32_t eax, ebx, ecx, edx; =20 memset(p, 0, sizeof(*p)); @@ -704,7 +704,7 @@ smbios_type_4_init( static void * smbios_type_11_init(void *start)=20 { - struct smbios_type_11 *p =3D (struct smbios_type_11 *)start; + struct smbios_type_11 *p =3D start; char path[20]; const char *s; int i; @@ -712,11 +712,11 @@ smbios_type_11_init(void *start) uint32_t length; =20 pts =3D get_smbios_pt_struct(11, &length); - if ( (pts !=3D NULL)&&(length > 0) ) + if ( pts !=3D NULL && length > 0 ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE11; - return (start + length); + return start + length; } =20 p->header.type =3D 11; @@ -754,7 +754,7 @@ smbios_type_11_init(void *start) static void * smbios_type_16_init(void *start, uint32_t memsize, int nr_mem_devs) { - struct smbios_type_16 *p =3D (struct smbios_type_16*)start; + struct smbios_type_16 *p =3D start; =20 memset(p, 0, sizeof(*p)); =20 @@ -779,7 +779,7 @@ static void * smbios_type_17_init(void *start, uint32_t memory_size_mb, int instance) { char buf[16]; - struct smbios_type_17 *p =3D (struct smbios_type_17 *)start; + struct smbios_type_17 *p =3D start; =20 memset(p, 0, sizeof(*p)); =20 @@ -814,7 +814,7 @@ smbios_type_17_init(void *start, uint32_t memory_size_m= b, int instance) static void * smbios_type_19_init(void *start, uint32_t memory_size_mb, int instance) { - struct smbios_type_19 *p =3D (struct smbios_type_19 *)start; + struct smbios_type_19 *p =3D start; =20 memset(p, 0, sizeof(*p)); =20 @@ -836,7 +836,7 @@ smbios_type_19_init(void *start, uint32_t memory_size_m= b, int instance) static void * smbios_type_20_init(void *start, uint32_t memory_size_mb, int instance) { - struct smbios_type_20 *p =3D (struct smbios_type_20 *)start; + struct smbios_type_20 *p =3D start; =20 memset(p, 0, sizeof(*p)); =20 @@ -862,18 +862,18 @@ smbios_type_20_init(void *start, uint32_t memory_size= _mb, int instance) static void * smbios_type_22_init(void *start) { - struct smbios_type_22 *p =3D (struct smbios_type_22 *)start; + struct smbios_type_22 *p =3D start; static const char *smbios_release_date =3D __SMBIOS_DATE__; const char *s; void *pts; uint32_t length; =20 pts =3D get_smbios_pt_struct(22, &length); - if ( (pts !=3D NULL)&&(length > 0) ) + if ( pts !=3D NULL && length > 0 ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE22; - return (start + length); + return start + length; } =20 s =3D xenstore_read(HVM_XS_SMBIOS_DEFAULT_BATTERY, "0"); @@ -927,7 +927,7 @@ smbios_type_22_init(void *start) static void * smbios_type_32_init(void *start) { - struct smbios_type_32 *p =3D (struct smbios_type_32 *)start; + struct smbios_type_32 *p =3D start; =20 memset(p, 0, sizeof(*p)); =20 @@ -946,16 +946,16 @@ smbios_type_32_init(void *start) static void * smbios_type_39_init(void *start) { - struct smbios_type_39 *p =3D (struct smbios_type_39 *)start; + struct smbios_type_39 *p =3D start; void *pts; uint32_t length; =20 pts =3D get_smbios_pt_struct(39, &length); - if ( (pts !=3D NULL)&&(length > 0) ) + if ( pts !=3D NULL && length > 0 ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE39; - return (start + length); + return start + length; } =20 /* Only present when passed in */ @@ -998,7 +998,7 @@ smbios_type_vendor_oem_init(void *start) static void * smbios_type_127_init(void *start) { - struct smbios_type_127 *p =3D (struct smbios_type_127 *)start; + struct smbios_type_127 *p =3D start; =20 memset(p, 0, sizeof(*p)); =20 --=20 2.34.1 From nobody Fri Oct 31 03:47:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1751413550; cv=none; d=zohomail.com; s=zohoarc; b=SmRd2fXdZ7NddD8BcaFsjpRDmQclhkgiDlT970Im/WPfaXoO8UdshyMo7SRB0ZgTYnfigthwuEIilBVZ2KOVldagkDd93fEmcWShwlGCzpwXMsUPC774Lae0tIWjdA736idGRaoOgBbiVofph2pPJungpIv2j/fYTR55gUnlbkw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751413550; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XGfgz5+4xZkhVXL2ewILuOLrNhVDG3jFfYq35hz23X4=; b=TKBVtMPty9+tjPDbnBwMRSd54Pr5CCLx+wvELgyWfqQmw7CfCtLC51qIeEtEaX2qf4hYW11xA4O6l0ymKICQX5GPTaVTw+BDFxvvRrjI3WjI7RBGzU45FzNskcpqtUU6qAxfY+wk1d4HaV1a2HrQbnBZdq0/9GIGUYT98Ecs0wY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751413550862165.89872130799313; Tue, 1 Jul 2025 16:45:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1030117.1403768 (Exim 4.92) (envelope-from ) id 1uWkfH-0008JH-I3; Tue, 01 Jul 2025 23:45:27 +0000 Received: by outflank-mailman (output) from mailman id 1030117.1403768; Tue, 01 Jul 2025 23:45:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uWkfH-0008JA-EW; Tue, 01 Jul 2025 23:45:27 +0000 Received: by outflank-mailman (input) for mailman id 1030117; Tue, 01 Jul 2025 23:45:26 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uWkfG-0008Gm-DR for xen-devel@lists.xenproject.org; Tue, 01 Jul 2025 23:45:26 +0000 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [2a00:1450:4864:20::432]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 74910aa5-56d5-11f0-b894-0df219b8e170; Wed, 02 Jul 2025 01:45:23 +0200 (CEST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3a4eed70f24so841788f8f.0 for ; Tue, 01 Jul 2025 16:45:23 -0700 (PDT) Received: from lab.home (dynamic-2a00-1028-83a4-4bca-c0bb-96ff-feed-9d50.ipv6.o2.cz. [2a00:1028:83a4:4bca:c0bb:96ff:feed:9d50]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a87e947431sm14509037f8f.0.2025.07.01.16.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jul 2025 16:45:21 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 74910aa5-56d5-11f0-b894-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751413522; x=1752018322; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XGfgz5+4xZkhVXL2ewILuOLrNhVDG3jFfYq35hz23X4=; b=W4p8Xv7W4aEZjDztbbg0tdfmHClRRhcVaN/WY8ei02MbywJrnGSJ8zMuUovkWbEpHG Gc3MzlB/h2DDj6kSSs7DaHz8dQKlsO+WI6JorJjOdbhCT/c61yLMKEX7eHb7+WhBWTjB 48t4vZ0TDk352x7eae9SL3Yz9yyFuwB1A1c5sCE4yG1jyJN0uhqlp8mZ+EBH9/9bRPhf WhwRnQDkpDtSvsRNIFN9BXVx+fDRLeNibMRU2KEngzRGI3B9dxizXt88IM/CAm7x3sT5 LPZ4Rx5XTVN/rp3DMijRkxqIzNHHG+dnFHXF8jOcq36MN9Vn6cNumbiCOsla9++5Qa0h yh0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751413522; x=1752018322; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XGfgz5+4xZkhVXL2ewILuOLrNhVDG3jFfYq35hz23X4=; b=GyPZyKI4qQpItbEcC7DPRMU9jIbc6FVW02lYTYfkuQ/M7EEU3XWOe5LcP6SRRWHTuG +S+nsuB7Pfedzm2VQ4/4XEomWToNwm5bo7Kpp0mVPklzqqWZ405Jy6V43wnQGXmPOZI7 m3pFAXAhtVmvKU8hR+aU090BsM17IZKdgM79SpgxjIuoYG0nSqDzQyFy8ikncemr7xDS madJQZZ9xyh6HgPaFZASd1oh81bVXRsDgn34nbo/V5fTheBp0VBVsU63KwQe/DsIXvOP +T+Br3yj+3GFl8eQ2Fmhq7TrjUZbdhi/NmMf/WF9/h/j4mQ0PP11bwKRZN3z6zNB8ghk 4Lnw== X-Gm-Message-State: AOJu0YyLv6wS6u+xPU8Imwe77IdIrBYC1MSKyAHmNxUYdApzyhM0ESt6 bSmHHzZ/IZGi/JTG6QARfP/OPtb4bv1HGo7JVYYTI/XAjKJoqYRl5V+LtnMAFQ== X-Gm-Gg: ASbGncsABZzzegIYjXlPtEm8/MONGBteRiFkjinPDDd0pLEfyhF66hLau2JMjMoTd7s 2PlNMqVnKtVtUqpWFfoMPQKOhTxqYOI2NNo49oXsPgsZFnwAijgMCirOjgL7v7fJnn3tfoFSGKY 2/+x03sK3vDDKMw+EdV0oxCN2GtWzkKc2aJPSpnCF7PkccrB00eCkG2QDv3aL+YfxaepBtHH8U4 jnFDR6vvf8hJxI0tO2Ide7leodCdwbPW9H/wXrT/KvP9B5x/1vGHf1U55ITChxOgB19lY69lILK /Gp1w7eR+A100uL6D/y+fwZ4sYAUHPyc7Bta7hJfmw4bpvCXsUNajGIUzp/o7NndigPCpSXyMbk t/qBnC/X316KQQr91Fd0oGcsW6Cm15cLs6k3SwRxAp+UMUIihcBP/WRyBvCgKIA== X-Google-Smtp-Source: AGHT+IHY5gvHcq5+7n+4oidJ9KfU0IfCxLoLpMo8YpYiX70/faDoxvMnCCM/Uh49NxV5+tGyiqBB6w== X-Received: by 2002:a05:6000:4310:b0:3a5:8934:4948 with SMTP id ffacd0b85a97d-3b1ffcd69f7mr101444f8f.12.1751413522160; Tue, 01 Jul 2025 16:45:22 -0700 (PDT) From: "=?UTF-8?q?Petr=20Bene=C5=A1?=" X-Google-Original-From: =?UTF-8?q?Petr=20Bene=C5=A1?= To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Petr=20Bene=C5=A1?= , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Anthony PERARD Subject: [PATCH 2/3] hvmloader: fix SMBIOS table length checks Date: Tue, 1 Jul 2025 23:45:11 +0000 Message-Id: <8981deefd675eabc6a60713aacf96e03fd756fdb.1751412735.git.w1benny@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1751413551312116600 From: Petr Bene=C5=A1 SMBIOS specification dictates that tables should have a minimal length. This commit introduces further validation for user-input SMBIOS tables. As per SMBIOS Reference Specification: * Type 0: For version 2.3 and later implementations, the length is at least= 14h * Type 1: 1Bh for 2.4 and later * Type 2: at least 08h * Type 3: 0Dh for version 2.1 and later * Type 11: 5h (+ strings) * Type 22: 1Ah (+ strings) * Type 39: a minimum of 10h hvmloader currently implements version 2.4 Signed-off-by: Petr Bene=C5=A1 --- tools/firmware/hvmloader/smbios.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/firmware/hvmloader/smbios.c b/tools/firmware/hvmloader/s= mbios.c index fc3cdc9a25..2cd826768b 100644 --- a/tools/firmware/hvmloader/smbios.c +++ b/tools/firmware/hvmloader/smbios.c @@ -385,7 +385,7 @@ smbios_type_0_init(void *start, const char *xen_version, uint32_t length; =20 pts =3D get_smbios_pt_struct(0, &length); - if ( pts !=3D NULL && length > 0 ) + if ( pts !=3D NULL && length >=3D sizeof(struct smbios_type_0) ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE0; @@ -444,7 +444,7 @@ smbios_type_1_init(void *start, const char *xen_version, uint32_t length; =20 pts =3D get_smbios_pt_struct(1, &length); - if ( pts !=3D NULL && length > 0 ) + if ( pts !=3D NULL && length >=3D sizeof(struct smbios_type_1) ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE1; @@ -504,7 +504,7 @@ smbios_type_2_init(void *start) unsigned int counter =3D 0; =20 pts =3D get_smbios_pt_struct(2, &length); - if ( pts !=3D NULL && length > 0 ) + if ( pts !=3D NULL && length >=3D 8 ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE2; @@ -598,7 +598,7 @@ smbios_type_3_init(void *start) uint32_t counter =3D 0; =20 pts =3D get_smbios_pt_struct(3, &length); - if ( pts !=3D NULL && length > 0 ) + if ( pts !=3D NULL && length >=3D 13 ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE3; @@ -712,7 +712,7 @@ smbios_type_11_init(void *start) uint32_t length; =20 pts =3D get_smbios_pt_struct(11, &length); - if ( pts !=3D NULL && length > 0 ) + if ( pts !=3D NULL && length >=3D sizeof(struct smbios_type_11) ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE11; @@ -869,7 +869,7 @@ smbios_type_22_init(void *start) uint32_t length; =20 pts =3D get_smbios_pt_struct(22, &length); - if ( pts !=3D NULL && length > 0 ) + if ( pts !=3D NULL && length >=3D sizeof(struct smbios_type_22) ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE22; @@ -951,7 +951,7 @@ smbios_type_39_init(void *start) uint32_t length; =20 pts =3D get_smbios_pt_struct(39, &length); - if ( pts !=3D NULL && length > 0 ) + if ( pts !=3D NULL && length >=3D 16 ) { memcpy(start, pts, length); p->header.handle =3D SMBIOS_HANDLE_TYPE39; --=20 2.34.1 From nobody Fri Oct 31 03:47:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1751413550; cv=none; d=zohomail.com; s=zohoarc; b=km2HUYq7QM7kYx/ocUVFmxbhWfmGY+tVK2b8VwEt6f21sV/1/mPOWOhvKfOB59J3eq2O9cJfPNbS3RFA8U4V7yzqA+IEKcxH6yH72hgN+T/DuD9ZT5nz9KvZ9hcmCo5FGIWsa+y7WEnbkvVgOx0fEGnEaCtW5qLpDnU3INfCK0s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751413550; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bD8hgpwukyenx61CmXgMgm2JclP4fpFaqdzptPfzBYI=; b=G2L7efGRIwNBsw+tzETs39X9HcHV+UcSmUcYp0149bauhFshZ64EzYc+WU4gDR/8uZR6SWMULN/F+5KZRd3TB/ynY//Ym5bIAyWDY1trWaCuRK5MGA/SKyR9ZYK/zIyyBGgRGmRPV3K4pQPiHUu403rue6v17ES+Dgo1oUTekPA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751413550190865.0697212959266; Tue, 1 Jul 2025 16:45:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1030118.1403773 (Exim 4.92) (envelope-from ) id 1uWkfH-0008MT-Pj; Tue, 01 Jul 2025 23:45:27 +0000 Received: by outflank-mailman (output) from mailman id 1030118.1403773; Tue, 01 Jul 2025 23:45:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uWkfH-0008ML-MJ; Tue, 01 Jul 2025 23:45:27 +0000 Received: by outflank-mailman (input) for mailman id 1030118; Tue, 01 Jul 2025 23:45:26 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uWkfG-0008Gm-KM for xen-devel@lists.xenproject.org; Tue, 01 Jul 2025 23:45:26 +0000 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [2a00:1450:4864:20::42b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 75026e12-56d5-11f0-b894-0df219b8e170; Wed, 02 Jul 2025 01:45:24 +0200 (CEST) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3a577f164c8so853256f8f.2 for ; Tue, 01 Jul 2025 16:45:24 -0700 (PDT) Received: from lab.home (dynamic-2a00-1028-83a4-4bca-c0bb-96ff-feed-9d50.ipv6.o2.cz. [2a00:1028:83a4:4bca:c0bb:96ff:feed:9d50]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a87e947431sm14509037f8f.0.2025.07.01.16.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jul 2025 16:45:22 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 75026e12-56d5-11f0-b894-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751413523; x=1752018323; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bD8hgpwukyenx61CmXgMgm2JclP4fpFaqdzptPfzBYI=; b=Xp/i31xMt80KUIF6S+C3XIHhyFor1gC0YrEo+vwLhonUnI0kXbWomvLLw3C7PNdPXo HRVd+6Ui+1TPfh0idfGwbjgggxiFmYpW/tPNT7ZmcIvajwdrBdG/YFNj/jBZW58Ot238 s23GkIJJ+szvpNdZj4/XA/6sU7wHZ4zDrsZ7kLAcj++C7uRc7b2QfNtRaFCFXpXdozlC MyOsfMpzHxwOD2ejCvecA4GxaWMtbPZYjlg5M7iraODi+zFi4xfe2IM0mMBOfFkwj9Vs x/Gs6PrrFqt7igAJxrIVGzkdm9yL/S+XWEwP9tu9dWeE8DYP2fYtJ8FFqCS52O/OKXqi HDKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751413523; x=1752018323; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bD8hgpwukyenx61CmXgMgm2JclP4fpFaqdzptPfzBYI=; b=wPYJmQv9Y897ZddyaxrYsiMT3P28R52D7VR9oh34d6exm2DsYvuKnfF0IjRtG2KWMx WwJw/P1iQQNsQRJE9h2I+I3NgRJh+eKKVOs+VpG01MKVD9CEIMXRGrvQ3YSarT7zrxkL kWLCIqxVgLAgdEy2iXuk4nuBUixmcf+M6wpAy+g9MzGJZgerUAf/0gUgHgNXqNzEIIFF PDCT8tXkkZq4xKfruV7LKUYGPhCa9JHanTc/+a4efFMtrH2dbsVFWwOTT+5jJNKSimxI NEhJTBfqr5U3Vkqo+v8RyzZD9i6+rcDL8Rscqip6gbCYNRM1OiC6XzSFqbp8EVR9O22b +MrQ== X-Gm-Message-State: AOJu0YzTda45OXFW0a72Ji6n5kXL3sDjJXpWIJC/iXS9LqhWkzhrerp+ WW3SEbWWEK5o884FM0vaH1EQtz2GnfsAM8C1RWoZOMZQBH+g0Tfl8K1LnHj9lQ== X-Gm-Gg: ASbGnctYagYL8XAJqX8Ct+4DJc86LshJ2h5i2V0xnFcqMocrE2fhl+gPrtyX3xsIMYJ 4+u4mp6ysmhJ4PkYXS2YyEata6i3nVDm5l8TtSr+UlDlB/k9co7SdlL3ObRFyZMt83sRivFIWFC AN2DGVQ7ZSj4vdl30wiXM9yjipChthJd1YYv47kcVLPQBc5G9ZfIbvqlk8j97p2i4YRwUrBUyal AmVMP22QVOKLiYXSvugI2m4n8iG9oTaCnNUWqPQ035OkfcPNdphZ0T775chW0s3dDgtyIh8nAYd ImzlgRsrPqYISof8UwYrQMYP5byCHbpWRqFissNB08Fshz+qBqZp3pDYhsaibT/XeT+8GB0J8aA gwCDwYZbjL9sQGZQLLqcPniy1feBSeX2QxTjilgUtNPbxOKjuCIMfJUKOh6QzIA== X-Google-Smtp-Source: AGHT+IHxiWDkX7ENjOMFxSpFbA7Cymhl/aRI01tjIKksZNqWxScQOHWvZMEryse5Hc969MSRG2r/2g== X-Received: by 2002:a5d:5f52:0:b0:3a5:1306:3c30 with SMTP id ffacd0b85a97d-3b1fb064480mr108828f8f.0.1751413523066; Tue, 01 Jul 2025 16:45:23 -0700 (PDT) From: "=?UTF-8?q?Petr=20Bene=C5=A1?=" X-Google-Original-From: =?UTF-8?q?Petr=20Bene=C5=A1?= To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Petr=20Bene=C5=A1?= , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Anthony PERARD , Anton Belousov Subject: [PATCH 3/3] hvmloader: add new SMBIOS tables (7,8,9,26,27,28) Date: Tue, 1 Jul 2025 23:45:12 +0000 Message-Id: <99e281ad05537d2384eaffe95155a03382493c96.1751412735.git.w1benny@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1751413551500116600 From: Petr Bene=C5=A1 SMBIOS tables like 7,8,9,26,27,28 are neccessary to prevent sandbox detecti= on by malware using WMI-queries. New tables can be mapped to memory from binary file specified in "smbios_firmware" parameter of domain configuration. If particular table is absent in binary file, then it will not be mapped to memory. This method works for Windows domains as tables 7,8,9,26,27,28 are = not critical for OS boot and runtime. Also if "smbios_firmware" parameter is not provided, these tables will be skipped in write_smbios_tables function. Signed-off-by: Anton Belousov Signed-off-by: Petr Bene=C5=A1 --- tools/firmware/hvmloader/smbios.c | 148 +++++++++++++++++++++++- tools/firmware/hvmloader/smbios_types.h | 83 ++++++++++++- 2 files changed, 226 insertions(+), 5 deletions(-) diff --git a/tools/firmware/hvmloader/smbios.c b/tools/firmware/hvmloader/s= mbios.c index 2cd826768b..2a799fdac7 100644 --- a/tools/firmware/hvmloader/smbios.c +++ b/tools/firmware/hvmloader/smbios.c @@ -33,12 +33,18 @@ #define SMBIOS_HANDLE_TYPE2 0x0200 #define SMBIOS_HANDLE_TYPE3 0x0300 #define SMBIOS_HANDLE_TYPE4 0x0400 +#define SMBIOS_HANDLE_TYPE7 0x0700 +#define SMBIOS_HANDLE_TYPE8 0x0800 +#define SMBIOS_HANDLE_TYPE9 0x0900 #define SMBIOS_HANDLE_TYPE11 0x0B00 #define SMBIOS_HANDLE_TYPE16 0x1000 #define SMBIOS_HANDLE_TYPE17 0x1100 #define SMBIOS_HANDLE_TYPE19 0x1300 #define SMBIOS_HANDLE_TYPE20 0x1400 #define SMBIOS_HANDLE_TYPE22 0x1600 +#define SMBIOS_HANDLE_TYPE26 0x1A00 +#define SMBIOS_HANDLE_TYPE27 0x1B00 +#define SMBIOS_HANDLE_TYPE28 0x1C00 #define SMBIOS_HANDLE_TYPE32 0x2000 #define SMBIOS_HANDLE_TYPE39 0x2700 #define SMBIOS_HANDLE_TYPE127 0x7f00 @@ -77,6 +83,12 @@ static void * smbios_type_4_init(void *start, unsigned int cpu_number, char *cpu_manufacturer); static void * +smbios_type_7_init(void *start); +static void * +smbios_type_8_init(void *start); +static void * +smbios_type_9_init(void *start); +static void * smbios_type_11_init(void *start); static void * smbios_type_16_init(void *start, uint32_t memory_size_mb, int nr_mem_devs); @@ -89,6 +101,12 @@ smbios_type_20_init(void *start, uint32_t memory_size_m= b, int instance); static void * smbios_type_22_init(void *start); static void * +smbios_type_26_init(void *start); +static void * +smbios_type_27_init(void *start); +static void * +smbios_type_28_init(void *start); +static void * smbios_type_32_init(void *start); static void * smbios_type_39_init(void *start); @@ -205,6 +223,9 @@ write_smbios_tables(void *ep, void *start, do_struct(smbios_type_3_init(p)); for ( cpu_num =3D 1; cpu_num <=3D vcpus; cpu_num++ ) do_struct(smbios_type_4_init(p, cpu_num, cpu_manufacturer)); + do_struct(smbios_type_7_init(p)); + do_struct(smbios_type_8_init(p)); + do_struct(smbios_type_9_init(p)); do_struct(smbios_type_11_init(p)); =20 /* Each 'memory device' covers up to 16GB of address space. */ @@ -221,6 +242,9 @@ write_smbios_tables(void *ep, void *start, } =20 do_struct(smbios_type_22_init(p)); + do_struct(smbios_type_26_init(p)); + do_struct(smbios_type_27_init(p)); + do_struct(smbios_type_28_init(p)); do_struct(smbios_type_32_init(p)); do_struct(smbios_type_39_init(p)); do_struct(smbios_type_vendor_oem_init(p)); @@ -700,6 +724,66 @@ smbios_type_4_init( return start+1; } =20 +/* Type 7 -- Cache Information */ +static void * +smbios_type_7_init(void *start) +{ + struct smbios_type_7 *p =3D start; + + void *pts; + uint32_t length; + + pts =3D get_smbios_pt_struct(7, &length); + if ( pts !=3D NULL && length >=3D sizeof(struct smbios_type_7) ) + { + memcpy(start, pts, length); + p->header.handle =3D SMBIOS_HANDLE_TYPE7; + return start + length; + } + + return start; +} + +/* Type 8 -- Port Connector Information */ +static void * +smbios_type_8_init(void *start) +{ + struct smbios_type_8 *p =3D start; + + void *pts; + uint32_t length; + + pts =3D get_smbios_pt_struct(8, &length); + if ( pts !=3D NULL && length >=3D sizeof(struct smbios_type_8) ) + { + memcpy(start, pts, length); + p->header.handle =3D SMBIOS_HANDLE_TYPE8; + return start + length; + } + + return start; +} + +/* Type 9 -- System Slots */ +static void * +smbios_type_9_init(void *start) +{ + struct smbios_type_9 *p =3D start; + + void *pts; + uint32_t length; + + pts =3D get_smbios_pt_struct(9, &length); + if ( pts !=3D NULL && length >=3D sizeof(struct smbios_type_9) ) + { + memcpy(start, pts, length); + p->header.handle =3D SMBIOS_HANDLE_TYPE9; + return start + length; + } + + return start; +} + /* Type 11 -- OEM Strings */ static void * smbios_type_11_init(void *start)=20 @@ -780,7 +864,7 @@ smbios_type_17_init(void *start, uint32_t memory_size_m= b, int instance) { char buf[16]; struct smbios_type_17 *p =3D start; - =20 + memset(p, 0, sizeof(*p)); =20 p->header.type =3D 17; @@ -815,7 +899,7 @@ static void * smbios_type_19_init(void *start, uint32_t memory_size_mb, int instance) { struct smbios_type_19 *p =3D start; - =20 + memset(p, 0, sizeof(*p)); =20 p->header.type =3D 19; @@ -923,6 +1007,66 @@ smbios_type_22_init(void *start) return start+1;=20 } =20 +/* Type 26 -- Voltage Probe */ +static void * +smbios_type_26_init(void *start) +{ + struct smbios_type_26 *p =3D start; + + void *pts; + uint32_t length; + + pts =3D get_smbios_pt_struct(26, &length); + if ( pts !=3D NULL && length >=3D 20 ) + { + memcpy(start, pts, length); + p->header.handle =3D SMBIOS_HANDLE_TYPE26; + return start + length; + } + + return start; +} + +/* Type 27 -- Cooling Device */ +static void * +smbios_type_27_init(void *start) +{ + struct smbios_type_27 *p =3D start; + + void *pts; + uint32_t length; + + pts =3D get_smbios_pt_struct(27, &length); + if ( pts !=3D NULL && length >=3D 12 ) + { + memcpy(start, pts, length); + p->header.handle =3D SMBIOS_HANDLE_TYPE27; + return start + length; + } + + return start; +} + +/* Type 28 -- Temperature Probe */ +static void * +smbios_type_28_init(void *start) +{ + struct smbios_type_28 *p =3D start; + + void *pts; + uint32_t length; + + pts =3D get_smbios_pt_struct(28, &length); + if ( pts !=3D NULL && length >=3D 20 ) + { + memcpy(start, pts, length); + p->header.handle =3D SMBIOS_HANDLE_TYPE28; + return start + length; + } + + return start; +} + /* Type 32 -- System Boot Information */ static void * smbios_type_32_init(void *start) diff --git a/tools/firmware/hvmloader/smbios_types.h b/tools/firmware/hvmlo= ader/smbios_types.h index 7c648ece71..3e5c5fa46a 100644 --- a/tools/firmware/hvmloader/smbios_types.h +++ b/tools/firmware/hvmloader/smbios_types.h @@ -149,6 +149,44 @@ struct smbios_type_4 { uint8_t part_number_str; } __attribute__ ((packed)); =20 +/* SMBIOS type 7 - Cache Information */ +struct smbios_type_7 { + struct smbios_structure_header header; + uint8_t socket_designation_str; + uint16_t cache_configuration; + uint16_t maximum_cache_size; + uint16_t installed_size; + uint16_t supported_SRAM_type; + uint16_t current_SRAM_type; + uint8_t cache_speed; + uint8_t error_connection_type; + uint8_t system_cache_type; + uint8_t associativity; +} __attribute__ ((packed)); + +/* SMBIOS type 8 - Port Connector Information */ +struct smbios_type_8 { + struct smbios_structure_header header; + uint8_t internal_reference_designator_str; + uint8_t internal_connector_type; + uint8_t external_reference_designator_str; + uint8_t external_connector_type; + uint8_t port_type; +} __attribute__ ((packed)); + +/* SMBIOS type 9 - System Slots */ +struct smbios_type_9 { + struct smbios_structure_header header; + uint8_t slot_designation_str; + uint8_t slot_type; + uint8_t slot_data_bus_width; + uint8_t current_usage; + uint8_t slot_length; + uint16_t slot_id; + uint8_t slot_characteristics_1; + uint8_t slot_characteristics_2; +} __attribute__ ((packed)); + /* SMBIOS type 11 - OEM Strings */ struct smbios_type_11 { struct smbios_structure_header header; @@ -232,6 +270,45 @@ struct smbios_type_22 { uint32_t oem_specific; } __attribute__ ((packed)); =20 +/* SMBIOS type 26 - Voltage Probe */ +struct smbios_type_26 { + struct smbios_structure_header header; + uint8_t description_str; + uint8_t location_and_status; + uint16_t maximum_value; + uint16_t minimum_value; + uint16_t resolution; + uint16_t tolerance; + uint16_t accuracy; + uint32_t oem_defined; + uint16_t nominal_value; // Optional +} __attribute__ ((packed)); + +/* SMBIOS type 27 - Cooling Device */ +struct smbios_type_27 { + struct smbios_structure_header header; + uint16_t temperature_probe_handle; + uint8_t device_type_and_status; + uint8_t cooling_unit_group; + uint32_t oem_defined; + uint16_t nominal_speed; // Optional + uint8_t description_str; // Optional +} __attribute__ ((packed)); + +/* SMBIOS type 28 - Temperature Probe */ +struct smbios_type_28 { + struct smbios_structure_header header; + uint8_t description_str; + uint8_t location_and_status; + uint16_t maximum_value; + uint16_t minimum_value; + uint16_t resolution; + uint16_t tolerance; + uint16_t accuracy; + uint32_t oem_defined; + uint16_t nominal_value; // Optional +} __attribute__ ((packed)); + /* SMBIOS type 32 - System Boot Information */ struct smbios_type_32 { struct smbios_structure_header header; @@ -252,9 +329,9 @@ struct smbios_type_39 { uint8_t revision_level_str; uint16_t max_capacity; uint16_t characteristics; - uint16_t input_voltage_probe_handle; - uint16_t cooling_device_handle; - uint16_t input_current_probe_handle; + uint16_t input_voltage_probe_handle; // Optional + uint16_t cooling_device_handle; // Optional + uint16_t input_current_probe_handle; // Optional } __attribute__ ((packed)); =20 /* SMBIOS type 127 -- End-of-table */ --=20 2.34.1