mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-30 00:31:08 +00:00
dd5c483b25
The RTM vzeroupper mitigation has no way of replacing inline vzeroupper not before a return. This can be useful when hoisting a vzeroupper to save code size for example: ``` L(foo): cmpl %eax, %edx jz L(bar) tzcntl %eax, %eax addq %rdi, %rax VZEROUPPER_RETURN L(bar): xorl %eax, %eax VZEROUPPER_RETURN ``` Can become: ``` L(foo): COND_VZEROUPPER cmpl %eax, %edx jz L(bar) tzcntl %eax, %eax addq %rdi, %rax ret L(bar): xorl %eax, %eax ret ``` This code does not change any existing functionality. There is no difference in the objdump of libc.so before and after this patch. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
36 lines
1.2 KiB
C
36 lines
1.2 KiB
C
/* Common config for AVX-RTM VECs
|
|
All versions must be listed in ifunc-impl-list.c.
|
|
Copyright (C) 2022 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with the GNU C Library; if not, see
|
|
<https://www.gnu.org/licenses/>. */
|
|
|
|
#ifndef _AVX_RTM_VECS_H
|
|
#define _AVX_RTM_VECS_H 1
|
|
|
|
#define COND_VZEROUPPER COND_VZEROUPPER_XTEST
|
|
#define ZERO_UPPER_VEC_REGISTERS_RETURN \
|
|
ZERO_UPPER_VEC_REGISTERS_RETURN_XTEST
|
|
|
|
#define VZEROUPPER_RETURN jmp L(return_vzeroupper)
|
|
|
|
#define USE_WITH_RTM 1
|
|
#include "avx-vecs.h"
|
|
|
|
#undef SECTION
|
|
#define SECTION(p) p##.avx.rtm
|
|
|
|
#endif
|