mbox series

[0/5] RISC-V: Enable stack-clash protection

Message ID cover.1721681845.git.rzinsly@ventanamicro.com
Headers show
Series RISC-V: Enable stack-clash protection | expand

Message

Raphael Moreira Zinsly July 24, 2024, 6 p.m. UTC
Hi All,

This patch series implements stack-clash protection for RISC-V using 4K
probes as default. The non-vector implementation is based on AArch64’s
as the generated stack frame is similar.
The tests are also adapted from AArch64.


Thanks,
Raphael

Raphael Moreira Zinsly (5):
  RISC-V: Small stack tie changes
  RISC-V: Move riscv_v_adjust_scalable_frame
  RISC-V: Stack-clash protection implemention
  RISC-V: Add support to vector stack-clash protection
  RISC-V: Enable stack clash in alloca

 gcc/config/riscv/riscv.cc                     | 396 ++++++++++++++----
 gcc/config/riscv/riscv.h                      |  27 ++
 gcc/config/riscv/riscv.md                     |   2 +-
 gcc/testsuite/gcc.dg/params/blocksort-part.c  |   2 +-
 gcc/testsuite/gcc.dg/pr82788.c                |   2 +-
 gcc/testsuite/gcc.dg/stack-check-6.c          |   2 +-
 gcc/testsuite/gcc.dg/stack-check-6a.c         |   2 +-
 .../gcc.target/riscv/stack-check-12.c         |  23 +
 .../gcc.target/riscv/stack-check-13.c         |  26 ++
 .../gcc.target/riscv/stack-check-14.c         |  24 ++
 .../gcc.target/riscv/stack-check-15.c         |  21 +
 .../gcc.target/riscv/stack-check-alloca-1.c   |  15 +
 .../gcc.target/riscv/stack-check-alloca-10.c  |  13 +
 .../gcc.target/riscv/stack-check-alloca-2.c   |  11 +
 .../gcc.target/riscv/stack-check-alloca-3.c   |  11 +
 .../gcc.target/riscv/stack-check-alloca-4.c   |  12 +
 .../gcc.target/riscv/stack-check-alloca-5.c   |  12 +
 .../gcc.target/riscv/stack-check-alloca-6.c   |  12 +
 .../gcc.target/riscv/stack-check-alloca-7.c   |  12 +
 .../gcc.target/riscv/stack-check-alloca-8.c   |  14 +
 .../gcc.target/riscv/stack-check-alloca-9.c   |  13 +
 .../gcc.target/riscv/stack-check-alloca.h     |  15 +
 .../gcc.target/riscv/stack-check-cfa-1.c      |  12 +
 .../gcc.target/riscv/stack-check-cfa-2.c      |  13 +
 .../gcc.target/riscv/stack-check-cfa-3.c      |  13 +
 .../gcc.target/riscv/stack-check-prologue-1.c |   9 +
 .../riscv/stack-check-prologue-10.c           |  11 +
 .../riscv/stack-check-prologue-11.c           |  11 +
 .../riscv/stack-check-prologue-12.c           |  15 +
 .../riscv/stack-check-prologue-13.c           |  20 +
 .../riscv/stack-check-prologue-14.c           |  24 ++
 .../riscv/stack-check-prologue-15.c           |  23 +
 .../riscv/stack-check-prologue-16.c           |  30 ++
 .../gcc.target/riscv/stack-check-prologue-2.c |  10 +
 .../gcc.target/riscv/stack-check-prologue-3.c |  11 +
 .../gcc.target/riscv/stack-check-prologue-4.c |  11 +
 .../gcc.target/riscv/stack-check-prologue-5.c |  11 +
 .../gcc.target/riscv/stack-check-prologue-6.c |  11 +
 .../gcc.target/riscv/stack-check-prologue-7.c |  11 +
 .../gcc.target/riscv/stack-check-prologue-8.c |  10 +
 .../gcc.target/riscv/stack-check-prologue-9.c |  11 +
 .../gcc.target/riscv/stack-check-prologue.h   |   5 +
 .../gcc.target/riscv/struct_vect_24.c         |  47 +++
 gcc/testsuite/lib/target-supports.exp         |   6 +-
 44 files changed, 912 insertions(+), 80 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-12.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-13.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-14.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-15.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-alloca-1.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-alloca-10.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-alloca-2.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-alloca-3.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-alloca-4.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-alloca-5.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-alloca-6.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-alloca-7.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-alloca-8.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-alloca-9.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-alloca.h
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-cfa-1.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-cfa-2.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-cfa-3.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-1.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-10.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-11.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-12.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-13.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-14.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-15.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-16.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-2.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-3.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-4.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-5.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-6.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-7.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-8.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue-9.c
 create mode 100644 gcc/testsuite/gcc.target/riscv/stack-check-prologue.h
 create mode 100644 gcc/testsuite/gcc.target/riscv/struct_vect_24.c