Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UCM/BISTRO: Translate relative jumps #7866

Merged

Conversation

yosefe
Copy link
Contributor

@yosefe yosefe commented Jan 22, 2022

Why

Fix the issue described in #7791 (comment)

How

Bistro to handle functions that begin with a compare and short conditional jump, when need to jump more than 32-bit distance from the patched function to the hook code.

  • Decrease patch size for long jump from 13 bytes to 12 bytes by using rax (caller-saved) register instead of r11
  • Translate a short jump to a long 64-bit jump (from hook code back to the original function), and make sure we don't overwrite more than the jump target

@yosefe yosefe added the Bugfix label Jan 22, 2022
@yosefe yosefe force-pushed the topic/ucm-bistro-translate-relative-jumps branch from 6fd49f4 to 85adf3a Compare January 23, 2022 08:29
@yosefe yosefe force-pushed the topic/ucm-bistro-translate-relative-jumps branch from 85adf3a to 6c47694 Compare January 23, 2022 13:01
@pentschev
Copy link
Contributor

@yosefe thanks for the patch, I can confirm on my end the segfault is gone after applying it.

@yosefe
Copy link
Contributor Author

yosefe commented Jan 26, 2022

@hoopoepg can you pls take a look?

@yosefe yosefe merged commit 4df80e1 into openucx:master Jan 27, 2022
@yosefe yosefe deleted the topic/ucm-bistro-translate-relative-jumps branch January 27, 2022 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants