From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web10.10552.1584094249258811703 for ; Fri, 13 Mar 2020 03:10:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=eYSTUD3a; spf=pass (domain: nuviainc.com, ip: 209.85.221.68, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f68.google.com with SMTP id d5so10964917wrc.2 for ; Fri, 13 Mar 2020 03:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=tJg3YCNw0XZV71O6x8nHHG7AhkX50/oQJs2j8unmzis=; b=eYSTUD3a0HCfEwoSy24gkNdI523g3EZhVbFL8IbJAW+p+oX4B6dhZMKStAaTyPANFE uMfQFOQV6j4K3PoLb8rKX6VONLo+iYmFlaUPiVp+NsfKNVznSMId6Y+EAq0p4tYO+Oso 0lQSAtWuldMP8/WpKlEfJVU8+Jhmt+UeQE1svoZs6gfcdp9wVGugSanttmCc9IpmdcCr Uj1wLOpK7AHyjc9tPJycxxuxEgV9qn9x0LN+4KfaRejdhYdKNWRNQUutaEa7Xf5stUGA wbtKpIgf+E1/ys5VdDxKRokB6V2GvBIkXnlPjb9lh2Wi+SHv1OVaA/e7W4ytE9Y+UPuA lDtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=tJg3YCNw0XZV71O6x8nHHG7AhkX50/oQJs2j8unmzis=; b=Ao2p5B3SlyaXvOza56QkWWFkemAOotFDALyPApbfRq7DCvhszouEptwtrWwZb546hv v+G0LRmCJWt+YhPdwacnvGl8of8emuMDUBERaYnCcm2vItCNEDE4vCtcIyTw7mV0Y3M+ 2kJr65oHIhiCbAVsSSAzSgK7Oiwu0U2GswUFpFl9qG1xg4ymdz2vjHmDRYuU2Ce5+cTI UoNrlawLt0a2IwyA3ZVr/Pyxt7k8YRBHX3xXBVKVMTUcs87gffS9/njT9D6USmJEjsE0 t8UqPzBWUAqnCXP1bn69fXBkq5K2cnb8l+TnKHVM1nO9TFJMrMB9ONestaSsuJwhXfQs jgkA== X-Gm-Message-State: ANhLgQ1n/tuXt6RSAPi3xlHzTiKMHWK8Ydah0wKtttfDpoydIUguq1Nj aPQArzWtjrTzfAdpM0LM6a7MKA== X-Google-Smtp-Source: ADFU+vtVWzpli7S6twSTh37OrGHaH5p55wLGwo0uxpoEmYzKmk3xFq9r6q8h83W08TpIg5Wa8vxIyw== X-Received: by 2002:a5d:640e:: with SMTP id z14mr18017854wru.204.1584094247686; Fri, 13 Mar 2020 03:10:47 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id o26sm15444809wmc.33.2020.03.13.03.10.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 03:10:47 -0700 (PDT) Date: Fri, 13 Mar 2020 10:10:45 +0000 From: "Leif Lindholm" To: "Chang, Abner (HPS SW/FW Technologist)" Cc: "devel@edk2.groups.io" , "lersek@redhat.com" , "Schaefer, Daniel (DualStudy)" , "Chen, Gilbert" , "afish@apple.com" , "michael.d.kinney@intel.com" , "pete@akeo.ie" , Ard Biesheuvel Subject: Re: [edk2-devel] [PATCH v2 3/3] MdeModulePkg: Use CopyMem instead of GUID assignment Message-ID: <20200313101045.GN23627@bivouac.eciton.net> References: <20200302103238.25726-1-daniel.schaefer@hpe.com> <20200302103238.25726-4-daniel.schaefer@hpe.com> <20200312105528.GC23627@bivouac.eciton.net> <539c8673-786c-9c58-98cc-ab470b345740@hpe.com> <20200312140304.GF23627@bivouac.eciton.net> <20200312144452.GI23627@bivouac.eciton.net> <20200312211953.GL23627@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Fri, Mar 13, 2020 at 04:08:12 +0000, Chang, Abner (HPS SW/FW Technologist) wrote: > > -----Original Message----- > > From: Leif Lindholm [mailto:leif@nuviainc.com] > > Sent: Friday, March 13, 2020 5:20 AM > > To: devel@edk2.groups.io; lersek@redhat.com > > Cc: Chang, Abner (HPS SW/FW Technologist) ; > > Schaefer, Daniel (DualStudy) ; Chen, Gilbert > > ; afish@apple.com; michael.d.kinney@intel.com; > > pete@akeo.ie; Ard Biesheuvel > > Subject: Re: [edk2-devel] [PATCH v2 3/3] MdeModulePkg: Use CopyMem > > instead of GUID assignment > > The current NULL instance of CompilerIntrinsicsLib is applied on > every modules, this means it's not flexible for overwriting memcpy > (for example) with the faster algorithm (such as SSEx instructions) > for the specific module in the same DSC, right? That says we can't > assign a special version of memcpy to just one particular module. All true. But ... are you planning to contribute lots of code that performs large (certainly larger than GUIDs in order for effects to be noticeable) struct assignments on critical paths? Even if that is the case, as commented on the other fork of this thread: if we add the -O3 jiggle, GCC will automatically insert what it considers to be the optimal implementation for the specified target when encountering the naïve implementation. > > On Thu, Mar 12, 2020 at 20:42:52 +0100, Laszlo Ersek wrote: > > > On 03/12/20 15:44, Leif Lindholm wrote: > > > > And what would you propose we do the next time the RISC-V toolchain > > > > generates a memcpy call based on some other completely valid change > > > > to core code? > > > > > > We could choose to enable the intrinsics library for RISC-V at that point. > > and I would like to see the flexibility of overwriting memory > library functions for particular modules. There is no special > algorithm of memory manipulation so far in RISC-V spec, however, the > working group of Vector extension does propose the new instruction > sets. Use of CompilerIntrinsicsLib has no effect on explicit CopyMem & co operations, only on memcpy/memset generated by the compiler. Which will generate build failures if not handled. / Leif