diff options
| -rw-r--r-- | patches/e9patch-check-rflags.patch | 147 |
1 files changed, 32 insertions, 115 deletions
diff --git a/patches/e9patch-check-rflags.patch b/patches/e9patch-check-rflags.patch index 2c6977e..d012896 100644 --- a/patches/e9patch-check-rflags.patch +++ b/patches/e9patch-check-rflags.patch @@ -1,115 +1,32 @@ -diff --git a/test/regtest/after.exp b/test/regtest/after.exp -index 9c6409090159..68a393d66ef1 100644 ---- a/test/regtest/after.exp -+++ b/test/regtest/after.exp -@@ -25,22 +25,22 @@ - 000000000a0001cb:000000000c007fe0:0000000000000600: 4d 01 ca add %r9, %r10 - 000000000a0001cf:000000000c007fe0:ffffffffffff9600: 49 83 e8 08 sub $0x8, %r8 - 000000000a0001d2:000000000c007fe0:0000000000000700: 4d 29 c2 sub %r8, %r10 --000000000a0001d5:000000000c007fe0:0000000000000301: 49 f7 ea imul %r10 --000000000a0001d9:000000000c007fe0:ffffffffffff8701: 4d 0f af d3 imul %r11, %r10 --000000000a0001dd:000000000c007fe0:0000000000000200: 4d 6b d3 77 imul $0x77, %r11, %r10 -+000000000a0001d5:000000000c007fe0:0000000000000701: 49 f7 ea imul %r10 -+000000000a0001d9:000000000c007fe0:0000000000000701: 4d 0f af d3 imul %r11, %r10 -+000000000a0001dd:000000000c007fe0:0000000000000600: 4d 6b d3 77 imul $0x77, %r11, %r10 - 000000000a0001e3:000000000c007fe0:0000000000000200: 48 25 fe 00 00 00 and $0xfe, %rax - 000000000a0001e6:000000000c007fe0:0000000000000200: 48 21 c3 and %rax, %rbx - 000000000a0001ea:000000000c007fe0:0000000000000200: 48 83 cb 13 or $0x13, %rbx - 000000000a0001ed:000000000c007fe0:ffffffffffff8200: 48 09 cb or %rcx, %rbx - 000000000a0001f0:000000000c007fe0:ffffffffffff8200: 48 f7 d1 not %rcx - 000000000a0001f3:000000000c007fe0:ffffffffffff9300: 48 f7 d9 neg %rcx --000000000a0001f7:000000000c007fe0:0000000000000200: 48 c1 e7 07 shl $0x7, %rdi --000000000a0001fb:000000000c007fe0:0000000000000200: 48 c1 ff 03 sar $0x3, %rdi --000000000a0001fd:000000000c007fd8:0000000000000200: 41 55 push %r13 --000000000a000204:000000000c007fd8:0000000000000200: 48 c7 c0 19 45 00 00 mov $0x4519, %rax --000000000a000208:000000000c007fd8:0000000000000200: 66 0f ef c0 pxor %xmm0, %xmm0 --000000000a00020d:000000000c007fd8:0000000000000200: f3 48 0f 2a c0 cvtsi2ss %rax, %xmm0 --000000000a000211:000000000c007fd8:0000000000000200: f3 0f 51 c8 sqrtss %xmm0, %xmm1 -+000000000a0001f7:000000000c007fe0:0000000000001200: 48 c1 e7 07 shl $0x7, %rdi -+000000000a0001fb:000000000c007fe0:0000000000001200: 48 c1 ff 03 sar $0x3, %rdi -+000000000a0001fd:000000000c007fd8:0000000000001200: 41 55 push %r13 -+000000000a000204:000000000c007fd8:0000000000001200: 48 c7 c0 19 45 00 00 mov $0x4519, %rax -+000000000a000208:000000000c007fd8:0000000000001200: 66 0f ef c0 pxor %xmm0, %xmm0 -+000000000a00020d:000000000c007fd8:0000000000001200: f3 48 0f 2a c0 cvtsi2ss %rax, %xmm0 -+000000000a000211:000000000c007fd8:0000000000001200: f3 0f 51 c8 sqrtss %xmm0, %xmm1 - 000000000a000214:000000000c007fd8:0000000000000300: 0f 2f c8 comiss %xmm0, %xmm1 - 000000000a000216:000000000c007fd8:0000000000000300: 74 e5 jz 0xa0001fb - 000000000a00021b:000000000c007fd8:0000000000000300: f3 48 0f 2c c1 cvttss2si %xmm1, %rax -diff --git a/test/regtest/example_12.exp b/test/regtest/example_12.exp -index 1260881659dc..161a195bcd21 100644 ---- a/test/regtest/example_12.exp -+++ b/test/regtest/example_12.exp -@@ -7,16 +7,16 @@ - 0000000000000600:0000000000000008:8877665544332211: 49 83 e8 08 sub $0x8, %r8 - ffffffffffff9600:8877665544332209:000000008d83851b: 4d 29 c2 sub %r8, %r10 - 0000000000000700:778899ab49506312:0000000000000000: 49 f7 ea imul %r10 --0000000000000301:00000000a5a5a5a5:778899ab49506312: 4d 0f af d3 imul %r11, %r10 --ffffffffffff8701:0000000000000077:00000000a5a5a5a5: 4d 6b d3 77 imul $0x77, %r11, %r10 --0000000000000200:00000000000000fe:2d9bfa6b1014f832: 48 25 fe 00 00 00 and $0xfe, %rax -+0000000000000701:00000000a5a5a5a5:778899ab49506312: 4d 0f af d3 imul %r11, %r10 -+0000000000000701:0000000000000077:00000000a5a5a5a5: 4d 6b d3 77 imul $0x77, %r11, %r10 -+0000000000000600:00000000000000fe:2d9bfa6b1014f832: 48 25 fe 00 00 00 and $0xfe, %rax - 0000000000000200:0000000000000032:8877665544332211: 48 21 c3 and %rax, %rbx - 0000000000000200:0000000000000013:0000000000000010: 48 83 cb 13 or $0x13, %rbx - 0000000000000200:ffffffffffff8889:0000000000000013: 48 09 cb or %rcx, %rbx - ffffffffffff8200:0000000000007776:0000000000000000: 48 f7 d9 neg %rcx - ffffffffffff9300:0000000000000007:0000000061616161: 48 c1 e7 07 shl $0x7, %rdi --0000000000000200:0000000000000003:00000030b0b0b080: 48 c1 ff 03 sar $0x3, %rdi --0000000000000200:0000000000000000:0000000000000000: 0f 2f c8 comiss %xmm0, %xmm1 -+0000000000001200:0000000000000003:00000030b0b0b080: 48 c1 ff 03 sar $0x3, %rdi -+0000000000001200:0000000000000000:0000000000000000: 0f 2f c8 comiss %xmm0, %xmm1 - 0000000000000300:0000000000000085:0000000000000085: 48 3d 85 00 00 00 cmp $0x85, %rax - 0000000000004600:0000000000000000:0000000000000000: 48 85 c0 test %rax, %rax - 0000000000004600:0000000050505050:0000000050505050: 31 f6 xor %esi, %esi -diff --git a/test/regtest/rip_rsp_rflags.exp b/test/regtest/rip_rsp_rflags.exp -index 9bd7d19e6c9c..4f7ddc935ae6 100644 ---- a/test/regtest/rip_rsp_rflags.exp -+++ b/test/regtest/rip_rsp_rflags.exp -@@ -40,22 +40,22 @@ - 000000000a0001cb:000000000c007fe0:0000000000000600: 49 83 e8 08 sub $0x8, %r8 - 000000000a0001cf:000000000c007fe0:ffffffffffff9600: 4d 29 c2 sub %r8, %r10 - 000000000a0001d2:000000000c007fe0:0000000000000700: 49 f7 ea imul %r10 --000000000a0001d5:000000000c007fe0:0000000000000301: 4d 0f af d3 imul %r11, %r10 --000000000a0001d9:000000000c007fe0:ffffffffffff8701: 4d 6b d3 77 imul $0x77, %r11, %r10 --000000000a0001dd:000000000c007fe0:0000000000000200: 48 25 fe 00 00 00 and $0xfe, %rax -+000000000a0001d5:000000000c007fe0:0000000000000701: 4d 0f af d3 imul %r11, %r10 -+000000000a0001d9:000000000c007fe0:0000000000000701: 4d 6b d3 77 imul $0x77, %r11, %r10 -+000000000a0001dd:000000000c007fe0:0000000000000600: 48 25 fe 00 00 00 and $0xfe, %rax - 000000000a0001e3:000000000c007fe0:0000000000000200: 48 21 c3 and %rax, %rbx - 000000000a0001e6:000000000c007fe0:0000000000000200: 48 83 cb 13 or $0x13, %rbx - 000000000a0001ea:000000000c007fe0:0000000000000200: 48 09 cb or %rcx, %rbx - 000000000a0001ed:000000000c007fe0:ffffffffffff8200: 48 f7 d1 not %rcx - 000000000a0001f0:000000000c007fe0:ffffffffffff8200: 48 f7 d9 neg %rcx - 000000000a0001f3:000000000c007fe0:ffffffffffff9300: 48 c1 e7 07 shl $0x7, %rdi --000000000a0001f7:000000000c007fe0:0000000000000200: 48 c1 ff 03 sar $0x3, %rdi --000000000a0001fb:000000000c007fe0:0000000000000200: 41 55 push %r13 --000000000a0001fd:000000000c007fd8:0000000000000200: 48 c7 c0 19 45 00 00 mov $0x4519, %rax --000000000a000204:000000000c007fd8:0000000000000200: 66 0f ef c0 pxor %xmm0, %xmm0 --000000000a000208:000000000c007fd8:0000000000000200: f3 48 0f 2a c0 cvtsi2ss %rax, %xmm0 --000000000a00020d:000000000c007fd8:0000000000000200: f3 0f 51 c8 sqrtss %xmm0, %xmm1 --000000000a000211:000000000c007fd8:0000000000000200: 0f 2f c8 comiss %xmm0, %xmm1 -+000000000a0001f7:000000000c007fe0:0000000000001200: 48 c1 ff 03 sar $0x3, %rdi -+000000000a0001fb:000000000c007fe0:0000000000001200: 41 55 push %r13 -+000000000a0001fd:000000000c007fd8:0000000000001200: 48 c7 c0 19 45 00 00 mov $0x4519, %rax -+000000000a000204:000000000c007fd8:0000000000001200: 66 0f ef c0 pxor %xmm0, %xmm0 -+000000000a000208:000000000c007fd8:0000000000001200: f3 48 0f 2a c0 cvtsi2ss %rax, %xmm0 -+000000000a00020d:000000000c007fd8:0000000000001200: f3 0f 51 c8 sqrtss %xmm0, %xmm1 -+000000000a000211:000000000c007fd8:0000000000001200: 0f 2f c8 comiss %xmm0, %xmm1 - 000000000a000214:000000000c007fd8:0000000000000300: 74 e5 jz 0xa0001fb - 000000000a000216:000000000c007fd8:0000000000000300: f3 48 0f 2c c1 cvttss2si %xmm1, %rax - 000000000a00021b:000000000c007fd8:0000000000000300: 48 3d 85 00 00 00 cmp $0x85, %rax -diff --git a/test/regtest/xmm.exp b/test/regtest/xmm.exp -index 6d14efe6145f..b8778457492c 100644 ---- a/test/regtest/xmm.exp -+++ b/test/regtest/xmm.exp -@@ -1,6 +1,6 @@ --000000000a000204:0000000000004519:0000000000000200: 66 0f ef c0 pxor %xmm0, %xmm0 --000000000a000208:0000000000004519:0000000000000200: f3 48 0f 2a c0 cvtsi2ss %rax, %xmm0 --000000000a00020d:0000000000004519:0000000000000200: f3 0f 51 c8 sqrtss %xmm0, %xmm1 --000000000a000211:0000000000004519:0000000000000200: 0f 2f c8 comiss %xmm0, %xmm1 -+000000000a000204:0000000000004519:0000000000001200: 66 0f ef c0 pxor %xmm0, %xmm0 -+000000000a000208:0000000000004519:0000000000001200: f3 48 0f 2a c0 cvtsi2ss %rax, %xmm0 -+000000000a00020d:0000000000004519:0000000000001200: f3 0f 51 c8 sqrtss %xmm0, %xmm1 -+000000000a000211:0000000000004519:0000000000001200: 0f 2f c8 comiss %xmm0, %xmm1 - 000000000a000216:0000000000004519:0000000000000300: f3 48 0f 2c c1 cvttss2si %xmm1, %rax - PASSED +commit 856abec11039046d60f13609887894c730bef4a7 +Author: Nguyễn Gia Phong <cnx@loang.net> +Date: 2024-12-05 16:00:06 +0900 + + Disable flaky tests involving rflags + +diff --git a/test/regtest/Makefile b/test/regtest/Makefile +index 9b29e0f72408..05f9ce0a6591 100644 +--- a/test/regtest/Makefile ++++ b/test/regtest/Makefile +@@ -7,8 +7,14 @@ BASE ::= test test.pie bugs test.libc libtest.so test_c test_c.debug example.so + TRAMPOLINE ::= inst patch dl init fini + IN ::= $(wildcard *.in) + EXE ::= $(IN:.in=.exe) ++# Some instructions leave certain rflags undefined: ++# https://github.com/GJDuck/e9patch/issues/96 ++FLAKY ::= after example_12 rip_rsp_rflags xmm + +-check: regtest $(EXE) ++check: regtest $(filter-out $(FLAKY:%=%.exe), $(EXE)) ++ ./$^ ++ ++check-flaky: regtest $(filter $(FLAKY:%=%.exe), $(EXE)) + ./$^ + + %.exe: in=$(shell head -1 $<) +@@ -68,4 +74,4 @@ example.so: + clean-check: + rm -f $(BASE) $(TRAMPOLINE) $(EXE) + +-.PHONY: check clean-check ++.PHONY: check check-flaky clean-check |
