Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix patcher for ppc and aarch64 #13027

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions opal/mca/patcher/patcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
* Reference: "64-bit PowerPC ELF Application Binary Interface Supplement 1.9" */
# define OPAL_PATCHER_BEGIN \
unsigned long toc_save; \
asm volatile("std 2, %0" : "=m"(toc_save)); \
asm volatile("nop; nop; nop; nop; nop");
# define OPAL_PATCHER_END asm volatile("ld 2, %0" : : "m"(toc_save));
asm volatile("std 2, %0" : "=m"(toc_save) :: "memory"); \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a reference to the GCC ticket to remember why we globber the memory here? Just in case someone looks at this in 3 years from now and tries to save some cycles...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asm volatile("nop; nop; nop; nop; nop"::: "memory");
# define OPAL_PATCHER_END asm volatile("ld 2, %0" : : "m"(toc_save) : "memory");

#else /* !__PPC64__ */

Expand Down
Loading