<?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 Re:Determine the max creatable SGX enclave (EPC) in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Determine-the-max-creatable-SGX-enclave-EPC/m-p/1358494#M5137</link>
    <description>&lt;P&gt;&lt;B&gt;This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.&lt;/B&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 08 Feb 2022 15:41:53 GMT</pubDate>
    <dc:creator>JesusG_Intel</dc:creator>
    <dc:date>2022-02-08T15:41:53Z</dc:date>
    <item>
      <title>Determine the max creatable SGX enclave (EPC)</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Determine-the-max-creatable-SGX-enclave-EPC/m-p/1356621#M5129</link>
      <description>&lt;DIV&gt;
&lt;P&gt;I couldn't find a way of determining what would be the max creatable enclave using the&amp;nbsp;&lt;A href="https://github.com/intel/linux-sgx/" target="_blank" rel="nofollow noopener noreferrer"&gt;SGX SDK&lt;/A&gt;. Is there any way of fetching these capabilities? This is especially useful in cloud environments where you can create virtual machines with EPC sections and you don't know the actual usable size of the provisioned EPC. &lt;A href="https://apklub.com/" target="_self"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 02 Feb 2022 13:22:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Determine-the-max-creatable-SGX-enclave-EPC/m-p/1356621#M5129</guid>
      <dc:creator>apklub</dc:creator>
      <dc:date>2022-02-02T13:22:30Z</dc:date>
    </item>
    <item>
      <title>Re:Determine the max creatable SGX enclave (EPC)</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Determine-the-max-creatable-SGX-enclave-EPC/m-p/1356850#M5130</link>
      <description>&lt;P&gt;Hello apklub,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The SGX SDK does not provide a way to find the maximum EPC size but it is possible to determine the size of your EPC programmatically by checking the processor registers. &lt;A href="https://github.com/ayeks/SGX-hardware/blob/master/test-sgx.c" rel="noopener noreferrer" target="_blank"&gt;Test-sgx&lt;/A&gt; demonstrates this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a few ways to determine the maximum EPC size on your processor. Below are the easiest two methods, programmatically and in BIOS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Method 1:&lt;/U&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;B style="font-size: 10pt;"&gt;Go to&lt;/B&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/ayeks/SGX-hardware" rel="noopener noreferrer" target="_blank"&gt;SGX Hardware Github&lt;/A&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;B style="font-size: 10pt;"&gt;download&amp;nbsp;&lt;/B&gt;&lt;SPAN style="font-size: 10pt;"&gt;the file&amp;nbsp;&lt;/SPAN&gt;&lt;I style="font-size: 10pt;"&gt;test_sgx.c&lt;/I&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;or&amp;nbsp;&lt;/SPAN&gt;&lt;B style="font-size: 10pt;"&gt;clone&amp;nbsp;&lt;/B&gt;&lt;SPAN style="font-size: 10pt;"&gt;the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/ayeks/SGX-hardware" rel="noopener noreferrer" target="_blank"&gt;repository&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;B style="font-size: 10pt;"&gt;Compile&amp;nbsp;&lt;/B&gt;&lt;SPAN style="font-size: 10pt;"&gt;and&amp;nbsp;&lt;/SPAN&gt;&lt;B style="font-size: 10pt;"&gt;run&lt;/B&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;test_sgx.c according to these&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/ayeks/SGX-hardware#test-sgx" rel="noopener noreferrer" target="_blank"&gt;&lt;B&gt;instructions&lt;/B&gt;&lt;/A&gt;&lt;B style="font-size: 10pt;"&gt;:&lt;/B&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="font-family: courier;"&gt;$ git clone &lt;A href="https://github.com/ayeks/SGX-hardware.git" target="_blank"&gt;https://github.com/ayeks/SGX-hardware.git&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier;"&gt;$ cd SGX-hardware/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier;"&gt;$ gcc test-sgx.c -o test-sgx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier;"&gt;$ ./test-sgx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Look for output like:&lt;/P&gt;&lt;P class="ql-indent-1"&gt;&lt;SPAN style="font-family: courier;"&gt;CPUID Leaf 12H, Sub-Leaf 2 of Intel SGX Capabilities (EAX=12H,ECX=2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ql-indent-1"&gt;&lt;SPAN style="font-family: courier;"&gt;eax: 70200001 ebx: 0 ecx: 5d80001 edx: 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ql-indent-1"&gt;&lt;SPAN style="font-family: courier;"&gt;size of EPC section in Processor Reserved Memory, 93 M&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Intel Clear&amp;quot;;"&gt;On my system&lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;quot;Courier New&amp;quot;;"&gt; exc: 5d80000 = 93MB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Intel Clear&amp;quot;;"&gt;The maximum enclave size is reported in &lt;/SPAN&gt;&lt;SPAN style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;MaxEnclaveSize&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;MaxEnclaveSize_Not64&lt;/SPAN&gt;&lt;SPAN style="font-family: intel-clear;"&gt;: the maximum supported enclave size is 2^(EDX[7:0]) bytes when not in 64-bit mode&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;MaxEnclaveSize_64&lt;/SPAN&gt;&lt;SPAN style="font-family: intel-clear;"&gt;: the maximum supported enclave size is 2^(EDX[15:8]) bytes when operating in 64- bit mode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So the maximum Virtual Size of the enclave is 2^(0x1f) for 32bit and 2^(0x24) for 64bit enclaves.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Refer&lt;/B&gt; to the values returned by the CPUID call (Section 37.7.2, Table 37-6 of the &lt;A href="https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-3d-part-4-manual.pdf" rel="noopener noreferrer" target="_blank"&gt;IA Software Developer Manual Vol 3d Part 4&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Method 2:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Find the SGX Processor Reserved Memory size in BIOS. It will be listed differently depending on your BIOS but you can usually find the SGX memory setting next to the SGX enable setting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Windows does not support paging for SGX enclaves, so you are limited to the EPC size. Linux supports paging so the amount of memory you can allocate to an enclave is not limited by the EPC size.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Feb 2022 21:28:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Determine-the-max-creatable-SGX-enclave-EPC/m-p/1356850#M5130</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2022-02-02T21:28:13Z</dc:date>
    </item>
    <item>
      <title>Re:Determine the max creatable SGX enclave (EPC)</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Determine-the-max-creatable-SGX-enclave-EPC/m-p/1358494#M5137</link>
      <description>&lt;P&gt;&lt;B&gt;This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.&lt;/B&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Feb 2022 15:41:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Determine-the-max-creatable-SGX-enclave-EPC/m-p/1358494#M5137</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2022-02-08T15:41:53Z</dc:date>
    </item>
  </channel>
</rss>

