-
Notifications
You must be signed in to change notification settings - Fork 11
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
Verify that bpf2bpf updates r10 #245
Conversation
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
I don't think this PR should be merged as such as this is not an ISA requirement and this is (currently) an ISA conformance suite. See discussion in microsoft/ebpf-for-windows#3506 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file tests the psABI which is not targeted for standardization, only documentation as informational, rather than the ISA which is targeted for standardization. Is bpf_conformance actually a standards conformance test suite? if so, this PR is inappropriate in my view. Or is it both standards conformance and also Linux psABI conformance? I'd recommend separating them, such as into separate test directories if so, and this change could be in the linux psabi tests directory rather than the isa tests directory.
That makes sense. |
@dthaler I don't agree. My position: Possible implementations:
Assume the following program:
What value should outer return? 1 or 2? I don't see that as being related to the Linux psABI, but rather a core issue of BPF ISA conformance. |
r10 is not defined as a stack pointer in the ISA. So what should the following return?
|
Thanks. I didn't realize the BPF ISA doesn't reference stack at all. So should we remove all test that assume R10 is stack address? |
OK, I understand your point. Will close this PR. |
It's a good question. Right now my opinion is to keep tests for both the ISA and the Linux psABI but put the test files in separate directories and allow the conformance runner to be told which directory to use. That is, I expect tests against the psABI will be interesting once better documented, and tests that assume R10 is a stack address will be important there. |
BTW the very beginnings of a psABI document is at https://www.kernel.org/doc./html/latest/bpf/standardization/abi.html As shown at https://datatracker.ietf.org/wg/bpf/about/ (fourth bullet), it should be published as an IETF RFC eventually, though as Informational [I] not a Proposed Standard [PS]. |
This pull request includes changes to the
tests/call_local.data
file to ensure that the stack is preserved during function calls. The changes involve writing to the stack before a function call and reading back the values after the call to check that they were not overwritten by the function.Stack preservation checks:
tests/call_local.data
: Added lines to write to the stack before callinglocal func1
and read back the values after the call. This ensures that the values are preserved and not overwritten byfunc1
.tests/call_local.data
: Added lines to write to the stack instdw [%r10-4], 0xCCBBAA99
. This ensures that the stack writing operation does not overwrite the callee's values.