From nobody Mon Feb 9 08:11:48 2026 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=1660160966; cv=none; d=zohomail.com; s=zohoarc; b=Le0qslHyh7zgJF35rvvhSstmjuDMsUf/ukUUNXGuPJI/goqO71gbYPVJ0QPxDqW0UsD/Ie2hzHNTDbVXdv3IRh2XcIGbvAb3cdfMGhgnV7D+43E8K8GDX30VBmexho81FQXWfB6EoI2uxEDlmMEtfRGFpHu8iSlYVKh7V/gaZg0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1660160966; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UYR0+uohvDIXv206Eq7xqYEcXJtgPEmS478u5ZUE58M=; b=TEAOKLra6MSIgFL0Pcr+DhRCXsyV4lDle64z15UpXpBEayQmGkvnnVJcdBkNU3IiVYqBTzU41zRz97ZwPK156eeONBYJmI1/qspkZtFfBqsycBYi64HPFc2zoYwvCO/KEUDahie4vYaEFQJKME6EGi3hWTKOJ6St/ilCAMUTT1E= 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 1660160966227256.3843623533568; Wed, 10 Aug 2022 12:49:26 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.384001.619275 (Exim 4.92) (envelope-from ) id 1oLrhS-0008BP-9W; Wed, 10 Aug 2022 19:49:06 +0000 Received: by outflank-mailman (output) from mailman id 384001.619275; Wed, 10 Aug 2022 19:49:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oLrhS-0008BG-64; Wed, 10 Aug 2022 19:49:06 +0000 Received: by outflank-mailman (input) for mailman id 384001; Wed, 10 Aug 2022 19:49:05 +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 1oLrhQ-0007rn-RW for xen-devel@lists.xenproject.org; Wed, 10 Aug 2022 19:49:05 +0000 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [2607:f8b0:4864:20::82b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7c7242b0-18e5-11ed-924f-1f966e50362f; Wed, 10 Aug 2022 21:49:03 +0200 (CEST) Received: by mail-qt1-x82b.google.com with SMTP id u12so12077995qtk.0 for ; Wed, 10 Aug 2022 12:49:03 -0700 (PDT) Received: from pm2-ws13.praxislan02.com ([2001:470:8:67e:289e:b898:c7de:df6c]) by smtp.gmail.com with ESMTPSA id bk9-20020a05620a1a0900b006b978b521c8sm520897qkb.69.2022.08.10.12.49.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 12:49:01 -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: 7c7242b0-18e5-11ed-924f-1f966e50362f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=UYR0+uohvDIXv206Eq7xqYEcXJtgPEmS478u5ZUE58M=; b=LLmFZQIXXQR5s7aFFARrKKhoL7RS9PfJtLk+hCdCy0aMZ7snwvIODOVNup8KuprMGb Dt1ibz50BR8ZcFRg2gBumMj8lDOPAI/hxXdJngGeaTVy9Slir4k8qV8LujOQuiC1WpU+ b6AagDGv8Nke6toKpx9fSOSRje6XxLk5IFh8BvgB9vKkYwuptPyalD3eBHWzLZrZkZ7X O6xSerIYCA00eutDFTqEWkT/bW/V2K+B8VSDZVHkx90akTn65fGczEtNfX5nJm4s3vk2 TeAnCbFtjDoTktVlhKTBTUYwgstSa8POgeVm/4Z2FFSmXh0g076FT/G6xIImGuSjGgMk UzjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=UYR0+uohvDIXv206Eq7xqYEcXJtgPEmS478u5ZUE58M=; b=tzxVNKOvXrwjTrk+rHeWKBeuyqPMQTB4kfc8xV+cmtU/6UUxnGPHlSmrnJMokHDlL7 S8rpS9OEDYqC89MYfAh+FPzmnll3O9WLb3nBRbPcFInzT/3iw40ENcXPT4e/DxyD4TFD VxND4K9f3sCquSpZoJ6dZaZSu3lVNDAtGiMiHTpQzfbcTWNfM99fLzCyYnrm7o8P5C6I ERmSXbA5Za31HZvB2IFtFra0WnwN/oQ6Z/GN0oguySp5Jkd1O23zUcdJGdCnHPFanYi9 oVFi93UnlWfBbWnNzY2Cyw9sk5QIIyRwqG6L/25LDKJ2ZV150B0sNpXjaahd/T7JwAHD F8qQ== X-Gm-Message-State: ACgBeo3fT0nNG59z17bh5JRMIYR2Gpx4zzNKAX4Od/lBefkz9EYKUoVc wdy09hdm3uWEfdqsMFieuwnBWKdqclI= X-Google-Smtp-Source: AA6agR40LUsRMZXNfAIHlTIAI+WhtV2fN3eSZ/8pzxbMagSPZBUttDo96OvAI48aq5j3PvHaDDRguA== X-Received: by 2002:ac8:7e96:0:b0:340:be9a:8ce1 with SMTP id w22-20020ac87e96000000b00340be9a8ce1mr25787460qtj.228.1660160942481; Wed, 10 Aug 2022 12:49:02 -0700 (PDT) From: Jason Andryuk To: xen-devel@lists.xenproject.org Cc: Jason Andryuk , Wei Liu , Anthony PERARD , George Dunlap , Nick Rosbrook , Juergen Gross Subject: [PATCH 3/3] xl/libxl: Add OEM string support to smbios Date: Wed, 10 Aug 2022 15:48:27 -0400 Message-Id: <20220810194827.103428-4-jandryuk@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220810194827.103428-1-jandryuk@gmail.com> References: <20220810194827.103428-1-jandryuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1660160966712100003 Content-Type: text/plain; charset="utf-8" Add support for OEM strings in the SMBIOS type 11. hvmloader checks them sequentially, so hide the implementation detail. Allow multiple plain oem=3D items and assign the numeric values internally. Signed-off-by: Jason Andryuk --- This change re-introduces the newline before ms_vm_genid. --- docs/man/xl.cfg.5.pod.in | 4 ++ tools/golang/xenlight/types.gen.go | 99 ++++++++++++++++++++++++++++++ tools/libs/light/libxl_types.idl | 99 ++++++++++++++++++++++++++++++ tools/xl/xl_parse.c | 15 +++++ 4 files changed, 217 insertions(+) diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index 7edf5d23f3..7947bf07ea 100644 --- a/docs/man/xl.cfg.5.pod.in +++ b/docs/man/xl.cfg.5.pod.in @@ -2104,8 +2104,12 @@ Each B is a C strin= g from the following list: =20 =3Ditem B =20 +=3Ditem B + =3Dback =20 +oem=3D strings can be specified mutiple times up to a limit of 99. + =3Ditem B =20 Provide a VM generation ID to the guest. diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/typ= es.gen.go index e084c3540b..bd5752f634 100644 --- a/tools/golang/xenlight/types.gen.go +++ b/tools/golang/xenlight/types.gen.go @@ -405,6 +405,105 @@ SmbiosTypeEnclosureSerialNumber SmbiosType =3D 14 SmbiosTypeEnclosureAssetTag SmbiosType =3D 15 SmbiosTypeBatteryManufacturer SmbiosType =3D 16 SmbiosTypeBatteryDeviceName SmbiosType =3D 17 +SmbiosTypeOem1 SmbiosType =3D 18 +SmbiosTypeOem2 SmbiosType =3D 19 +SmbiosTypeOem3 SmbiosType =3D 20 +SmbiosTypeOem4 SmbiosType =3D 21 +SmbiosTypeOem5 SmbiosType =3D 22 +SmbiosTypeOem6 SmbiosType =3D 23 +SmbiosTypeOem7 SmbiosType =3D 24 +SmbiosTypeOem8 SmbiosType =3D 25 +SmbiosTypeOem9 SmbiosType =3D 26 +SmbiosTypeOem10 SmbiosType =3D 27 +SmbiosTypeOem11 SmbiosType =3D 28 +SmbiosTypeOem12 SmbiosType =3D 29 +SmbiosTypeOem13 SmbiosType =3D 30 +SmbiosTypeOem14 SmbiosType =3D 31 +SmbiosTypeOem15 SmbiosType =3D 32 +SmbiosTypeOem16 SmbiosType =3D 33 +SmbiosTypeOem17 SmbiosType =3D 34 +SmbiosTypeOem18 SmbiosType =3D 35 +SmbiosTypeOem19 SmbiosType =3D 36 +SmbiosTypeOem20 SmbiosType =3D 37 +SmbiosTypeOem21 SmbiosType =3D 38 +SmbiosTypeOem22 SmbiosType =3D 39 +SmbiosTypeOem23 SmbiosType =3D 40 +SmbiosTypeOem24 SmbiosType =3D 41 +SmbiosTypeOem25 SmbiosType =3D 42 +SmbiosTypeOem26 SmbiosType =3D 43 +SmbiosTypeOem27 SmbiosType =3D 44 +SmbiosTypeOem28 SmbiosType =3D 45 +SmbiosTypeOem29 SmbiosType =3D 46 +SmbiosTypeOem30 SmbiosType =3D 47 +SmbiosTypeOem31 SmbiosType =3D 48 +SmbiosTypeOem32 SmbiosType =3D 49 +SmbiosTypeOem33 SmbiosType =3D 50 +SmbiosTypeOem34 SmbiosType =3D 51 +SmbiosTypeOem35 SmbiosType =3D 52 +SmbiosTypeOem36 SmbiosType =3D 53 +SmbiosTypeOem37 SmbiosType =3D 54 +SmbiosTypeOem38 SmbiosType =3D 55 +SmbiosTypeOem39 SmbiosType =3D 56 +SmbiosTypeOem40 SmbiosType =3D 57 +SmbiosTypeOem41 SmbiosType =3D 58 +SmbiosTypeOem42 SmbiosType =3D 59 +SmbiosTypeOem43 SmbiosType =3D 60 +SmbiosTypeOem44 SmbiosType =3D 61 +SmbiosTypeOem45 SmbiosType =3D 62 +SmbiosTypeOem46 SmbiosType =3D 63 +SmbiosTypeOem47 SmbiosType =3D 64 +SmbiosTypeOem48 SmbiosType =3D 65 +SmbiosTypeOem49 SmbiosType =3D 66 +SmbiosTypeOem50 SmbiosType =3D 67 +SmbiosTypeOem51 SmbiosType =3D 68 +SmbiosTypeOem52 SmbiosType =3D 69 +SmbiosTypeOem53 SmbiosType =3D 70 +SmbiosTypeOem54 SmbiosType =3D 71 +SmbiosTypeOem55 SmbiosType =3D 72 +SmbiosTypeOem56 SmbiosType =3D 73 +SmbiosTypeOem57 SmbiosType =3D 74 +SmbiosTypeOem58 SmbiosType =3D 75 +SmbiosTypeOem59 SmbiosType =3D 76 +SmbiosTypeOem60 SmbiosType =3D 77 +SmbiosTypeOem61 SmbiosType =3D 78 +SmbiosTypeOem62 SmbiosType =3D 79 +SmbiosTypeOem63 SmbiosType =3D 80 +SmbiosTypeOem64 SmbiosType =3D 81 +SmbiosTypeOem65 SmbiosType =3D 82 +SmbiosTypeOem66 SmbiosType =3D 83 +SmbiosTypeOem67 SmbiosType =3D 84 +SmbiosTypeOem68 SmbiosType =3D 85 +SmbiosTypeOem69 SmbiosType =3D 86 +SmbiosTypeOem70 SmbiosType =3D 87 +SmbiosTypeOem71 SmbiosType =3D 88 +SmbiosTypeOem72 SmbiosType =3D 89 +SmbiosTypeOem73 SmbiosType =3D 90 +SmbiosTypeOem74 SmbiosType =3D 91 +SmbiosTypeOem75 SmbiosType =3D 92 +SmbiosTypeOem76 SmbiosType =3D 93 +SmbiosTypeOem77 SmbiosType =3D 94 +SmbiosTypeOem78 SmbiosType =3D 95 +SmbiosTypeOem79 SmbiosType =3D 96 +SmbiosTypeOem80 SmbiosType =3D 97 +SmbiosTypeOem81 SmbiosType =3D 98 +SmbiosTypeOem82 SmbiosType =3D 99 +SmbiosTypeOem83 SmbiosType =3D 100 +SmbiosTypeOem84 SmbiosType =3D 101 +SmbiosTypeOem85 SmbiosType =3D 102 +SmbiosTypeOem86 SmbiosType =3D 103 +SmbiosTypeOem87 SmbiosType =3D 104 +SmbiosTypeOem88 SmbiosType =3D 105 +SmbiosTypeOem89 SmbiosType =3D 106 +SmbiosTypeOem90 SmbiosType =3D 107 +SmbiosTypeOem91 SmbiosType =3D 108 +SmbiosTypeOem92 SmbiosType =3D 109 +SmbiosTypeOem93 SmbiosType =3D 110 +SmbiosTypeOem94 SmbiosType =3D 111 +SmbiosTypeOem95 SmbiosType =3D 112 +SmbiosTypeOem96 SmbiosType =3D 113 +SmbiosTypeOem97 SmbiosType =3D 114 +SmbiosTypeOem98 SmbiosType =3D 115 +SmbiosTypeOem99 SmbiosType =3D 116 ) =20 type Smbios struct { diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_type= s.idl index d04207748e..58f404af37 100644 --- a/tools/libs/light/libxl_types.idl +++ b/tools/libs/light/libxl_types.idl @@ -436,6 +436,105 @@ libxl_smbios_type =3D Enumeration("smbios_type", [ (15, "enclosure_asset_tag"), (16, "battery_manufacturer"), (17, "battery_device_name"), + (18, "oem_1"), + (19, "oem_2"), + (20, "oem_3"), + (21, "oem_4"), + (22, "oem_5"), + (23, "oem_6"), + (24, "oem_7"), + (25, "oem_8"), + (26, "oem_9"), + (27, "oem_10"), + (28, "oem_11"), + (29, "oem_12"), + (30, "oem_13"), + (31, "oem_14"), + (32, "oem_15"), + (33, "oem_16"), + (34, "oem_17"), + (35, "oem_18"), + (36, "oem_19"), + (37, "oem_20"), + (38, "oem_21"), + (39, "oem_22"), + (40, "oem_23"), + (41, "oem_24"), + (42, "oem_25"), + (43, "oem_26"), + (44, "oem_27"), + (45, "oem_28"), + (46, "oem_29"), + (47, "oem_30"), + (48, "oem_31"), + (49, "oem_32"), + (50, "oem_33"), + (51, "oem_34"), + (52, "oem_35"), + (53, "oem_36"), + (54, "oem_37"), + (55, "oem_38"), + (56, "oem_39"), + (57, "oem_40"), + (58, "oem_41"), + (59, "oem_42"), + (60, "oem_43"), + (61, "oem_44"), + (62, "oem_45"), + (63, "oem_46"), + (64, "oem_47"), + (65, "oem_48"), + (66, "oem_49"), + (67, "oem_50"), + (68, "oem_51"), + (69, "oem_52"), + (70, "oem_53"), + (71, "oem_54"), + (72, "oem_55"), + (73, "oem_56"), + (74, "oem_57"), + (75, "oem_58"), + (76, "oem_59"), + (77, "oem_60"), + (78, "oem_61"), + (79, "oem_62"), + (80, "oem_63"), + (81, "oem_64"), + (82, "oem_65"), + (83, "oem_66"), + (84, "oem_67"), + (85, "oem_68"), + (86, "oem_69"), + (87, "oem_70"), + (88, "oem_71"), + (89, "oem_72"), + (90, "oem_73"), + (91, "oem_74"), + (92, "oem_75"), + (93, "oem_76"), + (94, "oem_77"), + (95, "oem_78"), + (96, "oem_79"), + (97, "oem_80"), + (98, "oem_81"), + (99, "oem_82"), + (100, "oem_83"), + (101, "oem_84"), + (102, "oem_85"), + (103, "oem_86"), + (104, "oem_87"), + (105, "oem_88"), + (106, "oem_89"), + (107, "oem_90"), + (108, "oem_91"), + (109, "oem_92"), + (110, "oem_93"), + (111, "oem_94"), + (112, "oem_95"), + (113, "oem_96"), + (114, "oem_97"), + (115, "oem_98"), + (116, "oem_99"), ]) =20 libxl_smbios =3D Struct("smbios", [ diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index 4f3f962773..fb7f1f6867 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -1787,12 +1787,16 @@ void parse_config_data(const char *config_source, switch (xlu_cfg_get_list(config, "smbios", &smbios, &num_smbios, 0= )) { case 0: /* Success */ + { + unsigned int num_oem =3D 1; + b_info->u.hvm.num_smbios =3D num_smbios; b_info->u.hvm.smbios =3D xcalloc(num_smbios, sizeof(libxl_smbi= os)); for (i =3D 0; i < num_smbios; i++) { char *option_untrimmed, *value_untrimmed; char *option, *value; libxl_smbios_type v; + char oem_buf[] =3D "oem_99"; =20 buf =3D xlu_cfg_get_listitem(smbios, i); if (!buf) continue; @@ -1807,6 +1811,16 @@ void parse_config_data(const char *config_source, trim(isspace, option_untrimmed, &option); trim(isspace, value_untrimmed, &value); =20 + if (strcmp(option, "oem") =3D=3D 0) { + if (num_oem > 99) { + fprintf(stderr, "xl: sbmios oem strings limited to= 99\n"); + exit(-ERROR_FAIL); + } + sprintf(oem_buf, "oem_%d", num_oem); + num_oem++; + option =3D oem_buf; + } + e =3D libxl_smbios_type_from_string(option, &v); if (e) { fprintf(stderr, @@ -1819,6 +1833,7 @@ void parse_config_data(const char *config_source, b_info->u.hvm.smbios[i].value =3D value; } break; + } case ESRCH: break; /* Option not present */ default: fprintf(stderr,"xl: Unable to parse smbios options.\n"); --=20 2.37.1