[edk2-devel] FW: [EXT] Re: [PATCH 1/1] EmbeddedPkg: Fixed Asserts in SCT Runtime Services test.

Ard Biesheuvel ard.biesheuvel at linaro.org
Tue Feb 11 14:19:37 UTC 2020


On Tue, 11 Feb 2020 at 11:37, Gaurav Jain <gaurav.jain at nxp.com> 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 needs 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 <ard.biesheuvel at linaro.org>
> Cc: devel at edk2.groups.io; Leif Lindholm <leif at nuviainc.com>; Pankaj Bansal <pankaj.bansal at nxp.com>
> Subject: RE: [EXT] Re: [PATCH 1/1] EmbeddedPkg: Fixed Asserts in SCT Runtime Services test.
>
>
>
> > -----Original Message-----
> > From: Ard Biesheuvel <ard.biesheuvel at linaro.org>
> > Sent: Thursday, January 30, 2020 2:52 PM
> > To: Gaurav Jain <gaurav.jain at nxp.com>
> > Cc: devel at edk2.groups.io; Leif Lindholm <leif at nuviainc.com>; Pankaj
> > Bansal <pankaj.bansal at nxp.com>
> > 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 <gaurav.jain at nxp.com> wrote:
> > >
> > > 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 <gaurav.jain at nxp.com>
> > > ---
> > >  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 >= 1);
> > > -  ASSERT (Time->Day <= mDayOfMonth[Time->Month - 1]);
> > > -  ASSERT (Time->Month != 2 || IsLeapYear (Time) || Time->Day <=
> > > 28);
> > > -
> > >    if (Time->Day < 1 ||
> > >        Time->Day > mDayOfMonth[Time->Month - 1] ||
> > >        (Time->Month == 2 && !IsLeapYear (Time) && Time->Day > 28)) {
> > > @@ -105,14 +101,15 @@ IsTimeValid(
> > >    )
> > >  {
> > >    // Check the input parameters are within the range specified by 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 you
> > 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://github.com/tianocore/edk2-test/blob/master/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TimeServices/BlackBoxTest/TimeServicesBBTestConformance.c (Line: 847)
>
> Either UEFI spec need to be modified as per the test or SCT Test needs 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 == NULL || !IsTimeValid (Time)) {
> > > +    return EFI_INVALID_PARAMETER;
> > > +  }
> > >    return LibSetWakeupTime (Enabled, Time);  }
> > >
> > > --
> > > 2.17.1
> > >

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54212): https://edk2.groups.io/g/devel/message/54212
Mute This Topic: https://groups.io/mt/71163888/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list