[PATCH] ntdll/tests: Do not write to fs, gs when testing cleared segment regs on x64.
Fixes the crash in test. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51152 Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> --- dlls/ntdll/tests/exception.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 328882c1a23..7b83c06a8db 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -2908,13 +2908,27 @@ static const struct exception 0x31, 0xc0, /* xor %eax,%eax */ 0x8e, 0xc0, /* mov %eax,%es */ 0x8e, 0xd8, /* mov %eax,%ds */ +#if 0 + /* TODO_WINE: fs/gs base is reset on Linux when setting the + segment value and this is not currently handled. + Disable this part to avoid crashing the test. */ 0x8e, 0xe0, /* mov %eax,%fs */ 0x8e, 0xe8, /* mov %eax,%gs */ +#else + 0x90, 0x90, /* nop */ + 0x90, 0x90, /* nop */ +#endif 0xfa, /* cli */ 0x58, /* pop %rax */ +#if 0 0x8e, 0xe8, /* mov %eax,%gs */ 0x58, /* pop %rax */ 0x8e, 0xe0, /* mov %eax,%fs */ +#else + 0x58, /* pop %rax */ + 0x90, 0x90, /* nop */ + 0x90, 0x90, /* nop */ +#endif 0x58, /* pop %rax */ 0x8e, 0xd8, /* mov %eax,%ds */ 0x58, /* pop %rax */ -- 2.31.1
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=92979 Your paranoid android. === debiant2 (64 bit WoW report) === ntdll: exception.c:3720: Test succeeded inside todo block: UnhandledExceptionFilter wasn't called exception.c:3720: Test succeeded inside todo block: UnhandledExceptionFilter wasn't called exception.c:3720: Test succeeded inside todo block: UnhandledExceptionFilter wasn't called exception.c:3720: Test succeeded inside todo block: UnhandledExceptionFilter wasn't called exception.c:3720: Test succeeded inside todo block: UnhandledExceptionFilter wasn't called exception.c:3720: Test succeeded inside todo block: UnhandledExceptionFilter wasn't called Report validation errors: ntdll:exception has unaccounted for failure messages ntdll:exception returned success despite having failures
On 6/23/21 6:57 AM, Paul Gofman wrote:
Fixes the crash in test.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51152 Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> --- dlls/ntdll/tests/exception.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 328882c1a23..7b83c06a8db 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -2908,13 +2908,27 @@ static const struct exception 0x31, 0xc0, /* xor %eax,%eax */ 0x8e, 0xc0, /* mov %eax,%es */ 0x8e, 0xd8, /* mov %eax,%ds */ +#if 0 + /* TODO_WINE: fs/gs base is reset on Linux when setting the + segment value and this is not currently handled. + Disable this part to avoid crashing the test. */ 0x8e, 0xe0, /* mov %eax,%fs */ 0x8e, 0xe8, /* mov %eax,%gs */ +#else + 0x90, 0x90, /* nop */ + 0x90, 0x90, /* nop */ +#endif 0xfa, /* cli */ 0x58, /* pop %rax */ +#if 0 0x8e, 0xe8, /* mov %eax,%gs */ 0x58, /* pop %rax */ 0x8e, 0xe0, /* mov %eax,%fs */ +#else + 0x58, /* pop %rax */ + 0x90, 0x90, /* nop */ + 0x90, 0x90, /* nop */ +#endif 0x58, /* pop %rax */ 0x8e, 0xd8, /* mov %eax,%ds */ 0x58, /* pop %rax */
I don't object to disabling these tests, but I don't think the comment is accurate. We've been able to observe fsbase being reset to zero on one AMD processor, with Linux 5.12, but not another; the behaviour violates the AMD specification, and it's not clear that the kernel is actually getting involved.
participants (3)
-
Marvin -
Paul Gofman -
Zebediah Figura (she/her)