[PATCH][x86][1/3]: Add -mzero-caller-saved-regs=[skip|used-gpr|all-gpr|used|all]
Qing Zhao
QING.ZHAO@ORACLE.COM
Fri Apr 17 17:31:45 GMT 2020
Hi,
This is a PING for an old patch proposed by H. J. Lu on Oct, 2018:
https://gcc.gnu.org/legacy-ml/gcc-patches/2018-10/msg02079.html
This is the first patch of the total 3 patches set, which provides the following new feature:
-mzero-caller-saved-regs=[skip|used-gpr|all-gpr|used|all] command-line
option and zero_caller_saved_regs("skip|used|all") function attribue:
1. -mzero-caller-saved-regs=skip and zero_caller_saved_regs("skip")
Don't zero caller-saved registers upon function return.
2. -mzero-caller-saved-regs=used-gpr and zero_caller_saved_regs("used-gpr")
Zero used caller-saved integer registers upon function return.
3. -mzero-caller-saved-regs=all-gpr and zero_caller_saved_regs("all-gpr”)
Zero all caller-saved integer registers upon function return.
4. -mzero-caller-saved-regs=used and zero_caller_saved_regs("used")
Zero used caller-saved integer and vector registers upon function return.
5. -mzero-caller-saved-regs=all and zero_caller_saved_regs("all")
Zero all caller-saved integer and vector registers upon function return.
This feature is needed by Linux kernel security improvement. Please refer to Kees Cook’s talk on Linux Plumber Conference 2019:
https://outflux.net/slides/2019/lpc/gcc-and-clang.pdf <https://outflux.net/slides/2019/lpc/gcc-and-clang.pdf>
Tested on x86-64 with bootstrapping GCC trunk, regression tests exposed several new regressions, these new regressions are
fixed by 2 following patches I will send in next two emails.
Any comment?
thanks.
Qing
More information about the Gcc-patches
mailing list