Hi On Tue, Oct 2, 2018 at 2:55 PM Laszlo Ersek wrote: > > Hi Marc-André, > > On 10/02/18 10:36, marcandre.lureau@redhat.com wrote: > > From: Marc-André Lureau > > > > This is for conformance with the TCG "Platform Reset Attack Mitigation > > Specification". Because clearing the CPU caches at boot doesn't impact > > performance significantly, do it unconditionally, for simplicity's > > sake. > > > > Flush the cache on all logical processors, thanks to > > EFI_PEI_MP_SERVICES_PPI and CacheMaintenanceLib. > > > > Cc: Anthony Perard > > Cc: Ard Biesheuvel > > Cc: Jordan Justen > > Cc: Julien Grall > > Cc: Kinney Michael D > > Cc: Laszlo Ersek > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Marc-André Lureau > > --- > > > > v2: > > - use CacheMaintenanceLib, instead of WBINVD usage > > - rename OnMpServicesAvailable->ClearCacheOnMpServicesAvailable > > - commit message & comments update > > > > OvmfPkg/PlatformPei/PlatformPei.inf | 2 + > > OvmfPkg/PlatformPei/Platform.h | 5 + > > OvmfPkg/PlatformPei/ClearCache.c | 113 ++++++++++++++++++++ > > OvmfPkg/PlatformPei/Platform.c | 1 + > > 4 files changed, 121 insertions(+) > > Please fix your git settings for your local edk2 clone. Your patch > contains context lines with LF (not CRLF) line endings, and that's not > correct for edk2. Shouldn't it be catched by: python BaseTools/Scripts/PatchCheck.py -1 ? > > I decoded your base64-encoded patch email manually, hence my statement > about the line endings. Here's a snippet from > "OvmfPkg/PlatformPei/PlatformPei.inf": > > 00000d90 64 69 66 66 20 2d 2d 67 69 74 20 61 2f 4f 76 6d |diff --git a/Ovm| > 00000da0 66 50 6b 67 2f 50 6c 61 74 66 6f 72 6d 50 65 69 |fPkg/PlatformPei| > 00000db0 2f 50 6c 61 74 66 6f 72 6d 50 65 69 2e 69 6e 66 |/PlatformPei.inf| > 00000dc0 20 62 2f 4f 76 6d 66 50 6b 67 2f 50 6c 61 74 66 | b/OvmfPkg/Platf| > 00000dd0 6f 72 6d 50 65 69 2f 50 6c 61 74 66 6f 72 6d 50 |ormPei/PlatformP| > 00000de0 65 69 2e 69 6e 66 0a 69 6e 64 65 78 20 39 63 35 |ei.inf.index 9c5| > 00000df0 61 64 39 39 36 31 63 34 61 2e 2e 35 63 38 64 64 |ad9961c4a..5c8dd| > 00000e00 30 66 65 36 64 37 32 20 31 30 30 36 34 34 0a 2d |0fe6d72 100644.-| > 00000e10 2d 2d 20 61 2f 4f 76 6d 66 50 6b 67 2f 50 6c 61 |-- a/OvmfPkg/Pla| > 00000e20 74 66 6f 72 6d 50 65 69 2f 50 6c 61 74 66 6f 72 |tformPei/Platfor| > 00000e30 6d 50 65 69 2e 69 6e 66 0a 2b 2b 2b 20 62 2f 4f |mPei.inf.+++ b/O| > 00000e40 76 6d 66 50 6b 67 2f 50 6c 61 74 66 6f 72 6d 50 |vmfPkg/PlatformP| > 00000e50 65 69 2f 50 6c 61 74 66 6f 72 6d 50 65 69 2e 69 |ei/PlatformPei.i| > 00000e60 6e 66 0a 40 40 20 2d 33 30 2c 36 20 2b 33 30 2c |nf.@@ -30,6 +30,| > 00000e70 37 20 40 40 0a 20 0a 20 5b 53 6f 75 72 63 65 73 |7 @@. . [Sources| > 00000e80 5d 0a 20 20 20 41 6d 64 53 65 76 2e 63 0a 2b 20 |]. AmdSev.c.+ | > 00000e90 20 43 6c 65 61 72 43 61 63 68 65 2e 63 0a 20 20 | ClearCache.c. | > 00000ea0 20 43 6d 6f 73 2e 63 0a 20 20 20 43 6d 6f 73 2e | Cmos.c. Cmos.| > 00000eb0 68 0a 20 20 20 46 65 61 74 75 72 65 43 6f 6e 74 |h. FeatureCont| > 00000ec0 72 6f 6c 2e 63 0a 40 40 20 2d 35 34 2c 36 20 2b |rol.c.@@ -54,6 +| > 00000ed0 35 35 2c 37 20 40 40 0a 20 0a 20 5b 4c 69 62 72 |55,7 @@. . [Libr| > 00000ee0 61 72 79 43 6c 61 73 73 65 73 5d 0a 20 20 20 42 |aryClasses]. B| > 00000ef0 61 73 65 4c 69 62 0a 2b 20 20 43 61 63 68 65 4d |aseLib.+ CacheM| > 00000f00 61 69 6e 74 65 6e 61 6e 63 65 4c 69 62 0a 20 20 |aintenanceLib. | > > Due to this issue, git-am fails to apply the patch. > > I mentioned this earlier (including a request to push your patches being > submitted to a personal repo/branch as well): > > http://mid.mail-archive.com/f5c15a1e-25c2-c2e4-e6db-374107e3b488@redhat.com > > The wiki article at > > https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers > > explains the git settings in order for git not to hide the CRLFs in the > working tree. In particular, the git concept for (a) representing the > source code internally with LFs, and (b) converting to/from CRLF on > checkout/commit, is *not* to be used. > > Is this edk2 peculiarity broken, considering git standards and other > open source repositories? It sure is. > > Can we change it? No, we can't. Hmm, this is weird, the original patch has crlf (see attach file). send-email or the mail server somehow stripped it? I use your recommend git settings, I don't know what I am missing here. > > Thanks, > Laszlo > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel -- Marc-André Lureau