[edk2-devel] [Patch 1/1] OvmfPkg/Xen: Fix VS2019 build issues

Michael D Kinney michael.d.kinney at intel.com
Thu Nov 11 19:45:56 UTC 2021



> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Philippe Mathieu-Daudé
> Sent: Thursday, November 11, 2021 2:24 AM
> To: devel at edk2.groups.io; Kinney, Michael D <michael.d.kinney at intel.com>
> Cc: Anthony Perard <anthony.perard at citrix.com>; Julien Grall <julien at xen.org>; Ard Biesheuvel <ardb+tianocore at kernel.org>;
> Yao, Jiewen <jiewen.yao at intel.com>; Justen, Jordan L <jordan.l.justen at intel.com>; Gerd Hoffmann <kraxel at redhat.com>
> Subject: Re: [edk2-devel] [Patch 1/1] OvmfPkg/Xen: Fix VS2019 build issues
> 
> Hi Michael,
> 
> On 11/8/21 17:22, Michael D Kinney wrote:
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3722
> >
> > Fix VS2019 NOOPT build issues related to converting
> > a larger integer value to a smaller integer value.
> >
> > Cc: Anthony Perard <anthony.perard at citrix.com>
> > Cc: Julien Grall <julien at xen.org>
> > Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>
> > Cc: Jiewen Yao <jiewen.yao at intel.com>
> > Cc: Jordan Justen <jordan.l.justen at intel.com>
> > Cc: Gerd Hoffmann <kraxel at redhat.com>
> > Signed-off-by: Michael D Kinney <michael.d.kinney at intel.com>
> > ---
> >  .../Library/XenRealTimeClockLib/XenRealTimeClockLib.c  | 10 +++++-----
> >  OvmfPkg/XenPlatformPei/MemDetect.c                     |  2 +-
> >  OvmfPkg/XenTimerDxe/XenTimerDxe.c                      |  4 ++--
> >  3 files changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/OvmfPkg/Library/XenRealTimeClockLib/XenRealTimeClockLib.c
> b/OvmfPkg/Library/XenRealTimeClockLib/XenRealTimeClockLib.c
> > index e113bc89bd75..72e0aaa8798c 100644
> > --- a/OvmfPkg/Library/XenRealTimeClockLib/XenRealTimeClockLib.c
> > +++ b/OvmfPkg/Library/XenRealTimeClockLib/XenRealTimeClockLib.c
> > @@ -53,9 +53,9 @@ EpochToEfiTime (
> >    m  = (((da * 5) + 308) / 153) - 2;
> >    d  = da - (((m + 4) * 153) / 5) + 122;
> >
> > -  Time->Year  = y - 4800 + ((m + 2) / 12);
> > +  Time->Year  = (UINT16)(y - 4800 + ((m + 2) / 12));
> >    Time->Month = ((m + 2) % 12) + 1;
> > -  Time->Day   = d + 1;
> > +  Time->Day   = (UINT8)(d + 1);
> >
> >    ss = EpochSeconds % 60;
> >    a  = (EpochSeconds - ss) / 60;
> > @@ -63,9 +63,9 @@ EpochToEfiTime (
> >    b = (a - mm) / 60;
> >    hh = b % 24;
> >
> > -  Time->Hour        = hh;
> > -  Time->Minute      = mm;
> > -  Time->Second      = ss;
> > +  Time->Hour        = (UINT8)hh;
> > +  Time->Minute      = (UINT8)mm;
> > +  Time->Second      = (UINT8)ss;
> >    Time->Nanosecond  = 0;
> >
> >  }
> 
> I see this matches EmbeddedPkg::TimeBaseLib.c, but shouldn't both
> implementations be safer using MdePkg::SafeIntLib.h?

I agree.  Do you want to enter a BZ for this task with pointers to
the source files that should update their math ops to use SafeIntLib?

> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#83657): https://edk2.groups.io/g/devel/message/83657
Mute This Topic: https://groups.io/mt/86909518/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