From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 964F9C433FE for ; Fri, 30 Sep 2022 14:52:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 35408849AA; Fri, 30 Sep 2022 16:52:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="MeCS29Gu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 992BB84CE4; Fri, 30 Sep 2022 16:52:05 +0200 (CEST) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B9B56848DC for ; Fri, 30 Sep 2022 16:52:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82c.google.com with SMTP id cj27so2778069qtb.7 for ; Fri, 30 Sep 2022 07:52:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=UV1BK5x3vrPQywIgpEigV1jlHAi8e+Tybfrb1J4X4bA=; b=MeCS29GuWh5XQ3RnvhvueWQE+Y1HqO46nFe/xDjP3qgQEhcHW5mlt6LX0hz0W37jB+ WK8yqaQ2T8BajeKk64U6Ann+wyjEZdRUVQL2o1oHQN/9wiNC5bb5gaku1NaBBe9mclyE d1iQepVJY66Pk2apSAepy5uylUljTKhJDpRvY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=UV1BK5x3vrPQywIgpEigV1jlHAi8e+Tybfrb1J4X4bA=; b=nZRhfNZwyDYOubJ0Mvia8igRBbtwwpRkxATJem7rhKS0QUTF+OvtaskxrVueoe2KLo XWEBXdeAn4cp4L3MsRHPNA6UJu2r7STrVPmafS8ehjoHzO3lW86NDBfnezS+6NxboDQT 40gohUqQfnPGFyOr02jFMCj2EzgHbAYmMdd3HT1LdyMia7RHxg/P6NtBQd+l3ueBP8Eg S5H1ywCqh48KKiw+3kUPMmkCCr1tLayDVgq+vVYvZ4zCYAXBisyMDbDtMWY9MPdmzhTI yefGUzpPKoiH6JEQpKKS6evoywgWE1857AzeLZTlwkyUAuu6d5FP725ih5JMlYi46gkK eSUg== X-Gm-Message-State: ACrzQf1WcSCga7/o8b/Odw3Ee97p7SF1QHljZunb+Xwg9nnzlKcOUVFr WP9Vael/QxUBfxJkrEEt1dGGeg== X-Google-Smtp-Source: AMsMyM6eIQdlXh4Q5mUYGEObN43ihRzzC6h54xWz4b8cHkHgFaPUnl1FYixK5D6KSCjolUv5Arm0QQ== X-Received: by 2002:ac8:5b05:0:b0:35c:e1ed:a816 with SMTP id m5-20020ac85b05000000b0035ce1eda816mr7005447qtw.208.1664549520355; Fri, 30 Sep 2022 07:52:00 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-0186-ea3a-a82b-3964.res6.spectrum.com. [2603:6081:7b00:6400:186:ea3a:a82b:3964]) by smtp.gmail.com with ESMTPSA id i13-20020a05620a248d00b006cbe3be300esm2830683qkn.12.2022.09.30.07.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 07:51:59 -0700 (PDT) Date: Fri, 30 Sep 2022 10:51:57 -0400 From: Tom Rini To: Mark Kettenis Cc: Simon Glass , ilias.apalodimas@linaro.org, pbrobinson@gmail.com, u-boot@lists.denx.de, heinrich.schuchardt@canonical.com Subject: Re: [PATCH 2/2] smbios: Fallback to the default DT if sysinfo nodes are missing Message-ID: <20220930145157.GU3044094@bill-the-cat> References: <20220906134426.53748-1-ilias.apalodimas@linaro.org> <20220906134426.53748-2-ilias.apalodimas@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Udr3zdleqapns69J" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean --Udr3zdleqapns69J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 30, 2022 at 11:56:53AM +0200, Mark Kettenis wrote: > > From: Simon Glass > > Date: Thu, 29 Sep 2022 17:55:43 -0600 > >=20 > > Hi Ilias, > >=20 > > On Thu, 29 Sept 2022 at 04:23, Ilias Apalodimas > > wrote: > > > > > > Hi Simon, > > > > > > On Thu, Sep 29, 2022 at 03:59:51AM -0600, Simon Glass wrote: > > > > Hi, > > > > > > > > On Tue, 20 Sept 2022 at 05:10, Peter Robinson wrote: > > > > > > > > > > On Tue, Sep 6, 2022 at 2:44 PM Ilias Apalodimas > > > > > wrote: > > > > > > > > > > > > In order to fill in the SMBIOS tables U-Boot currently relies o= n a > > > > > > "u-boot,sysinfo-smbios" compatible node. This is fine for the = boards > > > > > > that already include such nodes. However with some recent EFI = changes, > > > > > > the majority of boards can boot up distros, which usually rely = on > > > > > > things like dmidecode etc for their reporting. For boards that > > > > > > lack this special node the SMBIOS output looks like: > > > > > > > > > > > > System Information > > > > > > Manufacturer: Unknown > > > > > > Product Name: Unknown > > > > > > Version: Unknown > > > > > > Serial Number: Unknown > > > > > > UUID: Not Settable > > > > > > Wake-up Type: Reserved > > > > > > SKU Number: Unknown > > > > > > Family: Unknown > > > > > > > > > > > > This looks problematic since most of the info are "Unknown". T= he DT spec > > > > > > specifies standard properties containing relevant information l= ike > > > > > > 'model' and 'compatible' for which the suggested format is > > > > > > . So let's add a last resort to our current > > > > > > smbios parsing. If none of the sysinfo properties are found, = we can > > > > > > scan the root node for 'model' and 'compatible'. > > > > > > > > > > I don't think the information below all needs to go in the commit, > > > > > maybe in the cover letter? > > > > > > > > > > > pre-patch dmidecode: > > > > > > > > > > > > Handle 0x0001, DMI type 1, 27 bytes > > > > > > System Information > > > > > > Manufacturer: Unknown > > > > > > Product Name: Unknown > > > > > > Version: Unknown > > > > > > Serial Number: Unknown > > > > > > UUID: Not Settable > > > > > > Wake-up Type: Reserved > > > > > > SKU Number: Unknown > > > > > > Family: Unknown > > > > > > > > > > > > Handle 0x0002, DMI type 2, 14 bytes > > > > > > Base Board Information > > > > > > Manufacturer: Unknown > > > > > > Product Name: Unknown > > > > > > Version: Unknown > > > > > > Serial Number: Not Specified > > > > > > Asset Tag: Unknown > > > > > > Features: > > > > > > Board is a hosting board > > > > > > Location In Chassis: Not Specified > > > > > > Chassis Handle: 0x0000 > > > > > > Type: Motherboard > > > > > > > > > > > > Handle 0x0003, DMI type 3, 21 bytes > > > > > > Chassis Information > > > > > > Manufacturer: Unknown > > > > > > Type: Desktop > > > > > > Lock: Not Present > > > > > > Version: Not Specified > > > > > > Serial Number: Not Specified > > > > > > Asset Tag: Not Specified > > > > > > Boot-up State: Safe > > > > > > Power Supply State: Safe > > > > > > Thermal State: Safe > > > > > > Security Status: None > > > > > > OEM Information: 0x00000000 > > > > > > Height: Unspecified > > > > > > Number Of Power Cords: Unspecified > > > > > > Contained Elements: 0 > > > > > > > > > > > > > > > > > > post-pastch dmidecode: > > > > > > > > > > > > Handle 0x0001, DMI type 1, 27 bytes > > > > > > System Information > > > > > > Manufacturer: socionext,developer-box > > > > > > Product Name: Socionext Developer Box > > > > > > Version: Unknown > > > > > > Serial Number: Unknown > > > > > > UUID: Not Settable > > > > > > Wake-up Type: Reserved > > > > > > SKU Number: Unknown > > > > > > Family: Unknown > > > > > > > > > > > > Handle 0x0002, DMI type 2, 14 bytes > > > > > > Base Board Information > > > > > > Manufacturer: socionext,developer-box > > > > > > Product Name: Socionext Developer Box > > > > > > Version: Unknown > > > > > > Serial Number: Not Specified > > > > > > Asset Tag: Unknown > > > > > > Features: > > > > > > Board is a hosting board > > > > > > Location In Chassis: Not Specified > > > > > > Chassis Handle: 0x0000 > > > > > > Type: Motherboard > > > > > > > > > > > > Handle 0x0003, DMI type 3, 21 bytes > > > > > > Chassis Information > > > > > > Manufacturer: socionext,developer-box > > > > > > Type: Desktop > > > > > > Lock: Not Present > > > > > > Version: Not Specified > > > > > > Serial Number: Not Specified > > > > > > Asset Tag: Not Specified > > > > > > Boot-up State: Safe > > > > > > Power Supply State: Safe > > > > > > Thermal State: Safe > > > > > > Security Status: None > > > > > > OEM Information: 0x00000000 > > > > > > Height: Unspecified > > > > > > Number Of Power Cords: Unspecified > > > > > > Contained Elements: 0 > > > > > > > > > > > > > > > > > > Signed-off-by: Ilias Apalodimas > > > > > > > > > > Reviewed-by: Peter Robinson > > > > > Tested-by: Peter Robinson > > > > > > > > > > > --- > > > > > > lib/smbios.c | 41 +++++++++++++++++++++++++++++++++++++++-- > > > > > > 1 file changed, 39 insertions(+), 2 deletions(-) > > > > > > > > I've thought about this a lot. > > > > > > > > As I mentioned earlier, we should require boards to add this > > > > information when they enable GENERATE_SMBIOS_TABLE > > > > > > > > It is a simple patch for each board vendor and it solves the proble= m. > > > > What we have here just masks it. > > > > > > > > > Not entirely. I think we just see the problem differently here. I a= gree > > > that the code here masks a problem (but only for *some* boards) and i= deally > > > we should go and add smbios nodes on the boards that miss it. Howeve= r we > > > conveniently keep ignoring OF_BOARD here. Until those things are doc= umented > > > in a spec and you can *demand* a previous bootloader to include it, w= e'll have > > > boards that display "Unknown" all over the place. Personally I don't > > > think that's acceptable, hence the last resort solution. > >=20 > > I think you mean OF_HAS_PRIOR_STAGE - we have an explicit Kconfig now. > >=20 > > We can easily make U-Boot halt if the info is not there but it is > > needed. That will cause people to fix it for their board. >=20 > That seems unecessarily harsh... >=20 > The smbios stuff is by no means essential to run an OS on a board. On > many low-end (or user assembled) x86 machines it is full of lies as > well (gotta love all those machines with serial number 123456789) and > a lot of the information in the tables doesn't make sense for > "embedded" boards anyway. At best the smbios tables are a "nice to > have" feature. But it seems to be mostly a box ticking excercise to > me. This is another point I'd been trying to think how to best bring up. The majority of x86 HW I've ever used is full of useless values. Even my laptop has some to be filled in values. So it's entirely reasonable I think to populate some default values and document how and where to put something more correct, when it's possible / useful. --=20 Tom --Udr3zdleqapns69J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmM3AooACgkQFHw5/5Y0 tyx/xwv8DEcYdoCtomshTdFRM7yiqz4SUTrINPlwsDUrj2RhIHaM3u2L/zN5gozk ICR/2IMRUnXB5caejru0/sC3MiTCUpvy57WP/5fPUDL8qZazzFc7GjmYNmV7Ov+N 2u4Iz+m/dODe7vX8GUMsjUr/jrVeRI7XvDnhrj6J0WXsiLUn76jV5op4DxE6d2tu wXukI5f58j3e/hYd5jJZho/EQEWBF7HZdee5ENsyq8tVXeo6cMvk1urEeXorT30u wgiRnUWCHF7ugsaRpjQ68i6JU3JaE8h02q3aEXQ92Gdr8JV2duC8ztcMcRyyRIct Sel/3m17xJBoTTYUqdiXGcfLYQvzsVxYB04Sg4qBzf0nn+3+5fadlAWDGA1pemI6 Q0kG8kUg6Dv0bQkb/T6mRVye8i5GCarVtqshAh+QHuYBU6VW0Qf9fiIkfJvV+oyV 9FL20goqCMZv8TNtlEFqiErUgXjCIkYtePE+49ouAdqIK95YxKVgnixdQW9W6FUQ oXom7+Ov =LPLP -----END PGP SIGNATURE----- --Udr3zdleqapns69J--