From nobody Sat Apr 20 00:00:10 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1558196362; cv=none; d=zoho.com; s=zohoarc; b=i57+aQRdmKLT8+Q0H0NbPle5aZn2o9XVBgCKekPf9NPGGhXoEeVC3MqYMmPG2TXvbgJgilnAiSxvrnPRvvIhqfakjebr5eZrbLveS76bz8moR3EgPVYoSFUUSbpp2nEjBdYH2A84Wgv5WZLTfbD7Mmlt7ulSihzeHr3KC3GN8uk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558196362; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=llZaZ7ieVojFCkFXLrJD90P41ssCiDo61doruIuaqfQ=; b=Kfv8oaiQSEYJIN3EhaLSAyUkdqX+qcTqgPywzU48morqDeBzfdBvinvrqkhqj3RaclwTMIG5etDO5tnxPHmez19k0Vh4Ir6O2dtaTQo6gt7Ck//DM+sQAjURV9DHEomkgucCbTXBOUWlIcMZ0kEQIpUl48tU8WL0TtZs4Kcujw0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1558196362791101.88880753557726; Sat, 18 May 2019 09:19:22 -0700 (PDT) Received: from [192.168.203.99] (mailu_mailman-core_1.mailu_default [192.168.203.99]) by coreboot.org (Postfix) with ESMTP id EF3C612E2E88; Sat, 18 May 2019 16:19:17 +0000 (UTC) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by coreboot.org (Postfix) with ESMTP id 7CAC312E2E74 for ; Sat, 18 May 2019 16:19:10 +0000 (UTC) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IGIo7g106827; Sat, 18 May 2019 16:18:54 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2sj9ft1ayk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:18:54 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IGGKg4020196; Sat, 18 May 2019 16:16:53 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2sj75se7ne-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:16:53 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x4IGGqNU002122; Sat, 18 May 2019 16:16:52 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 18 May 2019 09:16:52 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=rDYI2jnwAKL6HZCGdqNzK6t4Jdi9+lVDyXiC1TfJBzU=; b=Yhh6JGw2Ge1y04nw0vbFdJ1IGNcnd7qub4sHPpatkljiI9aAOo5T9caeWWmBeYGt6M9T 0GRmAUFEqfQrZapCZR8JnvdjBApXQDjFbDi5y4lRRUMOg4d8vzUyweNPi2/9rFI3BKPf bm5zQNvfI681EiIMQcyxKZ30Fa+mUP8hhW3QZeHcHNzNL08chi/mvC40Yl1/UTdTuybV XSdpHgRf9VDbd70DcjOx7Y/FPk9th7z5oSVilqRqoCDhokb8YkK5DfTZTI7jtOijNs3w lAtl7YBKe072g0eqfpL2HDMDvTfUGZIvPp0OSVQ0boz9Gj5XBSxd30LmhgTkSHNBQB6m Hw== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Sat, 18 May 2019 19:15:37 +0300 Message-Id: <20190518161542.12662-2-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190518161542.12662-1-shmuel.eiderman@oracle.com> References: <20190518161542.12662-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180118 Message-ID-Hash: TZAOEBVLG5RQ3O3U2ROUCG5K7YHTLP6Z X-Message-ID-Hash: TZAOEBVLG5RQ3O3U2ROUCG5K7YHTLP6Z X-MailFrom: shmuel.eiderman@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: arbel.moshe@oracle.com, konrad.wilk@oracle.com X-Mailman-Version: 3.2.2 Precedence: list Subject: [SeaBIOS] [PATCH v2 1/6] bios_date: Make all dates in BIOS consistent List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ++++ X-Spam-Level: **** Authentication-Results: coreboot.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Liran Alon There are 2 places where SeaBIOS reports its release date: 1. SMBIOS Type 0 entry 2. Hard-coded address 0xFFFF5 Previous to this commit, each of these places defined it's own unique date which doesn't make sense. Therefore, define the BIOS date in a single place and make sure all relevant places in code use it. Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/config.h | 11 +++++++++++ src/fw/biostables.c | 1 - src/fw/smbios.c | 3 +-- src/misc.c | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/config.h b/src/config.h index 93c8dbc2..6795440c 100644 --- a/src/config.h +++ b/src/config.h @@ -29,6 +29,17 @@ #define BUILD_SUBMODEL_ID 0x00 #define BUILD_BIOS_REVISION 0x01 =20 +#define BIOS_DATE_MONTH "04" +#define BIOS_DATE_DAY "01" +#define BIOS_DATE_YEAR "14" +#define BIOS_DATE_YEAR_PREFIX "20" +#define BIOS_DATE (BIOS_DATE_MONTH "/" \ + BIOS_DATE_DAY "/" \ + BIOS_DATE_YEAR_PREFIX BIOS_DATE_YEAR) +#define BIOS_DATE_SHORT (BIOS_DATE_MONTH "/" \ + BIOS_DATE_DAY "/" \ + BIOS_DATE_YEAR) + // Various memory addresses used by the code. #define BUILD_STACK_ADDR 0x7000 #define BUILD_S3RESUME_STACK_ADDR 0x1000 diff --git a/src/fw/biostables.c b/src/fw/biostables.c index fe8626ef..b055c9b2 100644 --- a/src/fw/biostables.c +++ b/src/fw/biostables.c @@ -401,7 +401,6 @@ smbios_new_type_0(void *start, } =20 #define BIOS_NAME "SeaBIOS" -#define BIOS_DATE "04/01/2014" =20 static int smbios_romfile_setup(void) diff --git a/src/fw/smbios.c b/src/fw/smbios.c index 62a563b2..96104714 100644 --- a/src/fw/smbios.c +++ b/src/fw/smbios.c @@ -161,7 +161,6 @@ get_external(int type, char **p, unsigned *nr_structs, } while (0) =20 /* Type 0 -- BIOS Information */ -#define RELEASE_DATE_STR "01/01/2011" static void * smbios_init_type_0(void *start) { @@ -179,7 +178,7 @@ smbios_init_type_0(void *start) =20 p->bios_starting_address_segment =3D 0xe800; =20 - load_str_field_with_default(0, bios_release_date_str, RELEASE_DATE_STR= ); + load_str_field_with_default(0, bios_release_date_str, BIOS_DATE); =20 p->bios_rom_size =3D 0; /* FIXME */ =20 diff --git a/src/misc.c b/src/misc.c index b5117304..189d487b 100644 --- a/src/misc.c +++ b/src/misc.c @@ -174,7 +174,7 @@ struct descloc_s rombios32_gdt_48 VARFSEG =3D { ****************************************************************/ =20 // BIOS build date -char BiosDate[] VARFSEGFIXED(0xfff5) =3D "06/23/99"; +char BiosDate[] VARFSEGFIXED(0xfff5) =3D BIOS_DATE_SHORT; =20 u8 BiosModelId VARFSEGFIXED(0xfffe) =3D BUILD_MODEL_ID; =20 --=20 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org From nobody Sat Apr 20 00:00:10 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1558196250; cv=none; d=zoho.com; s=zohoarc; b=H7zy85cOw9QmVt7bNER+OUmOzOAYfdeAlpylOHEYGT3XQ/LWXFcgQCU/atgYuzozbLrhqL3CfM3XjCxO9kxPl6jnfZ+sUpfrGTnFWuY+3xO7qCQ3JEcSgNOWVWzqcJlzjzzMMqFgdrEhiitYrQH2auzyLWFAw9DUvAg6R84KbYc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558196250; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=WkvjLbrT5uJGzhgRYe0WFxXOXOkxmyojCdxeb2W+CEY=; b=QRdTa9S06Jl4eQ3tEEo64qcZ4ePodSU5kC/QwTCcdCnWYA9DmStj2e7MgiEXYhBt1e3/Y/Nx9mbV3r2GWvaay0OiKsR4GLD7ZXuidKr+jVhVt/2BLeDoBvBCrAA8K3zldkCaMwcGkqy7/mAOoQQmXgpEGzs670oP9i6EQ8KMMAk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1558196250358908.999219502207; Sat, 18 May 2019 09:17:30 -0700 (PDT) Received: from [192.168.203.99] (mailu_mailman-core_1.mailu_default [192.168.203.99]) by coreboot.org (Postfix) with ESMTP id 316BC12E2E85; Sat, 18 May 2019 16:17:26 +0000 (UTC) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by coreboot.org (Postfix) with ESMTP id 4386212E2E6B for ; Sat, 18 May 2019 16:17:13 +0000 (UTC) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IG8sxW101444; Sat, 18 May 2019 16:16:56 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2sj9ft1aw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:16:56 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IGG0sd003602; Sat, 18 May 2019 16:16:55 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2sj9chn5h5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:16:55 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x4IGGtWx002132; Sat, 18 May 2019 16:16:55 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 18 May 2019 09:16:54 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=uxLae4GcYP+DjXUsr2yBd+29Jw97iHgDlo9easTqGXc=; b=kcqlJIVCNReQWYNPQ5aKJjBr9Zm2yxut24LnD4LKhpsZx4LlbZCdl0TWrsHPlcyzpIKO /H2MOe4aMun+LBoUdBl+Yx6V9KXCKFCTvGa86NdlGtubFzX1kBKzAYjhsSj9hkDP+Bzt xr89cu0Fj3GPceTrOpq8RY2qd5ztJ14aE1xlctKZwEKUFTqbuFG6QvHJuUqisGVejp3d iy2Vqqxfz2RR3TRNZgyxyOzh+iXl+joIq/LO2i4tdlI+am+Jrqr6oHf8VD42rGf8CVH+ DB/6RxNrQGzq7OIv08nWMHf5/K7JNy3WU97Rp9Lq+ZRWEbu4Wn6cEbcnn5V8DjfNr/Gv cw== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Sat, 18 May 2019 19:15:38 +0300 Message-Id: <20190518161542.12662-3-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190518161542.12662-1-shmuel.eiderman@oracle.com> References: <20190518161542.12662-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 Message-ID-Hash: B6TFV5OP22PBYBPUMHN6B4SWK7LT2SSC X-Message-ID-Hash: B6TFV5OP22PBYBPUMHN6B4SWK7LT2SSC X-MailFrom: shmuel.eiderman@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: arbel.moshe@oracle.com, konrad.wilk@oracle.com X-Mailman-Version: 3.2.2 Precedence: list Subject: [SeaBIOS] [PATCH v2 2/6] bios_date: Make bios date appear once in the ROM List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ++++ X-Spam-Level: **** Authentication-Results: coreboot.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Liran Alon We find all the places which cause BIOS_DATE to appear in the data section and remove them - leaving the only place to contain the contents of BIOS_DATE to be BiosDate at FSEG(0xfff5). We do this by removing the usages of BIOS_DATE and by changing strlen(BIOS_DATE) to sizeof(BIOS_DATE) which works at the preprocessing step - removing the need to add BIOS_DATE as a string in the data section. We will use the fact that BiosDate is now the only place in FSEG containing the date in the next commit. Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/fw/biostables.c | 14 +++++++++++--- src/util.h | 4 ++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/fw/biostables.c b/src/fw/biostables.c index b055c9b2..546e83c6 100644 --- a/src/fw/biostables.c +++ b/src/fw/biostables.c @@ -439,7 +439,7 @@ smbios_romfile_setup(void) if (need_t0) { /* common case: add our own type 0, with 3 strings and 4 '\0's */ u16 t0_len =3D sizeof(struct smbios_type_0) + strlen(BIOS_NAME) + - strlen(VERSION) + strlen(BIOS_DATE) + 4; + strlen(VERSION) + sizeof(BIOS_DATE) + 3; ep.structure_table_length +=3D t0_len; if (t0_len > ep.max_structure_size) ep.max_structure_size =3D t0_len; @@ -459,8 +459,16 @@ smbios_romfile_setup(void) ep.structure_table_address =3D (u32)tables; =20 /* populate final blob */ - if (need_t0) - tables =3D smbios_new_type_0(tables, BIOS_NAME, VERSION, BIOS_DATE= ); + if (need_t0) { + char bios_date[sizeof(BIOS_DATE)]; + memcpy(bios_date, BiosDate, sizeof("mm/dd/") - 1); + memcpy(bios_date + sizeof("mm/dd/") - 1, BIOS_DATE_YEAR_PREFIX, + sizeof("yy") - 1); + memcpy(bios_date + sizeof("mm/dd/yy") - 1, + BiosDate + sizeof("mm/dd/") - 1, + sizeof("yy")); + tables =3D smbios_new_type_0(tables, BIOS_NAME, VERSION, bios_date= ); + } memcpy(tables, qtables, qtables_len); free(qtables); =20 diff --git a/src/util.h b/src/util.h index 6dd080f6..68ba848d 100644 --- a/src/util.h +++ b/src/util.h @@ -2,6 +2,7 @@ #ifndef __UTIL_H #define __UTIL_H =20 +#include "config.h" // BIOS_DATE_SHORT #include "types.h" // u32 =20 // apm.c @@ -243,6 +244,9 @@ void lpt_setup(void); // version.c extern const char VERSION[], BUILDINFO[]; =20 +// misc.c +extern char BiosDate[sizeof(BIOS_DATE_SHORT)] __aligned(1); + // vgahooks.c void handle_155f(struct bregs *regs); void handle_157f(struct bregs *regs); --=20 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org From nobody Sat Apr 20 00:00:10 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1558208553; cv=none; d=zoho.com; s=zohoarc; b=Nba6018hhKYlF03Y741TPsKAwEZDJ6WYPZMJaLIqcJrWOfYBe49BJerfffyoAeYXF94gR3+S/BwQJtg7CR7dnZ6Z/Wmh8dgBoIXZ3l8nv2nqz0jrPMitcbUx6aXa+OzuI4csoaqaDwVjo3Q5DbpsEPTeLDAjxaiAKQJCEceAbZI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558208553; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=+PZNc9I1AH2Zs37rqL50u/v7t8H8tQjS7s18B6yXJGE=; b=GKeqy8FydvgxP4gcJR+QNFV/kc2TrIMPkQXMVrnafc2uekASTJITCyXuDJw6Onet80DpB9JYZ9X8icekkyf0yLEf5uDyrJ4QIz785Jw+yYyGD3swj6XdU76W/ODK0v0HNgErEgKEB3tuNJSfiWATcq5hGDONeGc6v2UyFULtAHc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1558208553151954.1877885658462; Sat, 18 May 2019 12:42:33 -0700 (PDT) Received: from [192.168.203.99] (mailu_mailman-core_1.mailu_default [192.168.203.99]) by coreboot.org (Postfix) with ESMTP id 0506012E2E84; Sat, 18 May 2019 19:42:27 +0000 (UTC) Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by coreboot.org (Postfix) with ESMTP id C242212E111A for ; Sat, 18 May 2019 19:42:16 +0000 (UTC) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IG8rle115911; Sat, 18 May 2019 16:16:58 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 2sj7jd9h6c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:16:58 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IGG2VM003657; Sat, 18 May 2019 16:16:57 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2sj9chn5ha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:16:57 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4IGGvkA025606; Sat, 18 May 2019 16:16:57 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 18 May 2019 09:16:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=IkHgpKgcXflQ7DfCPUACNWMCGlq6rcLC5YIqr5sE43Q=; b=2QO/MOF9MrClQJdsrJQy51RihlNFJPjhTTFfePRspnB20oHy54AuYImabYXGWU0l2ys7 X+FfRM0TPo6BKuJi9khSbrIxhceAXFZwKcc4iYTtS6zgARoaWkxmCN9DK+vE1DpULvfH HvNZWjUd0CjSkcdOdKksHLIOohRtXOGYTjgU5rXT7K6450nw2LQh3aNmVxuxBbaOHX/D zysFUA2HLn8V+Vyj7UHTDhRvlfTxU268MXdsXIXF7ho5B+DR8r+OGB5Egmh+yj1RxOBQ Li2MeGgmEcO872sflu8fF4Eb9y9/8X3/tNXQJb1/i99+KYq71uZQnzaR+MWmadwYAd0v OQ== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Sat, 18 May 2019 19:15:39 +0300 Message-Id: <20190518161542.12662-4-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190518161542.12662-1-shmuel.eiderman@oracle.com> References: <20190518161542.12662-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 Message-ID-Hash: WJHO56DPWQZHLC2KO7JYYWTO5B5OTIYU X-Message-ID-Hash: WJHO56DPWQZHLC2KO7JYYWTO5B5OTIYU X-MailFrom: shmuel.eiderman@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: arbel.moshe@oracle.com, konrad.wilk@oracle.com X-Mailman-Version: 3.2.2 Precedence: list Subject: [SeaBIOS] [PATCH v2 3/6] bios_date: Change BiosDate to SMBIOS bios date List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org X-Spamd-Bar: / X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Liran Alon Windows kernel extracts various BIOS information at boot-time. The method it uses to extract SystemBiosDate is very hueristic. It is done by nt!CmpGetBiosDate(). nt!CmpGetBiosDate() works by scanning all BIOS memory from 0xF0000 to 0xFFFF5 (FSEG) in search for a string which is formatted like a date. It then chooses the string which represents the most recent date, and writes it to: HKLM/HARDWARE/DESCRIPTION/System SystemBiosDate This date should usually be BiosDate located at FSEG(0xFFF5). In some cases when the SMBIOS tables are small enough (both in legacy and non-legacy mode) - These tables are allocated in FSEG instead of high-mem, specifically Type0->release_date string which might cause SystemBiosDate to change - depending on its value. This leads to an inconsistent behaviour that depends on the SMBIOS table sizes. We fix this inconsistency by changing BiosDate to the same value provided by SMBIOS, regardless whether SMBIOS tables reside in FSEG or high-mem. For reference implementation of nt!CmpGetBiosDate(), see ReactOS: https://doxygen.reactos.org/d5/dd2/i386_2cmhardwr_8c.html Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/fw/biostables.c | 36 ++++++++++++++++++++++++++++++++++++ src/fw/smbios.c | 20 +++++++++++++++++++- src/util.h | 1 + 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/src/fw/biostables.c b/src/fw/biostables.c index 546e83c6..90bb3b92 100644 --- a/src/fw/biostables.c +++ b/src/fw/biostables.c @@ -268,6 +268,38 @@ smbios_next(struct smbios_entry_point *smbios, void *p= rev) return prev; } =20 +// Get string from the smbios table. +void * +smbios_get_str(struct smbios_entry_point *smbios, void *offset, u8 n) +{ + if (!smbios || !offset || n =3D=3D 0) + return NULL; + void *start =3D (void*)smbios->structure_table_address; + void *end =3D start + smbios->structure_table_length; + void *prev =3D NULL; + struct smbios_structure_header *hdr =3D offset; + + if (offset + sizeof(*hdr) > end) + return NULL; + + offset +=3D hdr->length; + + while (n > 0) { + prev =3D offset; + while (*(u8*)offset) { + if (offset + 3 > end) + return NULL; /* not enough space for "\0\0" */ + offset++; + } + if (prev =3D=3D offset) + return NULL; /* reached end of table */ + n--; + offset++; + } + + return prev; +} + struct smbios_entry_point *SMBiosAddr; =20 void @@ -409,6 +441,7 @@ smbios_romfile_setup(void) struct romfile_s *f_tables =3D romfile_find("etc/smbios/smbios-tables"= ); struct smbios_entry_point ep; struct smbios_type_0 *t0; + char *release_date; u16 qtables_len, need_t0 =3D 1; u8 *qtables, *tables; =20 @@ -432,6 +465,9 @@ smbios_romfile_setup(void) for (t0 =3D smbios_next(&ep, NULL); t0; t0 =3D smbios_next(&ep, t0)) if (t0->header.type =3D=3D 0) { need_t0 =3D 0; + /* Sync BIOS hardcoded date with the SMBIOS provided one */ + release_date =3D smbios_get_str(&ep, t0, t0->bios_release_date= _str); + smbios_update_bios_date(release_date); break; } =20 diff --git a/src/fw/smbios.c b/src/fw/smbios.c index 96104714..7cb02dba 100644 --- a/src/fw/smbios.c +++ b/src/fw/smbios.c @@ -160,12 +160,26 @@ get_external(int type, char **p, unsigned *nr_structs, } \ } while (0) =20 +void +smbios_update_bios_date(const char *release_date) +{ + if (!release_date) + return; + if (strlen(release_date) =3D=3D sizeof("mm/dd/yyyy") - 1) { + memcpy(BiosDate, release_date, sizeof("mm/dd/") - 1); + memcpy(BiosDate + sizeof("mm/dd/") - 1, + release_date + sizeof("mm/dd/yy") - 1, + sizeof("yy") - 1); + } +} + /* Type 0 -- BIOS Information */ static void * smbios_init_type_0(void *start) { struct smbios_type_0 *p =3D (struct smbios_type_0 *)start; char *end =3D (char *)start + sizeof(struct smbios_type_0); + char *release_date; size_t size; int str_index =3D 0; =20 @@ -178,7 +192,11 @@ smbios_init_type_0(void *start) =20 p->bios_starting_address_segment =3D 0xe800; =20 - load_str_field_with_default(0, bios_release_date_str, BIOS_DATE); + /* Sync BIOS hardcoded date with the SMBIOS provided one */ + release_date =3D end; + load_str_field_with_default(0, bios_release_date_str, BiosDate); + if (p->bios_release_date_str) + smbios_update_bios_date(release_date); =20 p->bios_rom_size =3D 0; /* FIXME */ =20 diff --git a/src/util.h b/src/util.h index 68ba848d..81cddbbd 100644 --- a/src/util.h +++ b/src/util.h @@ -84,6 +84,7 @@ void copy_smbios(void *pos); void display_uuid(void); void copy_table(void *pos); void smbios_setup(void); +void smbios_update_bios_date(const char *release_date); =20 // fw/coreboot.c extern const char *CBvendor, *CBpart; --=20 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org From nobody Sat Apr 20 00:00:10 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1558201237; cv=none; d=zoho.com; s=zohoarc; b=XvMFFvCfd5NEfKilD3peI6JHEgRsj7MtO6cERLafdvl2a0LxCypHE5yOm7L7hpv1kt67pqtKEXH72QdKSmy0Z+pMdfJGJehTrqJFqKDsUPXpoHHH8NQ0qVJnwoOkTweXzAh+r515nczFTUx1rydCHg4uOdhJOXhtJQHFtgGXPvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558201237; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=vdKK2mMpT229cv8HKLeFj0xFZaUUuXYE8YI15OwsaMM=; b=j93W/lzzJpIncbC3SUz3nMkEk2C7QtOhFUYBQKxFp+GUcIRJcN8yud+aDLzztVHGdYLjjAtoxMEKInr6OXRuAO1IP9v/BrAtjjwncXeLO0fORSSmzmX2uC4J4p2K57E7S6P1XDo39vJ4Wl+7W8LUw3aXp1rVMllWJLs0Mnr8Pps= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1558201237207445.54897908724774; Sat, 18 May 2019 10:40:37 -0700 (PDT) Received: from [192.168.203.99] (mailu_mailman-core_1.mailu_default [192.168.203.99]) by coreboot.org (Postfix) with ESMTP id D46F512E2E84; Sat, 18 May 2019 17:40:31 +0000 (UTC) Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by coreboot.org (Postfix) with ESMTP id CC23412E111A for ; Sat, 18 May 2019 17:40:22 +0000 (UTC) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IG9rqu116318; Sat, 18 May 2019 16:17:00 GMT Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 2sj7jd9h6d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:17:00 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IGFcmZ095619; Sat, 18 May 2019 16:16:59 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2sj9v1n08a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:16:59 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4IGGxor006360; Sat, 18 May 2019 16:16:59 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 18 May 2019 09:16:58 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=ntCfU6jZ+YcTTuKHzv4PfXJj4ocKF0ZeLXzKvI6vfmU=; b=i2RV4VoxU6qX33wFKQQdS0XmErA8ga1aR/RQU7bZUc7MG7IL+LlxPsiWyXiLEcEXMeLz ODomDBKRF/YW+PbTdqnrwM7gP3yN/WRWFLQ79IYw6U+uRhQ9AgiXHlmIst1LrRE6Ie2W 3mNlcpEcbKTtxfYGOaavoPdHk1uXDaoZOLHM2c7VsW3VHwLvFZRp3zToMfR770LgKHkN REOeZWy2JxBtRPIKZWgDDWpaeVzfFvFDsacB58txzf+rkEk0EKGMRUGADkL7fKAQlAuZ tfbUjAKn6mbhYYMn+zS6rQWLnerJpAyFeBYJ75rqQfK3fUqJ7pSqaayimwye0MZREOPn VQ== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Sat, 18 May 2019 19:15:40 +0300 Message-Id: <20190518161542.12662-5-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190518161542.12662-1-shmuel.eiderman@oracle.com> References: <20190518161542.12662-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=981 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 Message-ID-Hash: VK5K3OHYQT5UF3KBZ2TR2AHXHX4FXD7J X-Message-ID-Hash: VK5K3OHYQT5UF3KBZ2TR2AHXHX4FXD7J X-MailFrom: shmuel.eiderman@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: arbel.moshe@oracle.com, konrad.wilk@oracle.com X-Mailman-Version: 3.2.2 Precedence: list Subject: [SeaBIOS] [PATCH v2 4/6] bios_date: Add bios date checks in checkrom.py List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: +++++ X-Spam-Level: ***** Authentication-Results: coreboot.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Check that only one bios date appears in the final ROM. The check simulates nt!CmpGetBiosDate() in order to ensure that Windows sees the correct date. For reference implementation of nt!CmpGetBiosDate(), see ReactOS: https://doxygen.reactos.org/d5/dd2/i386_2cmhardwr_8c.html Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- scripts/checkrom.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/checkrom.py b/scripts/checkrom.py index aced5e2c..98cdfa7f 100755 --- a/scripts/checkrom.py +++ b/scripts/checkrom.py @@ -17,6 +17,23 @@ def checksum(data, start, size, csum): sumbyte =3D buildrom.checksum(data[start:start+size]) return subst(data, start+csum, sumbyte) =20 +def check_windows_bios_date(rawdata): + dates =3D [] + for i in xrange(len(rawdata)): + if (rawdata[i+0:i+2].isdigit() and + rawdata[i+2] =3D=3D '/' and + rawdata[i+3:i+5].isdigit() and + rawdata[i+5] =3D=3D '/' and + rawdata[i+6:i+8].isdigit()): + dates.append(rawdata[i:i+8]) + if len(dates) > 1: + print("Warning! More than one date was detected in rom.") + print(" This may cause Windows OS to report incorrect date:") + print(" %s" % (dates, )) + if len(dates) =3D=3D 0: + print("Warning! No dates were detected in rom.") + print(" This may cause Windows OS to report incorrect date.") + def main(): # Get args objinfo, finalsize, rawfile, outfile =3D sys.argv[1:] @@ -46,6 +63,8 @@ def main(): sys.exit(1) =20 # Sanity checks + check_windows_bios_date(rawdata) + start =3D symbols['code32flat_start'].offset end =3D symbols['code32flat_end'].offset expend =3D layoutrom.BUILD_BIOS_ADDR + layoutrom.BUILD_BIOS_SIZE --=20 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org From nobody Sat Apr 20 00:00:10 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1558220906; cv=none; d=zoho.com; s=zohoarc; b=EcInh7+c7IdIjgkGrwrniy0efIyJJycsSYGkLmUa1/Vkdn945cOXFnPrUgC/84TY7BnSEMoD9XVfzlJwKz1eg7gmOc5QxnLUG4yswqqJqhuWFhGm8TVV0t4eTueLiR8yuYpFWrErgfMOzd/xsAfhi6Vm2z4ulwUG7J+qnYAvZg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558220906; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=PcIp9j5YzsqsN9/cjOaedKghhW2oNLs3yef7+FvB9Cc=; b=DF1JgmxJdYq4cagHTNgMDCcUtB85Qx5x8RO4Bdqfsv1+vt8SASuSb/gu6xZ/ctApA/5wwbnrcw6dWO96kssajo5zgdFYRZ/LQN8ldPoOzmQ65X3uWKa5Q6YX/gIDASQTU8tt5y29qbFqwC/5RrKBIaWh0fTjvlcnHxcUaP+dEhQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1558220906638601.5200534556866; Sat, 18 May 2019 16:08:26 -0700 (PDT) Received: from [192.168.203.99] (mailu_mailman-core_1.mailu_default [192.168.203.99]) by coreboot.org (Postfix) with ESMTP id B322612E2E6D; Sat, 18 May 2019 23:08:21 +0000 (UTC) Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by coreboot.org (Postfix) with ESMTP id 0C23212E2E6A for ; Sat, 18 May 2019 23:08:10 +0000 (UTC) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IG8ffB115765; Sat, 18 May 2019 16:17:03 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2130.oracle.com with ESMTP id 2sj7jd9h6k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:17:02 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IGFR9k072911; Sat, 18 May 2019 16:17:02 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 2sj839wsta-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:17:02 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4IGH1wc025617; Sat, 18 May 2019 16:17:01 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 18 May 2019 09:17:01 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=C5eU1fq1MBOEbI8rymkGp5hJZchF5GvHLplUHGwBHiQ=; b=5qLfGTYWC4re3ec6mCfrJQmWSuQGwsou4CBiF/BKs/89Eg5+2yOlajOKbtJBttUg+vy0 Qyy2zonrDVQ3xq7yqQsIDEnX8FVzqcJq2rk+2JLhyPVQfORgtlSHZrCXWUsqmgru1JpI 6spQhZpHkG5i09xGq33qCM7ghoPGaMrkLBy+Ni93huW0w1oB9kBuDEvZw7Nt5N051z0a Qd0wGbHj4UdEaOh/laVQ61ghxPkO0y9eIFaxPKw4+etHYoWcmIGYiUiSjZHlmCRDqQAf 2hFkoXuLun7qlwzhq5pjKo/uAInJ38Kx2kZ51iHhGl6VFNxJ92tD5GAXHf8eW5KZFosC sA== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Sat, 18 May 2019 19:15:41 +0300 Message-Id: <20190518161542.12662-6-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190518161542.12662-1-shmuel.eiderman@oracle.com> References: <20190518161542.12662-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 Message-ID-Hash: JUCOQNXZ325SGGBNN52GWSB5AAPU5YPD X-Message-ID-Hash: JUCOQNXZ325SGGBNN52GWSB5AAPU5YPD X-MailFrom: shmuel.eiderman@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: arbel.moshe@oracle.com, konrad.wilk@oracle.com X-Mailman-Version: 3.2.2 Precedence: list Subject: [SeaBIOS] [PATCH v2 5/6] bios_version: Remove misinterpreted version string List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org X-Spamd-Bar: / X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Liran Alon This is a workaround for the Windows kernel wrongly extracting SystemBiosVersion. Windows kernel extracts various BIOS information at boot-time. The method it use to extract SystemBiosVersion is very hueristic. It is done by nt!CmpGetBiosVersion(). nt!CmpGetBiosVersion() works by scanning all BIOS memory from 0xF0000 to 0xFFFFF in search for a string of the form x.y where x & y are digits. When it finds such a string, it goes a bunch of characters backwards until an unknown character is reached, checks whether the string contains any of "v 0", "v 1", "Rev ", etc... if it does - a match was found. It then continues to find the next matches. In our case, this lead to a debug-print string "Intel IGD BDSM enabled at 0x%08x, size %lldMB, dev 00:02.0" to be treated as BIOS version (Because of "2.0" at the end, and the "v 0" contained in it). This can be seen by: * Typing "wmic bios get biosversion" in CMD * Reading "HKLM\HARDWARE\DESCRIPTION\System" "SystemBiosVersion" Therefore, this commit solves the issue by just creating the "00:02.0" string dynamically, like in the rest of the file. For reference implementation of nt!CmpGetBiosVersion(), see ReactOS: https://doxygen.reactos.org/d5/dd2/i386_2cmhardwr_8c.html Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/fw/pciinit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index c0634bcb..5b934d10 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -328,7 +328,8 @@ static void intel_igd_setup(struct pci_device *dev, voi= d *arg) pci_config_writel(bdf, 0x5C, cpu_to_le32((u32)addr)); =20 dprintf(1, "Intel IGD BDSM enabled at 0x%08x, size %lldMB, dev " - "00:02.0\n", (u32)addr, bdsm_size >> 20); + "%02x:%02x.%x\n", (u32)addr, bdsm_size >> 20, + 0, 2, 0); } } =20 --=20 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org From nobody Sat Apr 20 00:00:10 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1558196246; cv=none; d=zoho.com; s=zohoarc; b=OqzI1V2Y/Eib61Kz00F5c3PzsqFfE6cftqSc7Qhf/C2tlhqABvR5DfzwkN+pIsjMaoOTG3Ua+ojVDyHmx5kkzRCNtgZhc7Hm5ra5XVGoRfemoXbSTzE14EPGSpvWNXKmcnfMNhvns/QM27S1Fa/+vZoCLMFqVrvbNDfuovylfE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558196246; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=+ln+GHjCzYg0leOj/YIhnBFyhWD29Pm1rx/Q3Q5Q2rs=; b=HPRbJ7zJtREEf5S72VUUJR/ybelPIXv5ewx8UUDn6TvWWfr0At94h5nFdQKSYhHDXljF5CyKhzwl2SX+K/DawxfT1UMq6Qm7okoHqE0yLZv5BaQD9ptFAA1ngMzJ5emNrcWB/UCdi/2VoVEYXMlgYXSscCFaZidp20lv0M2eGgU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1558196246066309.5202719389828; Sat, 18 May 2019 09:17:26 -0700 (PDT) Received: from [192.168.203.99] (mailu_mailman-core_1.mailu_default [192.168.203.99]) by coreboot.org (Postfix) with ESMTP id 3643712E2E80; Sat, 18 May 2019 16:17:20 +0000 (UTC) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by coreboot.org (Postfix) with ESMTP id 28CF312E2E80 for ; Sat, 18 May 2019 16:17:12 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IG9Qal116796; Sat, 18 May 2019 16:17:05 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2sjapq16y0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:17:05 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IGFSpr072980; Sat, 18 May 2019 16:17:04 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 2sj839wstg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:17:04 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4IGH3B6025633; Sat, 18 May 2019 16:17:03 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 18 May 2019 09:17:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=ffAmlkj9XaHTgZkkcYNt2WwffpBDXX6mzvsO+qaQx44=; b=TqOaM1uvTtpmZgG4S54sOkJL1p33tMvRuF193EoKWw6nvJrjMUbkkff5mUMfXcyKqL/f wE6BzHSdkRiYFGAxufsKRiGD2S9vyOfCk2bVCXYYA4dUXWHmHSm2igdga0THSzBHFRmF vygaEdUMHdBA/dyTI8zsm6N7XEu3InFgciunq1/+dfspMPubOHWnuwmzle7Yr3iZ51/k mO+3yq3Eg3wyeT8/I39+LO8YvRtUmrQKK5cxUVomYFPoQnVD2hN1w1cA7TfxML7w6X63 uuBDtzyhpVb5OcOoy9W65CbQ+7+67qcHOoNwdCpn+zNVXl6uaTOS0sZqXvYC3bSxyRpd KQ== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Sat, 18 May 2019 19:15:42 +0300 Message-Id: <20190518161542.12662-7-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190518161542.12662-1-shmuel.eiderman@oracle.com> References: <20190518161542.12662-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 Message-ID-Hash: O2WOGLR4BDSWH2S6DZ44YV7IXFFA3E6U X-Message-ID-Hash: O2WOGLR4BDSWH2S6DZ44YV7IXFFA3E6U X-MailFrom: shmuel.eiderman@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: arbel.moshe@oracle.com, konrad.wilk@oracle.com X-Mailman-Version: 3.2.2 Precedence: list Subject: [SeaBIOS] [PATCH v2 6/6] bios_version: Add bios version checks in checkrom.py List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: +++++ X-Spam-Level: ***** Authentication-Results: coreboot.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Check that no version string appear in the final ROM. The check simulates nt!CmpGetBiosVersion() in order to ensure that Windows sees the correct versions. For reference implementation of nt!CmpGetBiosVersion(), see ReactOS: https://doxygen.reactos.org/d5/dd2/i386_2cmhardwr_8c.html Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- scripts/checkrom.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/checkrom.py b/scripts/checkrom.py index 98cdfa7f..a09203fe 100755 --- a/scripts/checkrom.py +++ b/scripts/checkrom.py @@ -34,6 +34,31 @@ def check_windows_bios_date(rawdata): print("Warning! No dates were detected in rom.") print(" This may cause Windows OS to report incorrect date.") =20 +def check_windows_bios_version(rawdata): + versions =3D [] + for i in xrange(len(rawdata)): + if (rawdata[i+0].isdigit() and + rawdata[i+1] =3D=3D '.' and + rawdata[i+2].isdigit()): + p =3D i-1 + while ((p >=3D 0) and (p > i+2-127) + and ord(rawdata[p]) >=3D ord(' ') + and rawdata[p] !=3D '$'): + p -=3D 1 + version =3D rawdata[p+1:i+3] + for s in ["Ver", "Rev", "Rel", + "v0", "v1", "v2", "v3", "v4", + "v5", "v6", "v7", "v8", "v9", + "v 0", "v 1", "v 2", "v 3", "v 4", + "v 5", "v 6", "v 7", "v 8", "v 9"]: + if s in version: + versions.append((rawdata[p+1:i+3], i)) + break + if len(versions) > 0: + print("Warning! Version strings were detected in rom.") + print(" This may cause Windows OS to report incorrect version:") + print(" %s" % (versions, )) + def main(): # Get args objinfo, finalsize, rawfile, outfile =3D sys.argv[1:] @@ -64,6 +89,7 @@ def main(): =20 # Sanity checks check_windows_bios_date(rawdata) + check_windows_bios_version(rawdata) =20 start =3D symbols['code32flat_start'].offset end =3D symbols['code32flat_end'].offset --=20 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org