From nobody Mon Sep 16 19:06:51 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