From nobody Fri Oct 31 03:54:05 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 header.i=teddy.astie@vates.tech; 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=reject dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1755870502; cv=none; d=zohomail.com; s=zohoarc; b=MHyqp+hXaloPpJk7g10vl0xSmYs5+RcyycEXWn5+J69xW1Z8Nl2p3IlTEWP2DcuNZJYS5PG2QkCYI6+LA/6NKOlhdWq47rnFHzSuIjtbwbvb7kXTQ99BgLzQBTBJSdi/A/OfKP8i7uI56beP3WDyVeEiQ/QR1EvquRHw7rZDUsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1755870502; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=c5OS5QfxagAVStqr0nZdnCF+x0ODYhCsWNPi1ffj+Is=; b=OnC3aC1cuM7LbJMe7l0jZkYEg6EYGGkztJgDxI2cdVw/p2f6nx/8tInfSPcCxWdRt7YqiqLPbLcf0NsUbNQO69sYyrLmYUQOG6OZ+hWio1gjeJ7qt620BJNxCNmL6uerUySKEg9Vogo0cRJ6ZvduOjJmhxnk1Eu0loJ6s/tsuNU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=teddy.astie@vates.tech; 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=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1755870502393916.9252800771403; Fri, 22 Aug 2025 06:48:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1090160.1447529 (Exim 4.92) (envelope-from ) id 1upS7d-0007rG-3Z; Fri, 22 Aug 2025 13:48:01 +0000 Received: by outflank-mailman (output) from mailman id 1090160.1447529; Fri, 22 Aug 2025 13:48:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1upS7c-0007r9-WD; Fri, 22 Aug 2025 13:48:01 +0000 Received: by outflank-mailman (input) for mailman id 1090160; Fri, 22 Aug 2025 13:47:58 +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 1upS7a-0007r3-Om for xen-devel@lists.xenproject.org; Fri, 22 Aug 2025 13:47:58 +0000 Received: from mail137-3.atl71.mandrillapp.com (mail137-3.atl71.mandrillapp.com [198.2.137.3]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9afeac70-7f5e-11f0-b898-0df219b8e170; Fri, 22 Aug 2025 15:47:56 +0200 (CEST) Received: from pmta07.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1]) by mail137-3.atl71.mandrillapp.com (Mailchimp) with ESMTP id 4c7hMt2BmWzBsTpGV for ; Fri, 22 Aug 2025 13:47:54 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 5b37ed1022e84a30a8896c5e2e05a47c; Fri, 22 Aug 2025 13:47:54 +0000 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: 9afeac70-7f5e-11f0-b898-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1755870474; x=1756140474; bh=c5OS5QfxagAVStqr0nZdnCF+x0ODYhCsWNPi1ffj+Is=; h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From; b=tr2UTFzTOLWezURzk98M+VMWIRhvDQdVpad2yYYO86pVtpLYpm8n9h0fpBwVFVYim BDfpa3m1FerjO79A2jCW/IpYO5XEawe/bABGMaF0c/S5/EyNNsnGtW28e31DlhK8fo /Y0JSOz+c6k02POsKMp6k3OCmvnUIbjapNVoGwwPxPgLW7yu0urA0dSTcf2O3ZQqXT Zph/fkxnxB6yibYypIiSwzcsm8hfFEa0fxEegtlQqzm92Dl7qusv/IwvDf/rkMmMCj SqUEEBXgEAzcP6TVzn8TzwkDWlTgad9h7yTiTtFB3qHtczxgdirq0i8iWQsdGjMg1g 48EA5YjNLGtqA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1755870474; x=1756130974; i=teddy.astie@vates.tech; bh=c5OS5QfxagAVStqr0nZdnCF+x0ODYhCsWNPi1ffj+Is=; h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From; b=JzmlAM4pSpa/3Q0hJ7oTycPdEllPvdp9wc+nOTLPPYuAWe4SCXrZDeP2UM6RzH9Fy JbF8jLDyVsPmJdq8/rnNEsM2/jvTfCZ6NEEJ5WvwLKCyiErX0/UmGoKZTHIoZ/5PQY l9N4yyxaq1gdsewFh4WwUT/S7bGDu/NjAwA2M1lwWyqeVUPRGI82X+uzKA1k6CffLY LCj4NwT3au6/6937E1zkLu+Z3JC548wzDhyxCp+xB4IewenMlG4YIQD9GVm9JqShK2 UsWm/lprfBkSamTqDrTcdAYhVaL8LSJuO9Y+1vx20JCDcgsDReqbGK46MqLsCfqTkO XJ6rov1rVCKXg== From: "Teddy Astie" Subject: =?utf-8?Q?[PATCH]=20hvmloader:=20Update=20to=20SMBIOS=202.6?= X-Mailer: git-send-email 2.50.1 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1755870473308 To: xen-devel@lists.xenproject.org Cc: "Teddy Astie" , "Jan Beulich" , "Andrew Cooper" , "=?utf-8?Q?Roger=20Pau=20Monn=C3=A9?=" , "Anthony PERARD" Message-Id: X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.5b37ed1022e84a30a8896c5e2e05a47c?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20250822:md Date: Fri, 22 Aug 2025 13:47:54 +0000 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @mandrillapp.com) (identity teddy.astie@vates.tech) X-ZM-MESSAGEID: 1755870503582124100 Content-Type: text/plain; charset="utf-8" Currently, hvmloader uses SMBIOS 2.4, however, when using OVMF, the SMBIOS is patched to 2.8, which has clarified the UUID format (as GUID). In Linux, if the SMBIOS version is >=3D 2.6, the GUID format is used, else (undefined as per SMBIOS spec), big endian is used (used by Xen). Therefore, you have a endian mismatch causing the UUIDs to mismatch in the guest. $ cat /sys/hypervisor/uuid e865e63f-3d30-4f0b-83e0-8fdfc1e30eb7 $ cat /sys/devices/virtual/dmi/id/product_uuid 3fe665e8-303d-0b4f-83e0-8fdfc1e30eb7 $ cat /sys/devices/virtual/dmi/id/product_serial e865e63f-3d30-4f0b-83e0-8fdfc1e30eb7 This patch updates the SMBIOS version from 2.4 to 2.6 and fixup the UUID written in the table; which effectively fix this endianness mismatch with OVMF; while the UUID displayed by Linux is still the same for SeaBIOS. Signed-off-by: Teddy Astie --- This effectively changes the UUID seen with UEFI guests as it was actually inconsistent with SeaBIOS and SMBIOS expectations. --- tools/firmware/hvmloader/smbios.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tools/firmware/hvmloader/smbios.c b/tools/firmware/hvmloader/s= mbios.c index 6bcdcc233a..f4822ae6f8 100644 --- a/tools/firmware/hvmloader/smbios.c +++ b/tools/firmware/hvmloader/smbios.c @@ -352,7 +352,7 @@ smbios_entry_point_init(void *start, memcpy(ep->anchor_string, "_SM_", 4); ep->length =3D 0x1f; ep->smbios_major_version =3D 2; - ep->smbios_minor_version =3D 4; + ep->smbios_minor_version =3D 6; ep->max_structure_size =3D max_structure_size; ep->entry_point_revision =3D 0; memcpy(ep->intermediate_anchor_string, "_DMI_", 5); @@ -462,7 +462,23 @@ smbios_type_1_init(void *start, const char *xen_versio= n, p->version_str =3D 3; p->serial_number_str =3D 4; =20 - memcpy(p->uuid, uuid, 16); + /* + * Xen uses OSF DCE UUIDs which is fully big endian, however, + * GUIDs (which requirement is clarified by SMBIOS >=3D 2.6) has the + * first 3 components appearing as being little endian and the rest + * as still being big endian. + */ + /* First component */ + for ( unsigned int i =3D 0; i < 4; i++ ) + p->uuid[i] =3D uuid[4 - i - 1]; + /* Second component */ + p->uuid[4] =3D uuid[5]; + p->uuid[5] =3D uuid[4]; + /* Third component */ + p->uuid[6] =3D uuid[7]; + p->uuid[7] =3D uuid[6]; + /* Rest */ + memcpy(p->uuid + 8, uuid + 8, 8); =20 p->wake_up_type =3D 0x06; /* power switch */ p->sku_str =3D 0; --=20 2.50.1 | Vates XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech