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 X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEAD9C47094 for ; Thu, 10 Jun 2021 10:19:02 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C7C08613E9 for ; Thu, 10 Jun 2021 10:19:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7C08613E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 10CE282CBE; Thu, 10 Jun 2021 12:19:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Xa0otv3z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D95B782D5E; Thu, 10 Jun 2021 12:18:57 +0200 (CEST) Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) (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 62611819C3 for ; Thu, 10 Jun 2021 12:18:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-yb1-xb2c.google.com with SMTP id g142so20663825ybf.9 for ; Thu, 10 Jun 2021 03:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1GB8GY5Eeitad0DyCAukpoJRuQgjoalky4gBq+QQf7I=; b=Xa0otv3zuW6XAy05VjdJTsxzVGuHrupIETmIPgPfn8vayaOaMOo2ygDgs50kpv9Mo6 PR6aBKmAB58cvO4vKF2p7zJrnkhc1iU2JlgcPC8MJUzcS2MlifYMBcSNs9tpU6bxgL99 z2FPhXhm++GG88akjOWFI/Z0B/U/F4qIPCreqJFJnjQ4xJhKb236cs6SPaM/vYjztt5a /x0j4K+JFDShdCY25K2Wytrd2SuOp8ZUEJbuGY6TDYM/YMuNncMtckgGkdtzPxK2ia1h HfPNV8D4VVR+a7xG9mu8ih0Jnz0oguRC/+EluDN2+usNIo39hR/tISOgkH7ZWDZy63v1 V/7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1GB8GY5Eeitad0DyCAukpoJRuQgjoalky4gBq+QQf7I=; b=qKC2TO5xueqRzXAaSxc8wdbskdxZUVb53c4GimpjkTmuaccotryRx4H32E6GVlyk/r 9IBqixWfgk+tqwlv/qQ4CEQjxYtEiW1Bi1eF55yYAetOdEA2Cx+00ACLNacr80fKa7lt umFaoyF9yf86ABpb9qIXyeACgn2m6lqWDtGduk/2AmUMuccyes4TMOOToYbHwmar8xH4 s3j17pzgAPvtyABsZBy6i8RjyYCK+GizIL9ByRPjYNYucJWZOVTZm7pLZNLjZRulu8RU u/99lEOeSpGjP4Z71VCA7Q4DeccHlWc6pDhJ8/xMP/g+Dv+WoXXLb6Copxv7S7fBSk9V ZbgA== X-Gm-Message-State: AOAM5325c3of7gnzRGwJ1qHtTftgTscsodMtogN7dPI+NKoIkIaz/XYv 7DgCwChu8InOwdDF1vAfjGW569RTTM+Lvm1XzUiCwg== X-Google-Smtp-Source: ABdhPJw6ubfhD/HqTs8mX+P4HK0ie341H0yUZQ39h3alDQVeS5cCeWscCQ0sUu3o5gInuRVIEJC59urRNCY0dlImNws= X-Received: by 2002:a05:6902:102d:: with SMTP id x13mr6734982ybt.408.1623320333135; Thu, 10 Jun 2021 03:18:53 -0700 (PDT) MIME-Version: 1.0 References: <20210609151448.828133-1-ilias.apalodimas@linaro.org> <838cf80e-1a3f-3ff0-65ce-d7676ec80c87@gmx.de> In-Reply-To: <838cf80e-1a3f-3ff0-65ce-d7676ec80c87@gmx.de> From: Ilias Apalodimas Date: Thu, 10 Jun 2021 13:18:17 +0300 Message-ID: Subject: Re: [PATCH] smbios: Fix BIOS Characteristics Extension Byte 2 To: Heinrich Schuchardt Cc: Bin Meng , Simon Glass , Christian Gmeiner , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean Hi Heinrich On Thu, 10 Jun 2021 at 13:16, Heinrich Schuchardt wrote: > > On 6/9/21 5:14 PM, Ilias Apalodimas wrote: > > We currently define the EFI support of an SMBIOS table as the third bit of > > "BIOS Characteristics Extension Byte 1". The latest DMTF spec defines it > > on "BIOS Characteristics Extension Byte 2". > > > > Signed-off-by: Ilias Apalodimas > > --- > > include/smbios.h | 2 +- > > lib/smbios.c | 5 +++-- > > 2 files changed, 4 insertions(+), 3 deletions(-) > > > > diff --git a/include/smbios.h b/include/smbios.h > > index ffeefb47372d..fc49fc10b9d7 100644 > > --- a/include/smbios.h > > +++ b/include/smbios.h > > @@ -60,7 +60,7 @@ struct __packed smbios_entry { > > #define BIOS_CHARACTERISTICS_SELECTABLE_BOOT (1 << 16) > > > > #define BIOS_CHARACTERISTICS_EXT1_ACPI (1 << 0) > > -#define BIOS_CHARACTERISTICS_EXT1_UEFI (1 << 3) > > +#define BIOS_CHARACTERISTICS_EXT2_UEFI (1 << 3) > > #define BIOS_CHARACTERISTICS_EXT2_TARGET (1 << 2) > > > > struct __packed smbios_type0 { > > diff --git a/lib/smbios.c b/lib/smbios.c > > index 9eb226ec9fbd..abdd157a7084 100644 > > --- a/lib/smbios.c > > +++ b/lib/smbios.c > > @@ -214,6 +214,7 @@ static int smbios_write_type0(ulong *current, int handle, > > gd->smbios_version = ctx->last_str; > > log_debug("smbios_version = %p: '%s'\n", gd->smbios_version, > > gd->smbios_version); > > + t->bios_characteristics_ext2 = 0; > > #ifdef LOG_DEBUG > > print_buffer((ulong)gd->smbios_version, gd->smbios_version, > > 1, strlen(gd->smbios_version) + 1, 0); > > @@ -229,9 +230,9 @@ static int smbios_write_type0(ulong *current, int handle, > > t->bios_characteristics_ext1 = BIOS_CHARACTERISTICS_EXT1_ACPI; > > This looks fishy. Where is t->bios_characteristics_ext1 initialized if > CONFIG_GENERATE_ACPI_TABLE=n? efi_smbios_register() does not zero out > the memory. > > We should initialize the field irrespective of the configuration and > then use a bitwise or here. > > > #endif > > #ifdef CONFIG_EFI_LOADER > > - t->bios_characteristics_ext1 |= BIOS_CHARACTERISTICS_EXT1_UEFI; > > + t->bios_characteristics_ext2 |= BIOS_CHARACTERISTICS_EXT2_UEFI; > > #endif > > - t->bios_characteristics_ext2 = BIOS_CHARACTERISTICS_EXT2_TARGET; > > + t->bios_characteristics_ext2 |= BIOS_CHARACTERISTICS_EXT2_TARGET; > > Where is t->bios_characteristics_ext2 initialized? > We don't want random bytes. A few lines above, in this patchset > > @Simon: > The usage of ulong instead of pointers in this module does not make > sense to me. If the sandbox needs to call it, it should map its virtual > addresses. We should not spill those conversion into non-sandbox code. > > Best regards > > Heinrich > > > > > /* bios_major_release has only one byte, so drop century */ > > t->bios_major_release = U_BOOT_VERSION_NUM % 100; > > >