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

fix issues: https://github.com/iovisor/ubpf/issues/609 #613

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zhaozhongshu
Copy link

special targets(TARGET_PC_EXIT/TARGET_PC_ENTER/TARGET_PC_RETPOLINE/TARGET_PC_EXTERNAL_DISPATCHER/TARGET_LOAD_HELPER_TABLE) may conflict with normal target_pc

…NE/TARGET_PC_EXTERNAL_DISPATCHER/TARGET_LOAD_HELPER_TABLE) may conflict with normal target_pc
Copy link
Collaborator

@hawkinsw hawkinsw left a comment

Choose a reason for hiding this comment

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

@zhaozhongshu Thank you so much for submitting this PR! You raise an incredibly great point. Here's what I am wondering, though:

I really like how you are using the high bits to make sure that we have less opportunity to conflict with a real value. It seems that no matter what special value we use, we always run a risk for an overlap.

I have been thinking about this problem and I was wondering what you thought about a solution like this:

  1. Make a target type that is essentially a tagged union where one type is a "special value" and the other is a real target. The special values could take on one of these special values.
  2. When we use the value to patch up, we would check the tag in the union to see whether it is a special value or an actual target.
  3. Then, depending on that tag value, we can do "the right thing".

If you think that this would be something that would be a good solution, I would be more than happy to code it. I don't want to make more work for you!

That said, I also know what it's like to submit a PR and not get to land it yourself -- so I absolutely do not want to take this work from you!

Again, I would love your feedback. And, to reiterate, thank you for the work!

Will

@zhaozhongshu
Copy link
Author

@zhaozhongshu Thank you so much for submitting this PR! You raise an incredibly great point. Here's what I am wondering, though:

I really like how you are using the high bits to make sure that we have less opportunity to conflict with a real value. It seems that no matter what special value we use, we always run a risk for an overlap.

I have been thinking about this problem and I was wondering what you thought about a solution like this:

  1. Make a target type that is essentially a tagged union where one type is a "special value" and the other is a real target. The special values could take on one of these special values.
  2. When we use the value to patch up, we would check the tag in the union to see whether it is a special value or an actual target.
  3. Then, depending on that tag value, we can do "the right thing".

If you think that this would be something that would be a good solution, I would be more than happy to code it. I don't want to make more work for you!

That said, I also know what it's like to submit a PR and not get to land it yourself -- so I absolutely do not want to take this work from you!

Again, I would love your feedback. And, to reiterate, thank you for the work!

Will

very complete solution

@hawkinsw
Copy link
Collaborator

FYI: @zhaozhongshu , I have a WIP that is close to being ready to publish for your review! I just need to do some cleanup! Thank you for pointing out the problem!

Will

@hawkinsw
Copy link
Collaborator

Hello!

I am sorry for the delay. I am still working on a solution to this problem and I will (hopefully) have a draft posted tonight! Sorry, again, for the delay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants