This is an archive of the discontinued LLVM Phabricator instance.

[BPF] Implement mod operation
ClosedPublic

Authored by Jim on May 8 2022, 11:55 PM.

Details

Summary

Implement BPF_MOD instruction to fix lack of assembly parser support mentioned in https://github.com/llvm/llvm-project/issues/55192.

Diff Detail

Event Timeline

Jim created this revision.May 8 2022, 11:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2022, 11:55 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
Jim requested review of this revision.May 8 2022, 11:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2022, 11:55 PM
Jim edited the summary of this revision. (Show Details)May 8 2022, 11:58 PM
Jim added a reviewer: yonghong-song.

The current 'summary' or commit message is too simple. Could you clarify some motivation why you need to add this instruction?
The change itself looks good to me. The kernel selftest test_verifier does test BPF_MOD instruction and I checked verifier code, BPF_MOD is handled similar to BPF_DIV which should be okay in most cases, so I didn't see a major issue here.

ast accepted this revision.May 10 2022, 9:39 AM

lgtm as well.

This revision is now accepted and ready to land.May 10 2022, 9:39 AM
Jim edited the summary of this revision. (Show Details)May 10 2022, 7:44 PM

@Jim Thanks for the updated commit message. Please go ahead to merge to llvm-project main branch if you have write permission. Otherwise, please provide me with peoper git author signature "<name> <email address>" and I can help push the patch for you.

Jim added a comment.May 11 2022, 7:55 PM

@Jim Thanks for the updated commit message. Please go ahead to merge to llvm-project main branch if you have write permission. Otherwise, please provide me with peoper git author signature "<name> <email address>" and I can help push the patch for you.

Thanks @yonghong-song . I have commit right.

This revision was landed with ongoing or failed builds.May 11 2022, 7:56 PM
This revision was automatically updated to reflect the committed changes.