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.
unsigned long *addr = &report;
asm volatile("mov %0,%%rdx": :"r" (addr) );
Please tell me where I am getting wrong. Thanks in advance.
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 .