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

bpf, arm64: Support Exceptions #6373

Closed

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: bpf, arm64: Support Exceptions
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 994ff2f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 1581e51
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 943b043
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6fb3f72
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: a68b50f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 2a79690
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: df9705e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 7e42863
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 169e650
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 1159d27
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 1159d27
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 1159d27
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

This will be used by bpf_throw() to unwind till the program marked as
exception boundary and run the callback with the stack of the main
program.

This is required for supporting BPF exceptions on ARM64.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
The prologue generation code has been modified to make the callback
program use the stack of the program marked as exception boundary where
callee-saved registers are already pushed.

As the bpf_throw function never returns, if it clobbers any callee-saved
registers, they would remain clobbered. So, the prologue of the
exception-boundary program is modified to push R23 and R24 as well,
which the callback will then recover in its epilogue.

The Procedure Call Standard for the Arm 64-bit Architecture[1] states
that registers r19 to r28 should be saved by the callee. BPF programs on
ARM64 already save all callee-saved registers except r23 and r24. This
patch adds an instruction in prologue of the  program to save these
two registers and another instruction in the epilogue to recover them.

These extra instructions are only added if bpf_throw() is used. Otherwise
the emitted prologue/epilogue remains unchanged.

[1] https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: a4561f5
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=822107
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=784973 expired. Closing PR.

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

Successfully merging this pull request may close these issues.

1 participant