mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
liblzma: Enable Intel CET in x86 CRC assembly codes
When Intel CET is enabled, we need to include <cet.h> in assembly codes to mark Intel CET support and add _CET_ENDBR to indirect jump targets. Tested on Intel Tiger Lake under CET enabled Linux.
This commit is contained in:
parent
bb3b8c6a23
commit
4fd79b90c5
2 changed files with 18 additions and 0 deletions
|
@ -51,6 +51,14 @@ init_table(void)
|
||||||
* extern uint32_t lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc);
|
* extern uint32_t lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* When Intel CET is enabled, include <cet.h> in assembly code to mark
|
||||||
|
Intel CET support. */
|
||||||
|
#ifdef __CET__
|
||||||
|
# include <cet.h>
|
||||||
|
#else
|
||||||
|
# define _CET_ENDBR
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* On some systems, the functions need to be prefixed. The prefix is
|
* On some systems, the functions need to be prefixed. The prefix is
|
||||||
* usually an underscore.
|
* usually an underscore.
|
||||||
|
@ -83,6 +91,7 @@ init_table(void)
|
||||||
|
|
||||||
ALIGN(4, 16)
|
ALIGN(4, 16)
|
||||||
LZMA_CRC32:
|
LZMA_CRC32:
|
||||||
|
_CET_ENDBR
|
||||||
/*
|
/*
|
||||||
* Register usage:
|
* Register usage:
|
||||||
* %eax crc
|
* %eax crc
|
||||||
|
|
|
@ -41,6 +41,14 @@ init_table(void)
|
||||||
* extern uint64_t lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc);
|
* extern uint64_t lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* When Intel CET is enabled, include <cet.h> in assembly code to mark
|
||||||
|
Intel CET support. */
|
||||||
|
#ifdef __CET__
|
||||||
|
# include <cet.h>
|
||||||
|
#else
|
||||||
|
# define _CET_ENDBR
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* On some systems, the functions need to be prefixed. The prefix is
|
* On some systems, the functions need to be prefixed. The prefix is
|
||||||
* usually an underscore.
|
* usually an underscore.
|
||||||
|
@ -73,6 +81,7 @@ init_table(void)
|
||||||
|
|
||||||
ALIGN(4, 16)
|
ALIGN(4, 16)
|
||||||
LZMA_CRC64:
|
LZMA_CRC64:
|
||||||
|
_CET_ENDBR
|
||||||
/*
|
/*
|
||||||
* Register usage:
|
* Register usage:
|
||||||
* %eax crc LSB
|
* %eax crc LSB
|
||||||
|
|
Loading…
Reference in a new issue