public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ryszard Knop <ryszard.knop@linux.intel.com>
To: Andrew Fish <afish@apple.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	edk2-devel@lists.01.org,  "Carsey,
	Jaben" <jaben.carsey@intel.com>,
	Mike Kinney <michael.d.kinney@intel.com>,
	Harry Hsiung <harry.l.hsiung@intel.com>,
	eric.jin@intel.com, pawel.orlowski@intel.com,
	 kamil.kacperski@intel.com
Subject: Re: [PATCH edk2-staging 10/20] IntelUndiPkg/XGigUndiDxe: drop StdLibC library class reference
Date: Wed, 06 Feb 2019 10:46:08 +0100	[thread overview]
Message-ID: <fb6395e4ce2f384a1df1a33f681cc145fe17ada0.camel@linux.intel.com> (raw)
In-Reply-To: <9050A2BF-DB7E-48DA-8C7E-490C1B2F1958@apple.com>

Andrew,

Unfortunately, not assigning something too large or using math
functions is not an option for us, as we share a significant amount of
code with Linux/FreeBSD drivers and maintainers of that code don't want
changes similar to the ones below (especially that, for all the other
drivers, intrinsics just work). Intrinsic lib for IA32 and others would
be very much preferred (and one that just works on any architecture, so
that we wouldn't have to add extra arch-specific LibraryClasses).

Thanks, Richard

On Wed, 2019-01-30 at 10:34 -0800, Andrew Fish wrote:
> > On Jan 30, 2019, at 9:26 AM, Ryszard Knop <
> > ryszard.knop@linux.intel.com> wrote:
> > 
> > That's actually not quite correct - we need this package to build
> > on
> > IA32. It's named rather unfortunately, since it's not the EDK2
> > StdLibC,
> > but rather a package in this repository - see IntelUndiPkg/LibC. It
> > contains the bare minimum of functionality required to fix missing
> > 64-
> > bit math/shifts on IA32 and missing memcpy/memset intrinsics. We
> > can't
> > prevent MSVC from yielding memcpy/memset either, so this was the
> > nasty
> > solution for build issues. You have included CompilerIntrinsicsLib
> > for
> > the same reason, too :)
> > 
> 
> Ryszard,
> 
> For IA32/X64 we avoid the compiler intrinsic libs via the coding
> standard. 
> 1) If you don't assign something too large at execution time with an
> = the compiler will not inline memcpy()/memset()
> 2) BaseLib.h has all the math functions that generate intrinsics that
> your code can call explicitly: 
> https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Library/BaseLib.h#L3533
> 
> UINT64 X=0x100000000;
> UINT64 Y=2;
> 
> So:
> Y = X*Y;
> should be:
> Y = MultU64x64 (X, Y);
> 
> When ARM got added much later and some versions of ARM did not even
> have a divide instruction we gave up on trying to add more functions
> into all the existing IA32 code, and add the intrinsic lib. 
> 
> If we are going to add an intrinsic lib for x86 then we should
> probably add it to the MdePkg and it needs to support MSVC and GCC
> (as far as I can tell clang should work with the GCC intrinsics). 
> 
> Thanks,
> 
> Andrew Fish
> 
> 
> > I'm not aware of any X64/IA32 equivalent of your
> > CompilerIntrinsicsLib,
> > but I'd be happy to be proven wrong here. I'm off for the rest of
> > the
> > week - I'll continue with reviews and merging early next week.
> > 
> > Thanks, Richard.
> > 
> > On Wed, 2018-11-14 at 18:33 -0800, ard.biesheuvela wrote:
> > > StdLibc should not be used in drivers (it has dependencies on
> > > Shell
> > > protocols), but in fact, we don't appear to rely on it in the
> > > first
> > > place, so just drop the reference.
> > > 
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
> > > ---
> > > IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf | 1 -
> > > 1 file changed, 1 deletion(-)
> > > 
> > > diff --git a/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf
> > > b/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf
> > > index beee8aa8134e..b5747565fbea 100644
> > > --- a/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf
> > > +++ b/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf
> > > @@ -132,7 +132,6 @@ GCC:*_*_*_CC_FLAGS = -DEFI32
> > >   PrintLib
> > >   UefiLib
> > >   HiiLib
> > > -  StdLibC
> > > 
> > > [LibraryClasses.X64]
> > > 
> > 
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> 
> 



  reply	other threads:[~2019-02-06  9:46 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-15  2:33 [PATCH edk2-staging 00/20] IntelUndiPkg/XGigUndiDxe: fix GCC / ARM build issues Ard Biesheuvel
2018-11-15  2:33 ` [PATCH edk2-staging 01/20] IntelUndiPkg/XGigUndiDxe: create GCC alternatives for MSFT build options Ard Biesheuvel
2019-01-30 15:41   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 02/20] IntelUndiPkg/XGigUndiDxe: move MSFT warning overrides to INF file Ard Biesheuvel
2019-01-30 15:44   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 03/20] IntelUndiPkg/XGigUndiDxe: consistently use forward slashes as path separators Ard Biesheuvel
2019-01-30 15:49   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 04/20] IntelUndiPkg/XGigUndiDxe: move BRAND_STRUCT declaration after type definition Ard Biesheuvel
2019-01-30 15:49   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 05/20] IntelUndiPkg/XGigUndiDxe: add missing VOID** cast Ard Biesheuvel
2019-01-30 15:51   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 06/20] IntelUndiPkg/XGigUndiDxe: add missing UINT8* cast Ard Biesheuvel
2019-01-30 15:51   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 07/20] IntelUndiPkg/XGigUndiDxe: drop definition of gImageHandle Ard Biesheuvel
2019-01-30 16:05   ` Ryszard Knop
2019-01-30 16:06     ` Ard Biesheuvel
2019-01-30 16:17       ` Ryszard Knop
2019-01-30 16:56     ` Andrew Fish
2018-11-15  2:33 ` [PATCH edk2-staging 08/20] IntelUndiPkg/XGigUndiDxe: add missing braces to GUID literals Ard Biesheuvel
2019-01-30 16:06   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 09/20] IntelUndiPkg/XGigUndiDxe: fix incorrect use of CPP token pasting Ard Biesheuvel
2019-01-30 16:06   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 10/20] IntelUndiPkg/XGigUndiDxe: drop StdLibC library class reference Ard Biesheuvel
2018-11-15 15:16   ` Carsey, Jaben
2019-01-30 17:26   ` Ryszard Knop
2019-01-30 18:34     ` Andrew Fish
2019-02-06  9:46       ` Ryszard Knop [this message]
2019-01-30 20:58     ` Kinney, Michael D
2019-02-06 10:14       ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 11/20] IntelUndiPkg/XGigUndiDxe: cast XgbeMemCopy () args to correct pointer type Ard Biesheuvel
2019-01-30 16:20   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 12/20] IntelUndiPkg/XGigUndiDxe: don't take address of cast expression Ard Biesheuvel
2019-01-30 16:20   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 13/20] IntelUndiPkg/XGigUndiDxe: drop locally defined ASSERT() macro Ard Biesheuvel
2018-11-15  2:33 ` [PATCH edk2-staging 14/20] IntelUndiPkg/XGigUndiDxe: redefine UNREFERENCED_nPARAMETER macros for GCC Ard Biesheuvel
2019-01-30 16:22   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 15/20] IntelUndiPkg/XGigUndiDxe: use intermediate UINTN casts for pointers Ard Biesheuvel
2019-01-30 16:26   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 16/20] IntelUndiPkg/XGigUndiDxe: add missing EFIAPI modifiers Ard Biesheuvel
2019-01-30 16:27   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 17/20] IntelUndiPkg/XGigUndiDxe: drop unused variables Ard Biesheuvel
2019-01-30 16:39   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 18/20] IntelUndiPkg/XGigUndiDxe: set MDEPKG_NDEBUG only for RELEASE builds Ard Biesheuvel
2019-01-30 17:15   ` Ryszard Knop
2018-11-15  2:33 ` [PATCH edk2-staging 19/20] IntelUndiPkg/XGigUndiDxe: drop separate debug macros for DBG_LVL Ard Biesheuvel
2018-11-15  2:33 ` [PATCH edk2-staging 20/20] IntelUndiPkg/XGigUndiDxe: avoid unused var warnings for ERROR_REPORTn() Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb6395e4ce2f384a1df1a33f681cc145fe17ada0.camel@linux.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox