Remote Procedure Call · We’d like to make a "Call" to a procedure on another machine. · We’ll call that a "remote procedure call". · A "remote" call can be to another process on a different machine or on this machine. · Recommended paper: "Implementing Remote Procedure Calls", Birrell and Nelson, ACM TOCS, 2, 1, February 1984, pp. 39-59. · "When a remote procedure is invoked, the calling environ- ment is suspended, the parameters are passed across the network to the environment where the procedure is to exe- cute (the callee), and the desired procedure is executed there. When the procedure finishes and produces its re- sults, the results are passed back to the calling envi- ronment, where execution resumes as if returning from a single machine call." · Issues: · How are arguments and results passed when there is no shared address space? · Must pass and return (effectively) by value. · Could fake call by reference if necessary. · Must be very careful about side effects. · How is the callee located/identified? · Static vs. Dynamic · What happens if there are machine and/or communications failures? · How are data integrity and security obtained when using an open communications channel? · Overhead · Would like semantics to be same or similar to normal pro- cedure call. · Mechanism · Five components: · Caller (User) · User-Stub - interface between the caller and the com- munications mechanism. · Communications Package (RPCRuntime) · Server-Stub - interface between communications pack- age and callee. · Server (callee) · Call Steps: · [ Caller - User-stub (pack arguments) - RPCRuntime (trans- mit)] - · call packet - · [ RPCRuntime (receive) - Server Stub (unpack arguments) - callee - · Server Stub (pack results) - RPC Runtime (transmit) ] - · Result Packet - · [ RPC Runtime(receive) - User-Stub (unpack result) - caller ] -------------------------------------------- · Virtualizing the X86 · Cannot properly virtualize the X86 architecture: · A process running on a virtual machine can determine that it is not running in privileged state. (The CPL (current privilege level) is stored in the low two bits of the Code Segment Selector. (%cs) · Some privileged instructions don’t trap if run in us- er state. E.g. popf (pop flags) may change both ALU flags and system flags when run in privileged state, but in user state, only changes the ALU flags (and does not trap). · Solution (used by VMware): · Do run-time binary translation of the X86 code. When an instruction is detected that needs special han- dling, appropriate code is generated. Otherwise, the original code is directly executed.