Skip to content

Commit c37095c

Browse files
committed
merge the fix for driver node detection
Signed-off-by: JunjunGu1 <junjun.gu@intel.com>
1 parent 4cab878 commit c37095c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

psw/urts/linux/edmm_utility.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ bool get_driver_type(int *driver_type)
101101

102102
int hdev = open("/dev/sgx/enclave", O_RDWR); //attempt to open the in-kernel driver
103103
if (-1 == hdev)
104+
{
105+
//if /dev/sgx/enclave is not present, try to open /dev/sgx_enclave
106+
hdev = open("/dev/sgx_enclave", O_RDWR);
107+
}
108+
if (-1 == hdev)
104109
{
105110
hdev = open("/dev/isgx", O_RDWR); //attempt to open the out-of-tree driver
106111
if (-1 == hdev)
@@ -150,6 +155,11 @@ extern "C" bool open_se_device(int driver_type, int *hdevice)
150155
if (driver_type == SGX_DRIVER_IN_KERNEL)
151156
{
152157
*hdevice = open("/dev/sgx/enclave", O_RDWR); //attempt to open the in-kernel driver
158+
//if /dev/sgx/enclave is not present, try to open /dev/sgx_enclave
159+
if(-1 == *hdevice)
160+
{
161+
*hdevice = open("/dev/sgx_enclave", O_RDWR);
162+
}
153163
}
154164
else if (driver_type == SGX_DRIVER_DCAP)
155165
{

0 commit comments

Comments
 (0)