diff options
| author | Mike Pall <mike> | 2025-10-16 14:24:52 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2025-10-16 14:24:52 +0200 |
| commit | 25a61a182166fec06f1a1a025eb8fabbb6cf483e (patch) | |
| tree | da55c519b1302d3a1eb082b5acf1b11e57cbd268 /src/jit | |
| parent | 5c3254d68d2579bf8c5bd1e39e612582fb5a04f6 (diff) | |
| download | luajit-25a61a182166fec06f1a1a025eb8fabbb6cf483e.tar.gz luajit-25a61a182166fec06f1a1a025eb8fabbb6cf483e.tar.bz2 luajit-25a61a182166fec06f1a1a025eb8fabbb6cf483e.zip | |
x64: Add support for CET IBT.
Note: this is not enabled by default, look for CET in lj_arch.h
Contributed by Yuichiro Naito. #1391
Diffstat (limited to 'src/jit')
| -rw-r--r-- | src/jit/dis_x86.lua | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/jit/dis_x86.lua b/src/jit/dis_x86.lua index b1de0eea..6b04ee84 100644 --- a/src/jit/dis_x86.lua +++ b/src/jit/dis_x86.lua | |||
| @@ -122,7 +122,7 @@ local map_opc2 = { | |||
| 122 | "movlhpsXrm$movhpsXrm|movshdupXrm|movhpdXrm", | 122 | "movlhpsXrm$movhpsXrm|movshdupXrm|movhpdXrm", |
| 123 | "movhpsXmr||movhpdXmr", | 123 | "movhpsXmr||movhpdXmr", |
| 124 | "$prefetcht!Bm","hintnopVm","hintnopVm","hintnopVm", | 124 | "$prefetcht!Bm","hintnopVm","hintnopVm","hintnopVm", |
| 125 | "hintnopVm","hintnopVm","hintnopVm","hintnopVm", | 125 | "hintnopVm","hintnopVm","endbr*hintnopVm","hintnopVm", |
| 126 | --2x | 126 | --2x |
| 127 | "movUmx$","movUmy$","movUxm$","movUym$","movUmz$",nil,"movUzm$",nil, | 127 | "movUmx$","movUmy$","movUxm$","movUym$","movUmz$",nil,"movUzm$",nil, |
| 128 | "movapsXrm||movapdXrm", | 128 | "movapsXrm||movapdXrm", |
| @@ -804,6 +804,24 @@ map_act = { | |||
| 804 | return dispatch(ctx, map_opcvm[ctx.mrm]) | 804 | return dispatch(ctx, map_opcvm[ctx.mrm]) |
| 805 | end, | 805 | end, |
| 806 | 806 | ||
| 807 | -- Special NOP for endbr64/endbr32. | ||
| 808 | endbr = function(ctx, name, pat) | ||
| 809 | if ctx.rep then | ||
| 810 | local pos = ctx.pos | ||
| 811 | local b = byte(ctx.code, pos) | ||
| 812 | local text | ||
| 813 | if b == 0xfa then text = "endbr64" | ||
| 814 | elseif b == 0xfb then text = "endbr64" | ||
| 815 | end | ||
| 816 | if text then | ||
| 817 | ctx.pos = pos + 1 | ||
| 818 | ctx.rep = nil | ||
| 819 | return putop(ctx, text) | ||
| 820 | end | ||
| 821 | end | ||
| 822 | return dispatch(ctx, pat) | ||
| 823 | end, | ||
| 824 | |||
| 807 | -- Floating point opcode dispatch. | 825 | -- Floating point opcode dispatch. |
| 808 | fp = function(ctx, name, pat) | 826 | fp = function(ctx, name, pat) |
| 809 | local mrm = getmrm(ctx); if not mrm then return incomplete(ctx) end | 827 | local mrm = getmrm(ctx); if not mrm then return incomplete(ctx) end |
