|
|
Subscribe / Log in / New account

Exceptions in BPF

Exceptions in BPF

Posted Jul 21, 2023 20:00 UTC (Fri) by Smon (guest, #104795)
In reply to: Exceptions in BPF by Cyberax
Parent article: Exceptions in BPF

Couldn't a compiler simulate this already with existing functionality?


to post comments

Exceptions in BPF

Posted Jul 22, 2023 16:00 UTC (Sat) by NYKevin (subscriber, #129325) [Link] (1 responses)

Maybe. Sort of. With a lot of effort.

The problem is that you need to return all the way up the stack, and therefore you need to return some kind of "we're bailing out" status code to indicate the problem to the caller. But you probably already have return values at many of those call sites, so now you need to transform those return values in some way, probably into an option type or tagged union (or some equivalent). In principle that should be possible, but I don't know if BPF makes it straightforward or performant.

Exceptions in BPF

Posted Jul 24, 2023 4:13 UTC (Mon) by Cyberax (✭ supporter ✭, #52523) [Link]

One of the bragging points of BPF was "but it always returns a value!", and that's why it's apparently better than WASM.

With the addition of exceptions, this guarantee is lost.

Not that it mattered either way in practice, but still. BPF is now just adding features without even considering their impact on the overall BPF model.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds