You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
I am trying to add support for reading/writing memory addresses outside of the regular enclave and shared memory buffers.
I did manage to define an additional memory region in the enclave struct and that seems to get set correctly when context switching. However, I still get pagefaults in the enclave when trying to use it.
Ultimately I want to use this to facilitate communication with I/O (such as the UART connection) devices from within the enclave.
Some more detail:
New memory region type (enum value 3)
This type only gets set when entering the enclave. The entry should get cleared when leaving so that the default rules apply.
This new address is currently hardcoded to 0x10000000-0x10001000 (UART base address for the QEMU setup)
Add debugging prints in the SM, host app, and eapp(through edge calls). They are prefixed with [SM], [linux] and [eapp] respectively.
Problem:
I am still getting a pagefault from the eyrie runtime. I am not sure why that is since the PMP registers should be set correctly.
My understanding is that paging is disabled per default in eyrie. (USE_PAGING is not defined and the pagefault occurs at the correct physical address).
The scause register indicates "Load page fault" or "Store/AMO page fault" depending if the eapp tries to read or write.
Update:
I've tried writing to 0x10000000 from machine mode both before and after the call to context_switch_to_enclave. Both seem to be working as intended. However after switching to supervisor mode, this write fails.
There seems to be some address translation even with USE_PAGING and USE_FREEMEM both disabled. The SM is still setting the satp register to a non-zero value which I think may be causing this. I cannot change this since that would result in validate_and_hash_enclave to fail.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am trying to add support for reading/writing memory addresses outside of the regular enclave and shared memory buffers.
I did manage to define an additional memory region in the enclave struct and that seems to get set correctly when context switching. However, I still get pagefaults in the enclave when trying to use it.
Ultimately I want to use this to facilitate communication with I/O (such as the UART connection) devices from within the enclave.
Some more detail:
0x10000000-0x10001000
(UART base address for the QEMU setup)Problem:
USE_PAGING
is not defined and the pagefault occurs at the correct physical address).scause
register indicates "Load page fault" or "Store/AMO page fault" depending if the eapp tries to read or write.Output from running a test enclave:
If needed, I can provide my modifications to the SM and the eapp code, but they are not yet in any git repo.
Thanks for the help.
The text was updated successfully, but these errors were encountered: