Oh sorry I did not see this email and the previous before sending my new patches.
About git, generally git am wants to be applied in order, but I think there may be a fuzz option to git too, never really investigated as I usually apply all patches to a branch (or pull that branch directly from PR branches) and then git cherry-pick if I want a specific patch on master.
On Sat, 2019-04-27 at 09:29 +0200, Niels Möller wrote:
Simo Sorce simo@redhat.com writes:
Ok attached find new patches, they address all concerns except for adding the CET_SECTION macro automagically to all asm files.
Ah, one more thing:
+define(<GNU_CET_SECTION>, +<ifelse(CET_PROTECTION,yes, +<.pushsection .note.gnu.property,"a"
How portable is .pushsection? If we ensure that notes are last, plain .section should be enough, I think.
No it needs to be .pushsection, when I was using just .section the alignment of the property was incorrect (16 instead of 8) and glibc gurus told me to use .pushsection to properly deal with that. If you have/want CET you also have a modern enough GCC and Assembler that support -fcf-protection and .pushsection so I do not think it is a problem, if you are not using NGU As, you won't be using --enable-cet- protection either
--- a/x86_64/sha3-permute.asm +++ b/x86_64/sha3-permute.asm @@ -107,6 +107,7 @@ define(<ROTL64>, <
C sha3_permute(struct sha3_state *ctx) .text +GNU_CET_SECTION() ALIGN(16) PROLOGUE(nettle_sha3_permute) W64_ENTRY(1, 16)
This placement between .text and the prologue depends on .pushsection / .popsection. I think it should be moved last, just like in the other files, either explicitly or by means of a divert in some of the included m4 files.
Yes I had already caught this mistake, it is fixed in the patch series I sent a few minutes ago.