<?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: Using the cache line locking instructions in P-Series</title>
    <link>https://community.nxp.com/t5/P-Series/Using-the-cache-line-locking-instructions/m-p/190627#M45</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See below comment from technical support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is said in e500mc Reference Manual: &lt;/P&gt;&lt;P&gt;The dcbtls, dcbtstls, dcblc, icbtls, and icblc cache-locking instructions require hypervisor state privilege to execute when MSRP[UCLEP] is set. Execution of these instructions in the guest supervisor state when MSRP[UCLEP] is set causes a hypervisor privilege exception. User mode execution of these instructions is unaffected and is still controlled by MSR[UCLE].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To check MSR[UCLE] you can read MSR register contents to any GPR register using "mfmsr" instruction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is the definition of UCLE field from EREF Manual:&lt;/P&gt;&lt;P&gt;37 UCLE User-mode cache lock enable. &amp;lt;Embedded.Cache Locking&amp;gt; 0 - Any cache lock instruction executed in user-mode takes a cache-locking DSI exception and sets either ESR[DLK] or ESR[ILK]. This allows the operating system to manage and track the locking/unlocking of cache lines by user-mode tasks.&lt;/P&gt;&lt;P&gt;1 - Cache-locking instructions can be executed in user-mode and they do not take a DSI for cache-locking. (They may still take a DSI for access violations though.) MSR[UCLE] cannot be modified when MSR[GS]=1 unless MSRP[UCLEP] is 0. &amp;lt;Embedded.Hypervisor&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Apr 2013 05:44:38 GMT</pubDate>
    <dc:creator>lunminliang</dc:creator>
    <dc:date>2013-04-17T05:44:38Z</dc:date>
    <item>
      <title>Using the cache line locking instructions</title>
      <link>https://community.nxp.com/t5/P-Series/Using-the-cache-line-locking-instructions/m-p/190626#M44</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use the cache line locking instructions (like dcbtls) on a p4080 system running Linux but it doesn't seem to be working.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code compiles just fine but I get an Illegal Instruction error at runtime.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to imitate the way the linux kernel uses the dcbt instruction (see &lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fgit.kernel.org%2F%3Fp%3Dlinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%3Ba%3Dblob%3Bf%3Darch%2Fpowerpc%2Finclude%2Fasm%2Fprocessor.h%3Bh%3D87502046c0dcfa9ed80ea856643abe05762aca13%3Bhb%3DHEAD%23l343" rel="nofollow" target="_blank"&gt;git.kernel.org - linux/kernel/git/torvalds/linux.git/blob - arch/powerpc/include/asm/processor.h&lt;/A&gt; ).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My only wild guess is that I do not have the right to execute this instruction since the doc says that MSR[UCLE] must be set for this instruction to be available to users. But I do not know how to check that.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337225"&gt;lock_lines-(1).cpp.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 11:40:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Using-the-cache-line-locking-instructions/m-p/190626#M44</guid>
      <dc:creator>moncef_mechri</dc:creator>
      <dc:date>2012-11-28T11:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using the cache line locking instructions</title>
      <link>https://community.nxp.com/t5/P-Series/Using-the-cache-line-locking-instructions/m-p/190627#M45</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See below comment from technical support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is said in e500mc Reference Manual: &lt;/P&gt;&lt;P&gt;The dcbtls, dcbtstls, dcblc, icbtls, and icblc cache-locking instructions require hypervisor state privilege to execute when MSRP[UCLEP] is set. Execution of these instructions in the guest supervisor state when MSRP[UCLEP] is set causes a hypervisor privilege exception. User mode execution of these instructions is unaffected and is still controlled by MSR[UCLE].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To check MSR[UCLE] you can read MSR register contents to any GPR register using "mfmsr" instruction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is the definition of UCLE field from EREF Manual:&lt;/P&gt;&lt;P&gt;37 UCLE User-mode cache lock enable. &amp;lt;Embedded.Cache Locking&amp;gt; 0 - Any cache lock instruction executed in user-mode takes a cache-locking DSI exception and sets either ESR[DLK] or ESR[ILK]. This allows the operating system to manage and track the locking/unlocking of cache lines by user-mode tasks.&lt;/P&gt;&lt;P&gt;1 - Cache-locking instructions can be executed in user-mode and they do not take a DSI for cache-locking. (They may still take a DSI for access violations though.) MSR[UCLE] cannot be modified when MSR[GS]=1 unless MSRP[UCLEP] is 0. &amp;lt;Embedded.Hypervisor&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Apr 2013 05:44:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/Using-the-cache-line-locking-instructions/m-p/190627#M45</guid>
      <dc:creator>lunminliang</dc:creator>
      <dc:date>2013-04-17T05:44:38Z</dc:date>
    </item>
  </channel>
</rss>

