<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic EREPORT returns a Segmentation fault in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EREPORT-returns-a-Segmentation-fault/m-p/1167257#M3085</link>
    <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;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 &amp;nbsp;be written. The following is my &amp;nbsp;code snippet.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;sgx_report_t report;&lt;BR /&gt;
	unsigned long *addr = &amp;amp;report;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;asm("xor %rbx,%rbx");&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;asm("xor %rcx,%rcx");&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;asm volatile("mov %0,%%rdx": :"r" (addr) );&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;asm("xor %eax,%eax");&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;asm("enclu");&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Please tell me where I am getting wrong. Thanks in advance.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Aug 2017 05:59:05 GMT</pubDate>
    <dc:creator>Shredha_K_</dc:creator>
    <dc:date>2017-08-16T05:59:05Z</dc:date>
    <item>
      <title>EREPORT returns a Segmentation fault</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EREPORT-returns-a-Segmentation-fault/m-p/1167257#M3085</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;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 &amp;nbsp;be written. The following is my &amp;nbsp;code snippet.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;sgx_report_t report;&lt;BR /&gt;
	unsigned long *addr = &amp;amp;report;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;asm("xor %rbx,%rbx");&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;asm("xor %rcx,%rcx");&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;asm volatile("mov %0,%%rdx": :"r" (addr) );&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;asm("xor %eax,%eax");&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;asm("enclu");&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Please tell me where I am getting wrong. Thanks in advance.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 05:59:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EREPORT-returns-a-Segmentation-fault/m-p/1167257#M3085</guid>
      <dc:creator>Shredha_K_</dc:creator>
      <dc:date>2017-08-16T05:59:05Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EREPORT-returns-a-Segmentation-fault/m-p/1167258#M3086</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;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 &amp;amp;&lt;SPAN style="font-size: 13.008px;"&gt;report to&lt;/SPAN&gt;&amp;nbsp;unsigned long .&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 12:44:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EREPORT-returns-a-Segmentation-fault/m-p/1167258#M3086</guid>
      <dc:creator>Anusha_K_Intel</dc:creator>
      <dc:date>2017-08-18T12:44:45Z</dc:date>
    </item>
  </channel>
</rss>

