Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Shredha_K_
Novice
107 Views

EREPORT returns a Segmentation fault

Hi all,

I was trying to execute the EREPORT instruction using inline assembly. I intend to give a NULL value to RBX and RCX (as sgx_target_info_t and sgx_report_data_t can be NULL). RDX contains the address where the REPORT will  be written. The following is my  code snippet. 

sgx_report_t report;
unsigned long *addr = &report;

asm("xor %rbx,%rbx");

asm("xor %rcx,%rcx");

asm volatile("mov %0,%%rdx": :"r" (addr) );

asm("xor %eax,%eax");

asm("enclu");

 

Please tell me where I am getting wrong. Thanks in advance. 

 

 

0 Kudos
1 Reply
Anusha_K_Intel
Employee
107 Views

Hi,

There is some error in your inline assembly language code.Can you please specify at what point you are receiving the segmentation fault and does asm command work in your enclave code since it suggests to use _asm and you cannot directly assign &report to unsigned long .

 

 

 

Reply