public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms PATCH v2 0/2] Fix some issues on SynQuacer
@ 2021-07-26  8:27 Masami Hiramatsu
  2021-07-26  8:28 ` [edk2-platforms PATCH v2 1/2] Silicon/SynQuacer/OpteeRngDxe: Fix invalid parameter check Masami Hiramatsu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2021-07-26  8:27 UTC (permalink / raw)
  To: Ard Biesheuvel, Leif Lindholm, Sumit Garg
  Cc: sakamoto.kazuhiko, masami.hiramatsu, devel

Hello,

Here is the 2nd version of the patches to fix 2 issues on SynQuacer platform support.
I and Sakamoto-san found these issues in edk2-test testcases on SynQuacer
DeveloperBox platfrom.

Previous version are here;

https://edk2.groups.io/g/devel/message/77085
https://edk2.groups.io/g/devel/message/77086

In this version, I grouped these 2 patches and update patch changelog.

[1/2] Fixes OpteeRng driver to check invalid parameter correctly.
      Without this fix, edk2-test BBTestGetRNGConformanceTestCheckpoint1
      reports an error.

[2/2] Fixes Pcf8563RealTimeClockLib to clear unused Nanosecond field.
      Without this fix, edk2-test BBTestGetTimeInterfaceTest and
      BBTestSetTimeInterfaceTest failed. Moreover, 'date' and 'time'
      commands on UEFI shell can not set the time.

Thank you,

---

Masami Hiramatsu (2):
      Silicon/SynQuacer/OpteeRngDxe: Fix invalid parameter check
      Silicon/NXP/Pcf8563RealTimeClockLib: Clear Nanosecond field in GetTime


 .../Pcf8563RealTimeClockLib.c                      |    2 ++
 .../SynQuacer/Drivers/OpteeRngDxe/OpteeRng.c       |    5 ++---
 2 files changed, 4 insertions(+), 3 deletions(-)

--
Masami Hiramatsu <masami.hiramatsu@linaro.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [edk2-platforms PATCH v2 1/2] Silicon/SynQuacer/OpteeRngDxe: Fix invalid parameter check
  2021-07-26  8:27 [edk2-platforms PATCH v2 0/2] Fix some issues on SynQuacer Masami Hiramatsu
@ 2021-07-26  8:28 ` Masami Hiramatsu
  2021-07-26  8:28 ` [edk2-platforms PATCH v2 2/2] Silicon/NXP/Pcf8563RealTimeClockLib: Clear Nanosecond field in GetTime Masami Hiramatsu
  2021-07-28 10:44 ` [edk2-devel] [edk2-platforms PATCH v2 0/2] Fix some issues on SynQuacer Ard Biesheuvel
  2 siblings, 0 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2021-07-26  8:28 UTC (permalink / raw)
  To: Ard Biesheuvel, Leif Lindholm, Sumit Garg
  Cc: sakamoto.kazuhiko, masami.hiramatsu, devel

Fix invalid parameter case according to the UEFI spec 2.9,
section 37.5 EFI_RNG_PROTOCOL.GetRNG. The spec said,
"RNGValue is null or RNGValueLength is zero." instead of
"RNGValue is NULL and RNGValueLength is non-zero."

This fixes the mOpteeRng::GetRNG() to check the invalid
parameter case correctly.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reported-by: Kazuhiko Sakamoto <sakamoto.kazuhiko@socionext.com>
---
 Changes in v2:
   - Update changelog.
---
 .../SynQuacer/Drivers/OpteeRngDxe/OpteeRng.c       |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Silicon/Socionext/SynQuacer/Drivers/OpteeRngDxe/OpteeRng.c b/Silicon/Socionext/SynQuacer/Drivers/OpteeRngDxe/OpteeRng.c
index 51c15b1b94..333a3e625c 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/OpteeRngDxe/OpteeRng.c
+++ b/Silicon/Socionext/SynQuacer/Drivers/OpteeRngDxe/OpteeRng.c
@@ -98,8 +98,7 @@ GetInfo (
   @retval EFI_NOT_READY           There is not enough random data available to
                                   satisfy the length requested by
                                   RNGValueLength.
-  @retval EFI_INVALID_PARAMETER   RNGValue is NULL and RNGValueLength is
-                                  non-zero.
+  @retval EFI_INVALID_PARAMETER   RNGValue is NULL or RNGValueLength is zero.
 
 **/
 STATIC
@@ -119,7 +118,7 @@ GetRNG (
   UINTN                      OutSize;
   UINTN                      WaitMiliSeconds;
 
-  if ((Value == NULL) && (ValueLength != 0)) {
+  if ((Value == NULL) || (ValueLength == 0)) {
     return EFI_INVALID_PARAMETER;
   }
 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [edk2-platforms PATCH v2 2/2] Silicon/NXP/Pcf8563RealTimeClockLib: Clear Nanosecond field in GetTime
  2021-07-26  8:27 [edk2-platforms PATCH v2 0/2] Fix some issues on SynQuacer Masami Hiramatsu
  2021-07-26  8:28 ` [edk2-platforms PATCH v2 1/2] Silicon/SynQuacer/OpteeRngDxe: Fix invalid parameter check Masami Hiramatsu
@ 2021-07-26  8:28 ` Masami Hiramatsu
  2021-07-28 10:44 ` [edk2-devel] [edk2-platforms PATCH v2 0/2] Fix some issues on SynQuacer Ard Biesheuvel
  2 siblings, 0 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2021-07-26  8:28 UTC (permalink / raw)
  To: Ard Biesheuvel, Leif Lindholm, Sumit Garg
  Cc: sakamoto.kazuhiko, masami.hiramatsu, devel

Clear unsupported Nanosecond field of the EFI_TIME data structure.
Without this fix, date/time commands on UEFI shell fail to set
because of the invaild parameter error.
This is tested on the SynQuacer DeveloperBox platform which also
uses 'Pcf8563' RTC chip.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reported-by: Kazuhiko Sakamoto <sakamoto.kazuhiko@socionext.com>
---
 Changes in v2:
   - Update changelog.
---
 .../Pcf8563RealTimeClockLib.c                      |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c
index 7310fecb39..b79ea89fea 100644
--- a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c
+++ b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c
@@ -117,6 +117,8 @@ LibGetTime (
     return EFI_DEVICE_ERROR;
   }
 
+  Time->Nanosecond = 0;
+
   if ((DateTime.VL_seconds & PCF8563_CLOCK_INVALID) != 0) {
       Time->Second  = 0;
       Time->Minute  = 0;


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [edk2-platforms PATCH v2 0/2] Fix some issues on SynQuacer
  2021-07-26  8:27 [edk2-platforms PATCH v2 0/2] Fix some issues on SynQuacer Masami Hiramatsu
  2021-07-26  8:28 ` [edk2-platforms PATCH v2 1/2] Silicon/SynQuacer/OpteeRngDxe: Fix invalid parameter check Masami Hiramatsu
  2021-07-26  8:28 ` [edk2-platforms PATCH v2 2/2] Silicon/NXP/Pcf8563RealTimeClockLib: Clear Nanosecond field in GetTime Masami Hiramatsu
@ 2021-07-28 10:44 ` Ard Biesheuvel
  2021-07-28 10:51   ` Masami Hiramatsu
  2 siblings, 1 reply; 5+ messages in thread
From: Ard Biesheuvel @ 2021-07-28 10:44 UTC (permalink / raw)
  To: edk2-devel-groups-io, Masami Hiramatsu
  Cc: Leif Lindholm, Sumit Garg, Kazuhiko Sakamoto

On Mon, 26 Jul 2021 at 10:28, Masami Hiramatsu
<masami.hiramatsu@linaro.org> wrote:
>
> Hello,
>
> Here is the 2nd version of the patches to fix 2 issues on SynQuacer platform support.
> I and Sakamoto-san found these issues in edk2-test testcases on SynQuacer
> DeveloperBox platfrom.
>
> Previous version are here;
>
> https://edk2.groups.io/g/devel/message/77085
> https://edk2.groups.io/g/devel/message/77086
>
> In this version, I grouped these 2 patches and update patch changelog.
>
> [1/2] Fixes OpteeRng driver to check invalid parameter correctly.
>       Without this fix, edk2-test BBTestGetRNGConformanceTestCheckpoint1
>       reports an error.
>
> [2/2] Fixes Pcf8563RealTimeClockLib to clear unused Nanosecond field.
>       Without this fix, edk2-test BBTestGetTimeInterfaceTest and
>       BBTestSetTimeInterfaceTest failed. Moreover, 'date' and 'time'
>       commands on UEFI shell can not set the time.
>
> Thank you,
>
> ---
>
> Masami Hiramatsu (2):
>       Silicon/SynQuacer/OpteeRngDxe: Fix invalid parameter check
>       Silicon/NXP/Pcf8563RealTimeClockLib: Clear Nanosecond field in GetTime
>

Thank you Masami.

Pushed as 194269223294..c131fed73d37



>
>  .../Pcf8563RealTimeClockLib.c                      |    2 ++
>  .../SynQuacer/Drivers/OpteeRngDxe/OpteeRng.c       |    5 ++---
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
> --
> Masami Hiramatsu <masami.hiramatsu@linaro.org>
>
>
> 
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [edk2-platforms PATCH v2 0/2] Fix some issues on SynQuacer
  2021-07-28 10:44 ` [edk2-devel] [edk2-platforms PATCH v2 0/2] Fix some issues on SynQuacer Ard Biesheuvel
@ 2021-07-28 10:51   ` Masami Hiramatsu
  0 siblings, 0 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2021-07-28 10:51 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: edk2-devel-groups-io, Leif Lindholm, Sumit Garg,
	Kazuhiko Sakamoto

2021年7月28日(水) 19:44 Ard Biesheuvel <ardb@kernel.org>:
>
> On Mon, 26 Jul 2021 at 10:28, Masami Hiramatsu
> <masami.hiramatsu@linaro.org> wrote:
> >
> > Hello,
> >
> > Here is the 2nd version of the patches to fix 2 issues on SynQuacer platform support.
> > I and Sakamoto-san found these issues in edk2-test testcases on SynQuacer
> > DeveloperBox platfrom.
> >
> > Previous version are here;
> >
> > https://edk2.groups.io/g/devel/message/77085
> > https://edk2.groups.io/g/devel/message/77086
> >
> > In this version, I grouped these 2 patches and update patch changelog.
> >
> > [1/2] Fixes OpteeRng driver to check invalid parameter correctly.
> >       Without this fix, edk2-test BBTestGetRNGConformanceTestCheckpoint1
> >       reports an error.
> >
> > [2/2] Fixes Pcf8563RealTimeClockLib to clear unused Nanosecond field.
> >       Without this fix, edk2-test BBTestGetTimeInterfaceTest and
> >       BBTestSetTimeInterfaceTest failed. Moreover, 'date' and 'time'
> >       commands on UEFI shell can not set the time.
> >
> > Thank you,
> >
> > ---
> >
> > Masami Hiramatsu (2):
> >       Silicon/SynQuacer/OpteeRngDxe: Fix invalid parameter check
> >       Silicon/NXP/Pcf8563RealTimeClockLib: Clear Nanosecond field in GetTime
> >
>
> Thank you Masami.
>
> Pushed as 194269223294..c131fed73d37

Thank you Ard!

-- 
Masami Hiramatsu

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-28 10:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-26  8:27 [edk2-platforms PATCH v2 0/2] Fix some issues on SynQuacer Masami Hiramatsu
2021-07-26  8:28 ` [edk2-platforms PATCH v2 1/2] Silicon/SynQuacer/OpteeRngDxe: Fix invalid parameter check Masami Hiramatsu
2021-07-26  8:28 ` [edk2-platforms PATCH v2 2/2] Silicon/NXP/Pcf8563RealTimeClockLib: Clear Nanosecond field in GetTime Masami Hiramatsu
2021-07-28 10:44 ` [edk2-devel] [edk2-platforms PATCH v2 0/2] Fix some issues on SynQuacer Ard Biesheuvel
2021-07-28 10:51   ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox