From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web10.5314.1581922606136981523 for ; Sun, 16 Feb 2020 22:56:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=tTbNMzfR; spf=pass (domain: linaro.org, ip: 209.85.128.65, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wm1-f65.google.com with SMTP id a9so17119978wmj.3 for ; Sun, 16 Feb 2020 22:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=YWj/YgB/pK5rq1806vvrh9Bp9ivPp43jx/Mq06nRP+k=; b=tTbNMzfRJUBdha5ONJ3Q4cdafjILC5A6X6+EC4rhqiGtkmEbpWNZ/8/g5UZthB8eUM folEvL5UYCewbADpFVpXcXsacyPiy1lCsH1D4R5MlUMFZelAwiiiyH6ST0Ri598vANiN pP11kSjV0CBPcxJ4dKb93gHrTbmhQDDznBbsRG8dO4v0KU/A8acJXEoyWRPNOKIHiIZY UIdRt+ADAXwSZTSEgkV/ouXBphWaoC7l7T876zn6ZgnteKYKbiadfI1GTMmZYOyuuECc XKt8K2MNJwkYDQYVHN5fjfqdargAiuqvI4zgwlCANKDoeLQtKOFcwcosQI6diTxgEHX2 Jh8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YWj/YgB/pK5rq1806vvrh9Bp9ivPp43jx/Mq06nRP+k=; b=GWmjcRuHPow8iejYwHteRZwKQgWT8Ea8JZIv5LUYVgr1xhVEDQdbi3/8MzEKeqGLV8 zQGQjN40k5MGHCVl3CVgOAhrM77cciCKohx/40P+RK9XjoCd4cAqspGkBgCZKQa209Pd eMGF0DHUx9hlX2hIbyr9HRL8nNHyn87uxBEf50s35DK6fFf1Oqqphp8L7kNkSgj0iT+x 0A2Zqb8MHZ5j9QAy1pu+a863myHsigzsAQTU+tCv96x87inqD6wD+xr5sLDnRLPtm6Ix WTBlSrVAEeu9I/aG/Anl/7YELfW9mYjshW/aRQmesqfvC+776Cu2mg7K8yf4L/OsCj4e 5zwQ== X-Gm-Message-State: APjAAAWYGXm5G7EFi9UjEfD6AOkm2cDkIq1yTrj8y2Sc+piS6YJK8t/Y WoolUP/jvUcBxtPudwywH4XzeIkpr5zbJayVzwm+Gw== X-Google-Smtp-Source: APXvYqxrtzsuWk5eqAumjLXoS+MI43VzX7F0vek88W/w4KsIiD0rNq1nj/2FAQdKYmzLHyiOcQM6VWigRt8BVq3k6b0= X-Received: by 2002:a1c:bc46:: with SMTP id m67mr19811120wmf.40.1581922604367; Sun, 16 Feb 2020 22:56:44 -0800 (PST) MIME-Version: 1.0 References: <20200130102826.20759-1-gaurav.jain@nxp.com> In-Reply-To: From: "Ard Biesheuvel" Date: Mon, 17 Feb 2020 07:56:33 +0100 Message-ID: Subject: Re: FW: [EXT] Re: [PATCH 1/1] EmbeddedPkg: Fixed Asserts in SCT Runtime Services test. To: Gaurav Jain Cc: "devel@edk2.groups.io" , Leif Lindholm , Pankaj Bansal Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 17 Feb 2020 at 07:25, Gaurav Jain wrote: > > Hi Ard > > I have also checked UEFI Shell Specification Version 2.2(https://uefi.org= /sites/default/files/resources/UEFI_Shell_2_2.pdf) > For date command the range of valid years is from 1998=E2=80=932099 (on p= age 121) > > So Range of valid years is conflicting in UEFI Spec and UEFI Shell Spec. > I think UEFI spec needs to be corrected. What are your thoughts? > Page 121 does not mention data. Page 111 does, and tells me that a two-digit year is interpreted as 199x or 20xx, and a four digit year is interpreted as is. How exactly does that conflict with the UEFI spec? > > > -----Original Message----- > > From: Ard Biesheuvel > > Sent: Tuesday, February 11, 2020 7:50 PM > > To: Gaurav Jain > > Cc: devel@edk2.groups.io; Leif Lindholm ; Pankaj Ban= sal > > > > Subject: Re: FW: [EXT] Re: [PATCH 1/1] EmbeddedPkg: Fixed Asserts in SC= T > > Runtime Services test. > > > > Caution: EXT Email > > > > On Tue, 11 Feb 2020 at 11:37, Gaurav Jain wrote: > > > > > > Hi Ard > > > > > > I am waiting for your response. > > > > > > > You said > > > > > Either UEFI spec need to be modified as per the test or SCT Test need= s fix as > > per UEFI Specification. > > > > > > > so you answered your own question, no? > > > > > -----Original Message----- > > > From: Gaurav Jain > > > Sent: Friday, January 31, 2020 1:58 PM > > > To: Ard Biesheuvel > > > Cc: devel@edk2.groups.io; Leif Lindholm ; Pankaj > > > Bansal > > > Subject: RE: [EXT] Re: [PATCH 1/1] EmbeddedPkg: Fixed Asserts in SCT > > Runtime Services test. > > > > > > > > > > > > > -----Original Message----- > > > > From: Ard Biesheuvel > > > > Sent: Thursday, January 30, 2020 2:52 PM > > > > To: Gaurav Jain > > > > Cc: devel@edk2.groups.io; Leif Lindholm ; Pankaj > > > > Bansal > > > > Subject: [EXT] Re: [PATCH 1/1] EmbeddedPkg: Fixed Asserts in SCT > > > > Runtime Services test. > > > > > > > > Caution: EXT Email > > > > > > > > On Thu, 30 Jan 2020 at 06:08, Gaurav Jain wro= te: > > > > > > > > > > ASSERT in SetTime_Conf and SetWakeupTime_Conf Consistency Test. > > > > > SCT Test expect return as Invalid Parameter. > > > > > So removed ASSERT(). > > > > > > > > > > > > > This is not all this patch does. > > > > > > > > > Signed-off-by: Gaurav Jain > > > > > --- > > > > > EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c | 12 > > > > > ++++++------ > > > > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > > > > > > > diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c > > > > > b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c > > > > > index 08fb9b0100b6..9bfb7756f0cb 100644 > > > > > --- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c > > > > > +++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c > > > > > @@ -85,10 +85,6 @@ IsDayValid ( > > > > > IN EFI_TIME *Time > > > > > ) > > > > > { > > > > > - ASSERT (Time->Day >=3D 1); > > > > > - ASSERT (Time->Day <=3D mDayOfMonth[Time->Month - 1]); > > > > > - ASSERT (Time->Month !=3D 2 || IsLeapYear (Time) || Time->Day <= =3D > > > > > 28); > > > > > - > > > > > if (Time->Day < 1 || > > > > > Time->Day > mDayOfMonth[Time->Month - 1] || > > > > > (Time->Month =3D=3D 2 && !IsLeapYear (Time) && Time->Day >= 28)) > > > > > { @@ -105,14 +101,15 @@ IsTimeValid( > > > > > ) > > > > > { > > > > > // Check the input parameters are within the range specified b= y UEFI > > > > > - if (Time->Year < 1900 || > > > > > - Time->Year > 9999 || > > > > > + if (Time->Year < 1998 || > > > > > + Time->Year > 2099 || > > > > > > > > That original range is based on the UEFI spec. On what basis are yo= u > > > > making this change? > > > > > > > > If your RTC hardware cannot represent the original values, this is > > > > not the place to fix that. > > > > > > As per the UEFI SCT Test, SetWakeupTime_Conf expect > > EFI_INVALID_PARAMETER for Time.Year is 1997 and 2100. > > > Below is the link to check the Test code > > > https://eur01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fg= ith > > > ub.com%2Ftianocore%2Fedk2-test%2Fblob%2Fmaster%2Fuefi- > > sct%2FSctPkg%2FT > > > > > estCase%2FUEFI%2FEFI%2FRuntimeServices%2FTimeServices%2FBlackBoxTes > > t%2 > > > > > FTimeServicesBBTestConformance.c&data=3D02%7C01%7Cgaurav.jain%40 > > nxp. > > > > > com%7C3c6e62107ab149b8709808d7aefd73e8%7C686ea1d3bc2b4c6fa92cd9 > > 9c5c301 > > > > > 635%7C0%7C0%7C637170275901140244&sdata=3D83GGnHy%2BZvzz5yZo > > 8et56FQqH > > > meYimYGB9dJxtlluKM%3D&reserved=3D0 (Line: 847) > > > > > > Either UEFI spec need to be modified as per the test or SCT Test need= s fix as > > per UEFI Specification. > > > > > > > > > > > > > > > > Time->Month < 1 || > > > > > Time->Month > 12 || > > > > > !IsDayValid (Time) || > > > > > Time->Hour > 23 || > > > > > Time->Minute > 59 || > > > > > Time->Second > 59 || > > > > > + Time->Nanosecond > 999999999 || > > > > > !IsValidTimeZone (Time->TimeZone) || > > > > > !IsValidDaylight (Time->Daylight)) { > > > > > return FALSE; > > > > > @@ -254,6 +251,9 @@ SetWakeupTime ( > > > > > OUT EFI_TIME *Time > > > > > ) > > > > > { > > > > > + if (Time =3D=3D NULL || !IsTimeValid (Time)) { > > > > > + return EFI_INVALID_PARAMETER; } > > > > > return LibSetWakeupTime (Enabled, Time); } > > > > > > > > > > -- > > > > > 2.17.1 > > > > >