From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mx.groups.io with SMTP id smtpd.web10.10690.1581430789844883255 for ; Tue, 11 Feb 2020 06:19:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=BHsvhpp/; spf=pass (domain: linaro.org, ip: 209.85.221.66, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-wr1-f66.google.com with SMTP id w15so12601840wru.4 for ; Tue, 11 Feb 2020 06:19:49 -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; bh=NZl1NoYYHeYg87DfJlRl4GoD5ke1zgXBjCzGYe9ZqAQ=; b=BHsvhpp/CBNCVeoLzuAmQ0PtKPdPWHVQ2B9oHj3OdS7lDedV1XDX7X5S3EafYn6pQC lejYD6APkMmRuWHnBluN1ENEEZUdD79o06QCAD8VJdh5EF2rT03kouAI85eyVzaO/Zgo fvPza5NV1BO2lesA2NYmoJzUcEat8+ugftGQeIQ4uOZ329YMYJNWutQmpqzgbaKNrl79 mjFWXzD5vd7HclW1F3rBt+6t3tQylh+L80Yn+6UtogZ5bTQ2rWPit1xIzuRwRBoqagP/ kdnuyq4XSsMNcdW43ZACOzsQpRyvcGKovv/LcRaXagzfaxxnZXU26CHlkXsKQtSBIO/x XTtw== 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; bh=NZl1NoYYHeYg87DfJlRl4GoD5ke1zgXBjCzGYe9ZqAQ=; b=nIRPhw7vFdaqkyh5PMjnU1wFpIr3OXgW/UpSEo/o0PyBQ6p4mYrKGtQHHDeAzIpj17 TIercZR6/WtVE/lfxWy6TUN9XtvzohzGnSpsbQb2CiQEiSueMzZ+R/tA/nFPbfWbmO+3 /bewgQMLmnbJOAGdy1XaU6xnZe2t8KiLP3uMiXsz7L6N3syUY0dyAE5t9Y+42h8vNe5N F36chKwpzq7zCnvG+t3sHeb0osmws1torfcKF0laxghAiGCJtVGBE4/qk2CQ2/3oxPGG quo71vPUGfABhDLrNKo9TiyxU7KGID9cKIt2XgbqtDzbabnEzbpkmfPxed3hcSsdaDy5 ypOg== X-Gm-Message-State: APjAAAVUeNXkqQAQpfH7fOcPMoMZdkA50lvH9QM31liz1cwuHWmOGQfV HrWtlxcfPhfHxfiq1xhj/c30VICrhcAk7AWPdjaXGw== X-Google-Smtp-Source: APXvYqwDGniRl/bpcgAkfvskeQbw1b1p8KOwXJdVL/qQ/QEw09Fsc28L9uVQpxjo8ovt6oa4uTbxCI8swdtp8+Iu9zE= X-Received: by 2002:a5d:6a4b:: with SMTP id t11mr8700696wrw.262.1581430788274; Tue, 11 Feb 2020 06:19:48 -0800 (PST) MIME-Version: 1.0 References: <20200130102826.20759-1-gaurav.jain@nxp.com> In-Reply-To: From: "Ard Biesheuvel" Date: Tue, 11 Feb 2020 14:19:37 +0000 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" 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 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 > 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 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 > > > --- > > > 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 > > >