sgx: rebase these patches (not tested yet)

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>