https://bugs.winehq.org/show_bug.cgi?id=46472
Bug ID: 46472 Summary: Linux kernel 4.19 breaks startup of BO2 due to change in PTRACE_POKEUSER hw breakpoint behavior Product: Wine Version: 4.0-rc6 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: troyb@us.ibm.com Distribution: ---
Created attachment 63297 --> https://bugs.winehq.org/attachment.cgi?id=63297 linux 4.19 commit bd14406b78e6daa1ea3c1673bda1ffc9efdeead0
I bisected Linux 4.18 to 4.19 to find this commit which stops BO2 from launching under any version of wine from 3.12 to 4.0-rc6, attachment below. For convenience I hand-reverted the file kernel/events/hw_breakpoint.c as follows :
/** * modify_user_hw_breakpoint - modify a user-space hardware breakpoint * @bp: the breakpoint structure to modify * @attr: new breakpoint attributes */ int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr) { int err;
/* * modify_user_hw_breakpoint can be invoked with IRQs disabled and hence it * will not be possible to raise IPIs that invoke __perf_event_disable. * So call the function directly after making sure we are targeting the * current task. */ if (irqs_disabled() && bp->ctx && bp->ctx->task == current) perf_event_disable_local(bp); else perf_event_disable(bp);
#if 0 /* new logic : >= kernel 4.19 */ err = modify_user_hw_breakpoint_check(bp, attr, false);
if (!bp->attr.disabled) perf_event_enable(bp);
return err; #else /* old logic : <kernel 4.19 */ if (!attr->disabled) { err = modify_user_hw_breakpoint_check(bp, attr, false); if (err) return err; perf_event_enable(bp); bp->attr.disabled=0; } return 0; #endif }
I examined some wine source code and found many instance of use of PTRACE_POKUSER. I don't know enough about this function to know if this kernel commit directly breaks the wine code, or some other fault in wine code is indirectly triggering the problem. Using "old logic" in the file hw_breakpoints above enables kernel 4.19 to start BO2 with 4.0-rc6 (and most likely others).