From nobody Fri Apr 26 19:27:18 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=1558144281; cv=none; d=zoho.com; s=zohoarc; b=n8rufykJ3OYoLErFgMuL8FboqxfATm3mLB9aa8M557S+KBjZlhF855q85iQI138M4jKKzBSkMINnzNOLf7vZQ3DkKPpDxB5/TJ5p0e6+j6o2UwDhpRKxPbsBtTnA9DKCz0nWwWwa8h24OXvKSKGWXeWvlOHXfO2Zu2Ime/f+mE4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558144281; 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=UqOqwzotjI9vzfcnhmMbYTmPjW1JWKOxyu9EobbpECuEnOJCv9N/YdZ0phkPSH0WyfYKU3h0kPnjxH6+s4N0Js5MuDujOylj4SUVFUvIhe6fmcVJ9CScVSi36cmNE5pvQhUcAcgxmGAmRs6iQAaT57njWf4C4Z4rUEKv0OahZ3o= 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 1558144281405772.1987860844666; Fri, 17 May 2019 18:51:21 -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 20F7012E2E6F; Sat, 18 May 2019 01:46:17 +0000 (UTC) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by coreboot.org (Postfix) with ESMTP id 1DFBA12E2E6D for ; Sat, 18 May 2019 01:46:08 +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 x4HKnU65002449; Fri, 17 May 2019 20:57:45 GMT Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2sdq1r3yxj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:45 +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 x4HKvSEQ110165; Fri, 17 May 2019 20:57:44 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2sgp33tr2a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:44 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4HKvi8K027030; Fri, 17 May 2019 20:57:44 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 May 2019 20:57:43 +0000 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=hDLIacza7VIST83khWq7nFHFd49JhmXV2Em14OyAY8NN1CNn2MHVB4gGm0gHQrOgvi4I Dcdu3aHHUgmIvYeHfYJ9pwJBaUUM4KWlV0qiDIlt+OwbYgu2/w/WRoUx8pWXym9l4sbQ vcx0QpyJr/ufJtI4bqrm9j0J4Pi/yo4v+Yaka5mmtg6DcTPSDjHz9H24W6TNhqrp4vh2 XAjMJ/Uv8BXeUATMjOJ7iC/80t5OzfyPvg3yyAbbu2VCIhkloaLmDF1iWbj1kWaGSx5L 0NggTXPf/VSaxbizDGlTeF35VlYnDgWzBrg5hj17F998ld+hNxbhMjAEY4klGrDaq6V/ fw== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Fri, 17 May 2019 23:57:21 +0300 Message-Id: <20190517205726.34703-2-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190517205726.34703-1-shmuel.eiderman@oracle.com> References: <20190517205726.34703-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 Message-ID-Hash: GI4OKRVC4ARY7JB45Y2JQZH7HWA3FXCN X-Message-ID-Hash: GI4OKRVC4ARY7JB45Y2JQZH7HWA3FXCN 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 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 Fri Apr 26 19:27:18 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=1558130239; cv=none; d=zoho.com; s=zohoarc; b=O9FxS1ERrw1+juqNaF6f3demkQ9fEm7CzCq0BFegNMrxeWCggaYfuS5DZaaxJHw+8eI5Scvzl0FlKjBGrnX7HGNi3XalykCzPZ5WU6UV0H7+ld9mG3CpiDjE0sQ5vQjKuPgR40tfh/PN7z08oGhVoamJLrskOSsLsFG2qfFdYSo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558130239; 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=eNh7MjCecuZzE7AkqjzhwqGLfvCgckvi1beJgb/TDnWp/O9I58RM5Tsps08XfqzVzO6wA9krfW3gVtTrcUpq5QmArpFQY2710NXK9CtKMVF7rFZ/BCyMK4o+a4VutgO+BceAx4SUEhFBOe1VKpvXWl5HXJbdGv8oiaCfBH24THQ= 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 1558130239449145.61273503918073; Fri, 17 May 2019 14:57:19 -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 7B2B012E2E6E; Fri, 17 May 2019 21:57:14 +0000 (UTC) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by coreboot.org (Postfix) with ESMTP id C44A512E2E67 for ; Fri, 17 May 2019 21:57:06 +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 x4HKnwwH002931; Fri, 17 May 2019 20:57:47 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2sdq1r3yxn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:47 +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 x4HKvQaE087551; Fri, 17 May 2019 20:57:46 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2sggeugp5p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:46 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x4HKvjnj023166; Fri, 17 May 2019 20:57:46 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 May 2019 20:57:45 +0000 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=HYCSl0r9Jq1I89IDO3RjrC5xzjOTXVTNskRAjx+EG0yVyGtjgkje3W4eFYyeF1Z83VKP W3kwr149kxI7DLrqDWzBdm4aowyXP7zWqS78dRNIprwkNKcZF5Cbc0rQOjJmTnwQHZmw DsPgMgrDIjtQGAVdV1Jv3nr+RgpDc+iHEBEgE+W/CZp59ZKYMRLA0m3lfALQm0B66fcr Uy2gkMGzeYQfIczP1ZkW85mirMjevNQciLHUctjQmcNSfmKyd00/lYAmgq0Vn43jrys2 j3GrpZ8jZHPV+e6+HH1vQ7yPhW5gGdBK9e4XeNdlUVWMDTca9vkpE1+FzG/U78amY91O 3A== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Fri, 17 May 2019 23:57:22 +0300 Message-Id: <20190517205726.34703-3-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190517205726.34703-1-shmuel.eiderman@oracle.com> References: <20190517205726.34703-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 Message-ID-Hash: RNLQ6RUZN6HM3U5BMQSKZEAZUWLV4IER X-Message-ID-Hash: RNLQ6RUZN6HM3U5BMQSKZEAZUWLV4IER 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 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 Fri Apr 26 19:27:18 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=1558142395; cv=none; d=zoho.com; s=zohoarc; b=cvCS8qcNoSIdi0doUaUllCNE6Ec0n5KtbmSbKhyCMHzWYh05NpbtJyr05GG536b6q/X7BK8VWLp53FUOtTO+id0CulGW2371EHX9v/5ulHF0e6Kt7+Pn8C67fegp+oTU44JORYUAd3JcLQO6phOmRDtiFse1HE+oTGsW7NsJnWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558142395; 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=FvWUTE7xdtSE705roh2w2f/ZXYXnnuaTMhGYPU01eheNCgVOhfCslk2Fbfaxz8e+Y8w/CCscqCi4Y2hydGIgNCWALswYJsZZlpm868rqgXPoZMrQF46dA/2b2YHeCac8stCeqzbmXuO/EwtO0KFU65bEf3ZTexjXTH6dNX/MYl4= 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 1558142395386134.1443064095796; Fri, 17 May 2019 18:19:55 -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 1FB4012E2E72; Sat, 18 May 2019 00:53:21 +0000 (UTC) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by coreboot.org (Postfix) with ESMTP id 5A01412E2E6F for ; Sat, 18 May 2019 00:53:12 +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 x4HKnIYT183164; Fri, 17 May 2019 20:57:49 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2sdntuc2qa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:48 +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 x4HKvirj020337; Fri, 17 May 2019 20:57:48 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2shh5h9dm6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:48 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4HKvlLF011231; Fri, 17 May 2019 20:57:47 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 May 2019 20:57:47 +0000 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=NHwxRxH44HwMBHTaRMd4VW+gjm5A63MLN0L0wpbhk0/p4r+AFd+7mxrq+3D6hLs0hHdo r0oxzandRtygVQib5yzh4tQhrLerEjJzcSYr1g6kGtLdrev1Mqd/LaFUF0eSU3VC0sFw vizP0W5xlWouKGbi7jWRcNB+H970uQshpE4/cG/EZs7Ew4CSsvHksCToiHMl9tO/on0J OaDoCoEQ5Sg5pXVMGu/LNvQfFMLj0KdPpF4ecJK4hP8YebV+0Xq963VLd1szHDwMveKE dCdVw6mAV6p23LYMCqWh/iUNgK20UNQDm8IMOz6gFWqOEVz1DD/bRLK0If+S5tYV5bXv zA== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Fri, 17 May 2019 23:57:23 +0300 Message-Id: <20190517205726.34703-4-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190517205726.34703-1-shmuel.eiderman@oracle.com> References: <20190517205726.34703-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 Message-ID-Hash: PF2HHXKIDU2SET7Y6VPXX365NNRCZ22M X-Message-ID-Hash: PF2HHXKIDU2SET7Y6VPXX365NNRCZ22M 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 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 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 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 Fri Apr 26 19:27:18 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=1558146295; cv=none; d=zoho.com; s=zohoarc; b=RzIHxdJfICbacguZKzB56KtzP3mWAg2ORSntp25WQltv+g+yOXn0SNxbbxUMRUVd49a85beCIXiYruY6I4h6x2Z4GmEXF+oxgI5CMavqrcjvBJvV0M5xkjJwO9W6w+C+iB6ptPLZHjw2ze+91BqABXjOaoIAm6CJpMMdCtNj6ZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558146295; 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=EJc0MLm4LQ+NolOkGodUudexTv6CE4lcjL4Jzcrc93lFGtdZ+zQ9yQKFEui/C3a4icgu7HYKFeFPnyMj5xjInRHOxJK9G1qVKSEssux94GIizcOGPmXE4cHFR4GRyU797TG8DNB/TE3g8LPYyF2HFCeQjjemmNcREpbE3gFdAoM= 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 1558146295617693.71668184785; Fri, 17 May 2019 19:24:55 -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 E155D12E2E74; Sat, 18 May 2019 02:13:02 +0000 (UTC) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by coreboot.org (Postfix) with ESMTP id 26DBF12E2E6E for ; Sat, 18 May 2019 02:12:48 +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 x4HKnGdx002384; Fri, 17 May 2019 20:57:50 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2sdq1r3yxy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:50 +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 x4HKuZxf033124; Fri, 17 May 2019 20:57:50 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 2sgkx4wcut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:50 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4HKvn17011300; Fri, 17 May 2019 20:57:49 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 May 2019 20:57:49 +0000 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=uWoM2tGPNltxGJoyAK8PmZyZWp+N97Ge0cx899eZBWv/4xkCbLWHtgM7o2CElmcHSBFC RcZsVI1AhQEahe3mZgXHxvaQpdBq52h3CX5RoLfHDRhaW6q/aQ20VOSFmvLQmkorqPbd xHF8vUB6AX9UddGM17OLJSk56ilE4l3tm9wZ4YUEnyTOSRPdMN2BlLThKRoN9NiQpYWH LLIAe0Vz/S6SMZ/zlDyw+7qaN4e3gv/NwtHn+W5SOVN+QpHBzpktyY5Ua3RblAXrIC8F imT4cLJHR0TOc2VIS+AQzMu6aqUWkJwNkqYWUFVZGTC1EkSmBZTPUtA1lWKqyoJPWL2L /g== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Fri, 17 May 2019 23:57:24 +0300 Message-Id: <20190517205726.34703-5-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190517205726.34703-1-shmuel.eiderman@oracle.com> References: <20190517205726.34703-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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=978 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905170124 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 Message-ID-Hash: 4SQC5TNJ2LGMMYDUUYYRIDNQZ4WFHQVY X-Message-ID-Hash: 4SQC5TNJ2LGMMYDUUYYRIDNQZ4WFHQVY 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 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 Fri Apr 26 19:27:18 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=1558133152; cv=none; d=zoho.com; s=zohoarc; b=BiJnB5yHoeGOIACNAXOW/1jumfk0gIJm31WpjDqvhNb1r+n2luKaXIghpgGXTpiPUe/MKb22GrFN31ssvyg9HRlXGCZiVUC8jqRnq86Z9mBSz90ieSNSpH9vM6nUULrQQe3n+2FRycF+8k0TzwuWxwZ7t3JL/We7IvAD7Sr5hwM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558133152; 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=Ut2GULl4aRwYRYIKmroCFqOGhxmNY+q7gBBoD/2UMXM=; b=KllGjBrfkaktHv2cg1iTLzN8MziON0is8frv8HPzRNMck4LZQ81w+hF3jqDwJ5+bfS+EZvwojAFIKG93OXpfOnk4QT+b2K6+k2Re6fALRl4jAmgTMrYQL57ezfA/GteyVpzt1O51eo7RPjvBtp5VGKr1XzqbfOv3cVjyXUMH/24= 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 1558133152710160.1091642095106; Fri, 17 May 2019 15:45:52 -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 98FCE12E2E72; Fri, 17 May 2019 22:45:48 +0000 (UTC) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by coreboot.org (Postfix) with ESMTP id D847612E2E6F for ; Fri, 17 May 2019 22:45:39 +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 x4HKnUxv183198; Fri, 17 May 2019 20:57:52 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2sdntuc2qf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:52 +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 x4HKuIqK032686; Fri, 17 May 2019 20:57:52 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 2sgkx4wcuw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:52 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x4HKvpNN006611; Fri, 17 May 2019 20:57:51 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 May 2019 20:57:51 +0000 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=2Lb9sc0HhT5ggDU7I+Y22YArGwq13JIjvVpxMZbAXng=; b=4MiC7+7xTyqem0JcRG8zABiOikFAsLichthc1XveFnUaOpHGmJKmjN+zRFVjzmjqP2rY Tcq4xpxsclit4PIfe7pM6z2m+tYbTHqQyRxXorIG4amcE0bGrhfQ+dRhjb15tia2nBgs XvFSbFlwQl5u7TSx1EzjNh16waJ4Ycz3B/VQBpIipTzg0y1/z4R11H01nGrU+IL4RVSk F4tEkhmgE7bSrxd4DFN2rVqPheNJc0P5cNBm4MN1J+SwqENo6+XPvEImiwA+kxHRaw0q cFULs9UES3343cEyHWz2VzhmBz19p1oK9I26l51UxotA57AjY1PSL6fTGQCoXxTfvBbx mg== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Fri, 17 May 2019 23:57:25 +0300 Message-Id: <20190517205726.34703-6-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190517205726.34703-1-shmuel.eiderman@oracle.com> References: <20190517205726.34703-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 Message-ID-Hash: MHQQKGMFJKR5TMEH5BOCY2IACDZZ5GL2 X-Message-ID-Hash: MHQQKGMFJKR5TMEH5BOCY2IACDZZ5GL2 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 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 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 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 modifying "00:02.0" to "00:02:00". 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index c0634bcb..4ab9b724 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -328,7 +328,7 @@ 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); + "00:02:00\n", (u32)addr, bdsm_size >> 20); } } =20 --=20 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org From nobody Fri Apr 26 19:27:18 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=1558143827; cv=none; d=zoho.com; s=zohoarc; b=buj6SCxY2n6krHzrnATBFV6YhN7AU6tEc/6JyOGMM6oGCEgCzpWQwu3qqBqwnB8BsvE3yVRaZQWZGEeuUmuvK2Q6VbAFUNszfTPnRWUG2bZzr150bGxd7kPOF5IplFsMJa8TQOJcxSRoPz831XPUXbnZP6n65lHBU/KIcnFRa14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558143827; 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=icw0s2vgXdGLt9qAOZKcUMMj9wjLC2KCp+7vbggOMssH1Nu3/SsAU1gBcadx/KVR2Gi/5a/LNCxUghqp7BmrKXnwlrp+XnAUt8Il8/4apWPbhOHZFIS/E7KKHvdR/yLJEDEEG5ETmbYI6kGp4CAjtsg35uosrb6LFifjFtpWxXo= 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 1558143827100418.9326963107545; Fri, 17 May 2019 18:43:47 -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 308E112E2E70; Sat, 18 May 2019 01:24:49 +0000 (UTC) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by coreboot.org (Postfix) with ESMTP id 1962B12E2E6E for ; Sat, 18 May 2019 01:24:35 +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 x4HKnIYU183164; Fri, 17 May 2019 20:57:55 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2sdntuc2qj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:55 +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 x4HKvSuk087632; Fri, 17 May 2019 20:57:55 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 2sggeugp6s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:55 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4HKvrAp027183; Fri, 17 May 2019 20:57:54 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 May 2019 20:57:53 +0000 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=J1ZNiVe8/DBLpl9xI8GJVH2fNC711gCVttULWkk90yP5Z587dapdb6yzVpu998PhojSV C0D0hl1PZjy/dI7CfLwekmwg9FRTJVEQMwOf+AFVH0nKmRTWo24kBpYd2IxUd4zmuSjJ 0ROB6oiH0khYc11sF4tmGLYd3ToRw8kgKNO9YZmaErJJEsQCbGosWohSmM12dt06KGgW euzLHWjOhilGqZnKWxyMEZ0Kli3JDhWC7LPsXDunjMSj/Nf8nQneCJohf1tznXazbcqN 6/cKAIClTGdbfyNTCJwKxuO5uzQB6lQou6pdCGpMntDA2zVhetWElCoQ7oQt0KyAHcdG AQ== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Fri, 17 May 2019 23:57:26 +0300 Message-Id: <20190517205726.34703-7-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190517205726.34703-1-shmuel.eiderman@oracle.com> References: <20190517205726.34703-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 Message-ID-Hash: KKTEGEVASVNECACAHAEK357NHQT44E2P X-Message-ID-Hash: KKTEGEVASVNECACAHAEK357NHQT44E2P 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 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