3 ms·
> the OS can page in and out SGX pages... That doesn't seem right. How is the OS supposed to page SGX in/out without being able to read its memory?
by duskwuff 9y ago
> the OS can page in and out SGX pages...
That doesn't seem right. How is the OS supposed to page SGX in/out without being able to read its memory?
- xyzzyz 9y agoThere is a special dance the OS has to perform in order to do it. In short, the OS calls EWB instruction, which makes CPU read the page from EPC, encrypt it, and write it to normal memory. To load it back, OS executes the ELDB instruction, which decrypts it and writes to EPC. There is slightly more to it due to version array, which is used to prevent replay attacks, but in general, paging in and out is completely fine in SGX.