From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.14340.1589469303571944550 for ; Thu, 14 May 2020 08:15:04 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: kaix.yau@intel.com) IronPort-SDR: tP4tDycv28FCJKTtqWgf+2Yad7u+bEdHpCpDNdoQSuL9+/nRStq9NxjDiE/8rfm6+ewi+68Rk9 ajwePSDYm+SA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2020 08:11:02 -0700 IronPort-SDR: AeySrIdNXy3Lv6O0Rq//wdmdrIrjc7jyB8kkgRonkrFd53e2KUjnXTCqXsNBisJE1c4SpW4yAq lTv0z4ot7crw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,391,1583222400"; d="scan'208";a="372299952" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 14 May 2020 08:11:01 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 14 May 2020 08:11:01 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 14 May 2020 08:11:00 -0700 Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmsx601.amr.corp.intel.com ([10.18.126.81]) with mapi id 15.01.1713.004; Thu, 14 May 2020 08:11:00 -0700 From: "Yau, KaiX" To: "Ni, Ray" , "Zhao, Lijian" , "devel@edk2.groups.io" , "kaiyau@gmail.com" CC: "Jiang, Guomin" , "Gao, Liming" , "Archield, Ralphal" Subject: Re: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR displayed in SETUP Thread-Topic: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR displayed in SETUP Thread-Index: AQHV/mhcwW9QFsxhHkms/DTjASpqC6iNGC0A//+XApCAF8k1AP//i0oQgAC0wYD//4t0kAA8LaEAAA6L/TD//6GZgIAAaPkg///e1YD///HiIIABOZ+AgABz4fD//7nYAAAAnSoAAAKP8wD///c5UA== Date: Thu, 14 May 2020 15:11:00 +0000 Message-ID: <863273f6f51647388e503bb6533dba17@intel.com> References: <50102ef8b38c0e5287ab4d1cb8fc636213f67299.1584672719.git.kaix.yau@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C51152B@SHSMSX104.ccr.corp.intel.com> <3f6385f623054e24b44a375765246d2f@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53809A@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53887A@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53A7C4@SHSMSX104.ccr.corp.intel.com> <213de571cb0b4471852cb3b8c616a8da@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53A9CE@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53B2D9@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C54B533@SHSMSX104.ccr.corp.intel.com> <60626824a24d48e69db0b3745b216921@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C54DE3F@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C54E1E6@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C54E1E6@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows x-originating-ip: [10.1.200.100] MIME-Version: 1.0 Return-Path: kaix.yau@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable HI Ray, RtcTimeFieldsValid() cannot catch this error because ConvertRtcTimeToEfiTim= e() made the wrong year, but it is still in the range. ConvertRtcTimeToEfiTime() made 2099 become 1999. 1999 is still valid in Rtc= TimeFieldsValid(). I understand the risk of using CMOS century value. And there is also a Y2K = patch. The limitation is very minor. I am going to close the HSD. Regards Kai Yau -----Original Message----- From: Ni, Ray =20 Sent: Thursday, May 14, 2020 3:09 AM To: Zhao, Lijian ; Yau, KaiX ; d= evel@edk2.groups.io; kaiyau@gmail.com Cc: Jiang, Guomin ; Gao, Liming ; Archield, Ralphal Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR display= ed in SETUP Lijian, Yeah. I might learn the CMOS/RTC from the same page you shared when I creat= e the two PCDs and the accordingly logic. Just guess as what the page says. I double checked the existing code. RtcTimeFieldsValid() contains logic to check all date/time value read from = RTC HW and PcRtcInit() re-inits the RTC HW if date/time in HW is invalid. Thanks, Ray > -----Original Message----- > From: Zhao, Lijian > Sent: Thursday, May 14, 2020 1:56 PM > To: Ni, Ray ; Yau, KaiX ;=20 > devel@edk2.groups.io; kaiyau@gmail.com > Cc: Jiang, Guomin ; Gao, Liming=20 > ; Archield, Ralphal > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR=20 > displayed in SETUP >=20 > https://wiki.osdev.org/CMOS#Century_Register >=20 > Yes that's not fixed or defined in original IBM standard >=20 > -----Original Message----- > From: Ni, Ray > Sent: Thursday, May 14, 2020 1:38 PM > To: Yau, KaiX ; devel@edk2.groups.io;=20 > kaiyau@gmail.com > Cc: Jiang, Guomin ; Gao, Liming=20 > ; Archield, Ralphal=20 > ; Zhao, Lijian > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR=20 > displayed in SETUP >=20 > Kai, > Thanks for telling me the commit message can help understand. >=20 > RTC HW updates the year/month/day/hour/minute/second every second. > But the year stored in RTC is only the last two digits of the 4-digit yea= r. >=20 > Storing the century (high 2 digits) in CMOS is a choice of platform imple= mentation and cannot work for all the cases. >=20 > Supposing now we are in the last second of 2099, RTC HW updates the=20 > value in RTC to 00(year)/1(month)/1(day)/0(hour)/0(minute)/0(second).=20 > But it doesn't update the century value in CMOS leaving that value 20. > Then the time will be interpreted as 2000/1/1/0/0/0. >=20 > That's why RTC driver only updates the century in CMOS when platform=20 > reports the century location through the FADT table. Please understand RT= C driver updates it because platform requires it (through reporting CMOS lo= cation in FADT.). >=20 > Please also try to understand that the location of century in CMOS is pla= tform dependent. > There is no standard to define location for all x86 systems. >=20 > Thanks, > Ray >=20 > > -----Original Message----- > > From: Yau, KaiX > > Sent: Thursday, May 14, 2020 11:36 AM > > To: Ni, Ray ; devel@edk2.groups.io;=20 > > kaiyau@gmail.com > > Cc: Jiang, Guomin ; Gao, Liming=20 > > ; Archield, Ralphal=20 > > ; Zhao, Lijian > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR=20 > > displayed in SETUP > > > > Hi Ray, > > > > I read your comment from gitk. > > I understand why you changed them to 1998 and 2097. > > > > May I know why we don't read the Century value from CMOS in the beginni= ng? > > Some boards does not support? Or the RTC address may be different f= or different boards? > > > > Regards > > Kai Yau > > > > -----Original Message----- > > From: Ni, Ray > > Sent: Wednesday, May 13, 2020 10:55 PM > > To: Yau, KaiX ; devel@edk2.groups.io;=20 > > kaiyau@gmail.com > > Cc: Jiang, Guomin ; Gao, Liming=20 > > ; Archield, Ralphal=20 > > ; Zhao, Lijian > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR=20 > > displayed in SETUP > > > > Kai, > > I created the initial design and made the initial change: using the two= PCD to help code decide the correct century value. > > More comments below. > > > > > -----Original Message----- > > > From: Yau, KaiX > > > Sent: Thursday, May 14, 2020 1:14 AM > > > To: Ni, Ray ; devel@edk2.groups.io;=20 > > > kaiyau@gmail.com > > > Cc: Jiang, Guomin ; Gao, Liming=20 > > > ; Archield, Ralphal=20 > > > ; Zhao, Lijian > > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System=20 > > > YEAR displayed in SETUP > > > > > > Hi, > > > > > > The current logic has two limitations: > > > 1. it has to be 100 years apart (already mentioned in DEC file) > > I agree it's a limitation. I don't want to solve this limitation with c= urrent RTC HW. > > > > > 2. the century numbers have to be same in order to work. (19XX,=20 > > > 20XX will not work) (20xx, 21xx will not work) Since now is 2020,=20 > > > the value has to be 2000, 2099. But BIOS developers does not > > know this limitation. > > I don't agree. Let's forget other argue points and just focus on this p= oint. > > Can you please explain why with the PCD value (1998,2097) cannot suppor= t this year 2020? >=20 >=20