[Vm-dev] Robust FFI with Memory Protection Keys

Eliot Miranda eliot.miranda at gmail.com
Mon Aug 6 17:42:30 UTC 2018

Hi Tim,

> On Aug 6, 2018, at 10:32 AM, tim Rowledge <tim at rowledge.org> wrote:
> Surely the really safe way to do FFI type stuff is to have a separate memory space? The trick is how one achieves that.
> I can think of a few ways to do that, some of which might even work...
> - remapping (temporarily) the MMU entries to make only the directly involved FFI data area(s) visible
> - similar but perhaps just making everywhere else read-only
> - actually have a separate memory space that is shared to the vm
> - a completely separate process
> - hell, a completely separate computer!

While nice in theory this approach is useless in practice.  Many APIs we want to use are fundamentally about resources shared on some context (process, thread, API instance, etc) and involve sharing between the Smalltalk system and the external library.  Given that the relevant context is typically not shareable across different memory spaces then the approach is not generally useful.

> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Useful Latin Phrases:- Fac me cocleario vomere! = Gag me with a spoon!

More information about the Vm-dev mailing list