[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-05 Thread Kristof Beyls via llvm-branch-commits
https://github.com/kbeyls edited https://github.com/llvm/llvm-project/pull/94394 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-05 Thread Kristof Beyls via llvm-branch-commits
https://github.com/kbeyls requested changes to this pull request. Do I understand correctly that "remove big-endian support" results in this code not running correctly on big-endian machines? I don't recall the LLVM project claiming that it cannot run on big-endian machines. If I understand thi

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-05 Thread Kristof Beyls via llvm-branch-commits
@@ -58,21 +38,15 @@ v2 = ROTL(v2, 32); \ } while (0) -/* kbeyls wrote: It might be worthwhile to keep (an edited version of) this comment? It wasn't immediately obvious to me what the value is of

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-05 Thread Kristof Beyls via llvm-branch-commits
@@ -58,21 +38,15 @@ v2 = ROTL(v2, 32); \ } while (0) -/* -Computes a SipHash value -*in: pointer to input data (read-only) -inlen: input data length in bytes (any size_t value) -*k: pointer to the k

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-05 Thread Kristof Beyls via llvm-branch-commits
@@ -58,21 +38,15 @@ v2 = ROTL(v2, 32); \ } while (0) -/* -Computes a SipHash value -*in: pointer to input data (read-only) -inlen: input data length in bytes (any size_t value) -*k: pointer to the k

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-05 Thread Kristof Beyls via llvm-branch-commits
@@ -1,25 +1,19 @@ -/* - SipHash reference C implementation - - Copyright (c) 2012-2022 Jean-Philippe Aumasson - - Copyright (c) 2012-2014 Daniel J. Bernstein - - To the extent possible under law, the author(s) have dedicated all copyright - and related and neighborin

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-05 Thread Kristof Beyls via llvm-branch-commits
kbeyls wrote: > I'll also mention that I left the original variable naming but did re-format > the file, whitespace being more friendly to diffs, and this being nice and > tidily contained. If you or others have strong opinions, I'm happy to > recapitalize the names. I don't have a strong opi

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-08 Thread Kristof Beyls via llvm-branch-commits
kbeyls wrote: > So, regarding big-endian things. Original siphash is always "little-endian" > regardless of the host platform. On big endian hosts it essentially does byte > swap in the end. We do not have it here, so we will end with different hashes > on platforms with different endianness.

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-12 Thread Kristof Beyls via llvm-branch-commits
kbeyls wrote: I just checked if there indeed are big-endian bots which should pick up if a different hash gets produced on a big-endian system. I guess this bot (the only bot?) would pick it up: https://lab.llvm.org/buildbot/#/builders/231 I now also realize that there are no tests with this c

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-12 Thread Kristof Beyls via llvm-branch-commits
https://github.com/kbeyls approved this pull request. https://github.com/llvm/llvm-project/pull/94394 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-13 Thread Kristof Beyls via llvm-branch-commits
kbeyls wrote: > Yes, this doesn't have tests by itself because there's no exposed interface. > It's certainly trivial to add one (which would allow using the reference test > vectors). > > I don't have strong arguments either way, but I figured the conservative > option is to force hypothetic

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-14 Thread Kristof Beyls via llvm-branch-commits
kbeyls wrote: > [37c84b9](https://github.com/llvm/llvm-project/pull/94394/commits/37c84b9dce70f40db8a7c27b7de8232c4d10f78f) > shows what I had in mind, let me know what you all think. I added: > > ``` > void getSipHash_2_4_64(ArrayRef In, const uint8_t (&K)[16], >uint8_t

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-14 Thread Kristof Beyls via llvm-branch-commits
https://github.com/kbeyls approved this pull request. https://github.com/llvm/llvm-project/pull/94394 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [AArch64] Only create called thunks when hardening against SLS (PR #97472)

2024-07-03 Thread Kristof Beyls via llvm-branch-commits
@@ -36,38 +32,43 @@ using namespace llvm; #define AARCH64_SLS_HARDENING_NAME "AArch64 sls hardening pass" +static const char SLSBLRNamePrefix[] = "__llvm_slsblr_thunk_"; + namespace { -class AArch64SLSHardening : public MachineFunctionPass { -public: - const TargetInstrIn

[llvm-branch-commits] [llvm] [AArch64] Only create called thunks when hardening against SLS (PR #97472)

2024-07-03 Thread Kristof Beyls via llvm-branch-commits
@@ -46,13 +40,5 @@ body: | ... -name:__llvm_slsblr_thunk_x8 -tracksRegLiveness: true -body: | - bb.0.entry: -liveins: $x8 -BR $x8 kbeyls wrote: I think it is important to check that the body of the thunk in

[llvm-branch-commits] [llvm] [AArch64] Only create called thunks when hardening against SLS (PR #97472)

2024-07-03 Thread Kristof Beyls via llvm-branch-commits
@@ -36,38 +32,43 @@ using namespace llvm; #define AARCH64_SLS_HARDENING_NAME "AArch64 sls hardening pass" +static const char SLSBLRNamePrefix[] = "__llvm_slsblr_thunk_"; + namespace { -class AArch64SLSHardening : public MachineFunctionPass { -public: - const TargetInstrIn

[llvm-branch-commits] [llvm] [AArch64][PAC] Support BLRA* instructions in SLS Hardening pass (PR #97605)

2024-07-05 Thread Kristof Beyls via llvm-branch-commits
https://github.com/kbeyls commented: Thank you, this mostly looks good to me. I've only added very minor comments; feel free to disagree with them. https://github.com/llvm/llvm-project/pull/97605 ___ llvm-branch-commits mailing list llvm-branch-commits

[llvm-branch-commits] [llvm] [AArch64][PAC] Support BLRA* instructions in SLS Hardening pass (PR #97605)

2024-07-05 Thread Kristof Beyls via llvm-branch-commits
https://github.com/kbeyls edited https://github.com/llvm/llvm-project/pull/97605 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [AArch64][PAC] Support BLRA* instructions in SLS Hardening pass (PR #97605)

2024-07-05 Thread Kristof Beyls via llvm-branch-commits
@@ -68,6 +156,57 @@ struct SLSHardeningInserter : ThunkInserter { } // end anonymous namespace +const ThunkKind ThunkKind::BR = {ThunkBR, "", false, false, AArch64::BR}; +const ThunkKind ThunkKind::BRAA = {ThunkBRAA, "aa_", true, true, AArch64::BRAA}; +const ThunkKind Thunk

[llvm-branch-commits] [llvm] [AArch64][PAC] Support BLRA* instructions in SLS Hardening pass (PR #97605)

2024-07-05 Thread Kristof Beyls via llvm-branch-commits
@@ -0,0 +1,210 @@ +# RUN: llc -verify-machineinstrs -mtriple=aarch64-none-linux-gnu \ +# RUN: -start-before aarch64-sls-hardening -o - %s \ +# RUN: -asm-verbose=0 \ +# RUN: | FileCheck %s \ +# RUN: --implicit-check-not=__llvm_slsblr_thunk_aa_x5_x8 \ +# RUN: --impli

[llvm-branch-commits] [llvm] [AArch64][PAC] Support BLRA* instructions in SLS Hardening pass (PR #97605)

2024-07-05 Thread Kristof Beyls via llvm-branch-commits
@@ -221,13 +339,19 @@ void SLSHardeningInserter::populateThunk(MachineFunction &MF) { // __llvm_slsblr_thunk_xN: // BR xN // barrierInsts kbeyls wrote: I think it would be useful to update this comment to make it clear what the different kin

[llvm-branch-commits] [llvm] [AArch64][PAC] Support BLRA* instructions in SLS Hardening pass (PR #97605)

2024-07-05 Thread Kristof Beyls via llvm-branch-commits
@@ -221,13 +339,19 @@ void SLSHardeningInserter::populateThunk(MachineFunction &MF) { // __llvm_slsblr_thunk_xN: // BR xN // barrierInsts kbeyls wrote: As part of reviewing this, I was wondering why the actual thunk content is ``` // __llv

[llvm-branch-commits] [llvm] [AArch64][PAC] Support BLRA* instructions in SLS Hardening pass (PR #97605)

2024-07-05 Thread Kristof Beyls via llvm-branch-commits
@@ -221,13 +339,19 @@ void SLSHardeningInserter::populateThunk(MachineFunction &MF) { // __llvm_slsblr_thunk_xN: // BR xN // barrierInsts kbeyls wrote: Maybe something like ``` // __llvm_slsblr_thunk_{aa|ab|aaz|abz|}_xN_{xM}: // BR

[llvm-branch-commits] [llvm] [AArch64][PAC] Support BLRA* instructions in SLS Hardening pass (PR #97605)

2024-07-05 Thread Kristof Beyls via llvm-branch-commits
@@ -68,6 +156,57 @@ struct SLSHardeningInserter : ThunkInserter { } // end anonymous namespace +const ThunkKind ThunkKind::BR = {ThunkBR, "", false, false, AArch64::BR}; +const ThunkKind ThunkKind::BRAA = {ThunkBRAA, "aa_", true, true, AArch64::BRAA}; +const ThunkKind Thunk

[llvm-branch-commits] [llvm] [AArch64][PAC] Support BLRA* instructions in SLS Hardening pass (PR #97605)

2024-07-05 Thread Kristof Beyls via llvm-branch-commits
@@ -274,40 +398,31 @@ void SLSHardeningInserter::convertBLRToBL( MachineInstr &BLR = *MBBI; assert(isBLR(BLR)); - unsigned BLOpcode; - Register Reg; - bool RegIsKilled; - switch (BLR.getOpcode()) { - case AArch64::BLR: - case AArch64::BLRNoIP: -BLOpcode = AArch64

[llvm-branch-commits] [llvm] [AArch64][PAC] Support BLRA* instructions in SLS Hardening pass (PR #97605)

2024-07-05 Thread Kristof Beyls via llvm-branch-commits
@@ -139,64 +262,59 @@ bool SLSHardeningInserter::hardenReturnsAndBRs(MachineModuleInfo &MMI, return Modified; } -static const unsigned NumPermittedRegs = 29; -static const struct ThunkNameAndReg { - const char* Name; - Register Reg; -} SLSBLRThunks[NumPermittedRegs] = { -

[llvm-branch-commits] [llvm] [AArch64][PAC] Support BLRA* instructions in SLS Hardening pass (PR #97605)

2024-07-05 Thread Kristof Beyls via llvm-branch-commits
@@ -68,6 +156,57 @@ struct SLSHardeningInserter : ThunkInserter { } // end anonymous namespace +const ThunkKind ThunkKind::BR = {ThunkBR, "", false, false, AArch64::BR}; +const ThunkKind ThunkKind::BRAA = {ThunkBRAA, "aa_", true, true, AArch64::BRAA}; +const ThunkKind Thunk

[llvm-branch-commits] [clang] c816be2 - Add release note for aarch64-none-elf driver change.

2022-01-26 Thread Kristof Beyls via llvm-branch-commits
Author: Kristof Beyls Date: 2022-01-26T09:13:22+01:00 New Revision: c816be2026af3641f9b648482c48dd1f18a73dd1 URL: https://github.com/llvm/llvm-project/commit/c816be2026af3641f9b648482c48dd1f18a73dd1 DIFF: https://github.com/llvm/llvm-project/commit/c816be2026af3641f9b648482c48dd1f18a73dd1.diff

[llvm-branch-commits] [llvm] 195f442 - [ARM] Implement harden-sls-retbr for ARM mode

2020-12-19 Thread Kristof Beyls via llvm-branch-commits
Author: Kristof Beyls Date: 2020-12-19T11:42:39Z New Revision: 195f44278c4361a4a32377a98a1e3a15203d3647 URL: https://github.com/llvm/llvm-project/commit/195f44278c4361a4a32377a98a1e3a15203d3647 DIFF: https://github.com/llvm/llvm-project/commit/195f44278c4361a4a32377a98a1e3a15203d3647.diff LOG:

[llvm-branch-commits] [llvm] 320fd33 - [ARM] Implement harden-sls-retbr for Thumb mode

2020-12-19 Thread Kristof Beyls via llvm-branch-commits
Author: Kristof Beyls Date: 2020-12-19T12:32:47Z New Revision: 320fd3314e378ae6242a2dde97250a8a94d68e27 URL: https://github.com/llvm/llvm-project/commit/320fd3314e378ae6242a2dde97250a8a94d68e27 DIFF: https://github.com/llvm/llvm-project/commit/320fd3314e378ae6242a2dde97250a8a94d68e27.diff LOG:

[llvm-branch-commits] [llvm] a4c1f51 - [ARM] Harden indirect calls against SLS

2020-12-19 Thread Kristof Beyls via llvm-branch-commits
Author: Kristof Beyls Date: 2020-12-19T12:33:42Z New Revision: a4c1f5160e6d1de9a9959ecbf329c2acf4f3ed31 URL: https://github.com/llvm/llvm-project/commit/a4c1f5160e6d1de9a9959ecbf329c2acf4f3ed31 DIFF: https://github.com/llvm/llvm-project/commit/a4c1f5160e6d1de9a9959ecbf329c2acf4f3ed31.diff LOG:

[llvm-branch-commits] [llvm] df8ed39 - [ARM] harden-sls-blr: avoid r12 and lr in indirect calls.

2020-12-19 Thread Kristof Beyls via llvm-branch-commits
Author: Kristof Beyls Date: 2020-12-19T12:39:59Z New Revision: df8ed3928377edc6e9241a56680b694ffa9f4d6d URL: https://github.com/llvm/llvm-project/commit/df8ed3928377edc6e9241a56680b694ffa9f4d6d DIFF: https://github.com/llvm/llvm-project/commit/df8ed3928377edc6e9241a56680b694ffa9f4d6d.diff LOG:

[llvm-branch-commits] [clang] 9c895ae - [ARM] Add clang command line support for -mharden-sls=

2020-12-19 Thread Kristof Beyls via llvm-branch-commits
Author: Kristof Beyls Date: 2020-12-19T12:49:26Z New Revision: 9c895aea118a2f50ca8413372363c3ff6ecc21bf URL: https://github.com/llvm/llvm-project/commit/9c895aea118a2f50ca8413372363c3ff6ecc21bf DIFF: https://github.com/llvm/llvm-project/commit/9c895aea118a2f50ca8413372363c3ff6ecc21bf.diff LOG:

[llvm-branch-commits] [llvm] 424fdbc - collect_and_build_with_pgo.py: adapt to monorepo

2020-12-01 Thread Kristof Beyls via llvm-branch-commits
Author: Kristof Beyls Date: 2020-12-01T09:16:12+01:00 New Revision: 424fdbc3dedadf882fda107aa5638b39e7036c4d URL: https://github.com/llvm/llvm-project/commit/424fdbc3dedadf882fda107aa5638b39e7036c4d DIFF: https://github.com/llvm/llvm-project/commit/424fdbc3dedadf882fda107aa5638b39e7036c4d.diff

[llvm-branch-commits] [llvm] d98e4c0 - Add a few more release notes for ARM and AArch64.

2020-08-31 Thread Kristof Beyls via llvm-branch-commits
Author: Kristof Beyls Date: 2020-08-31T14:10:54+02:00 New Revision: d98e4c0d9a3585e2302c717beea9b9d03df9663a URL: https://github.com/llvm/llvm-project/commit/d98e4c0d9a3585e2302c717beea9b9d03df9663a DIFF: https://github.com/llvm/llvm-project/commit/d98e4c0d9a3585e2302c717beea9b9d03df9663a.diff