<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE register_page SYSTEM "registers.dtd">
<!-- Copyright (c) 2010-2026 Arm Limited or its affiliates. All rights reserved. -->
<!-- This document is Non-Confidential. This document may only be used and distributed in accordance with the terms of the agreement entered into by Arm and the party that Arm delivered this document to. -->
<!--The data contained in this document is preliminary and subject to change or correction following further review. -->
<?xml-stylesheet href="one_register.xsl" type="text/xsl" ?>







<register_page>
  <registers>
  
    <register execution_state="AArch32" is_register="False" is_internal="True" is_stub_entry="False">
      <reg_short_name>COSPRCTX</reg_short_name>
        
        <reg_long_name>Clear Other Speculative Prediction Restriction by Context</reg_long_name>



      
            <reg_condition otherwise="UNDEFINED">when FEAT_AA32 is implemented and FEAT_SPECRES2 is implemented</reg_condition>
      




          <reg_reset_value></reg_reset_value>

      <reg_mappings>
        




      </reg_mappings>

        <reg_purpose>
          
    
      <purpose_text>
        <para>Clear Other Speculative Prediction Restriction by Context applies to prediction resources not managed by other speculation restriction System instructions.</para>

      </purpose_text>
      <purpose_text>
        <para>The actions of code in the target execution context or contexts appearing in program order before the instruction cannot exploitatively control any predictions occurring after the instruction is complete and synchronized.</para>

      </purpose_text>
      <purpose_text>
        <para>This instruction applies to all speculative access except:</para>

      </purpose_text>
      <purpose_text>
        <list type="unordered">
<listitem><content>Cache Prefetch predictions.</content>
</listitem><listitem><content>Control Flow predictions.</content>
</listitem><listitem><content>Data Value predictions.</content>
</listitem></list>

      </purpose_text>
      <purpose_text>
        <para>This instruction is guaranteed to be complete following a DSB that covers both read and write behavior on the PE that executed the original restriction instruction, and a subsequent Context Synchronization event is required to ensure that the effect of the completion of the instructions is synchronized to the current execution.</para>

      </purpose_text>
      <purpose_text>
        <note><para>This instruction does not require the invalidation of Cache Allocation Resources so long as the behavior described for completion of this instruction is met by the implementation.</para><para>On some implementations, the instruction is likely to take a significant number of cycles to execute. This instruction is expected to be used rarely, such as on the roll-over of an ASID or VMID, but should not be used on every context switch.</para></note>
      </purpose_text>

        </reg_purpose>

      <reg_groups>
            <reg_group>TLB</reg_group>
      </reg_groups>
      
      
        
      <reg_attributes>
          
    
      <attributes_text>
        <para>COSPRCTX is a 32-bit System instruction.</para>
      </attributes_text>

      </reg_attributes>
      <reg_fieldsets>
        






<fields id="fieldset_0" length="32">
  <text_before_fields/>
  <field id="fieldset_0-31_28" has_partial_fieldset="False" is_linked_to_partial_fieldset="False" is_access_restriction_possible="False" is_variable_length="False" is_constant_value="False" is_partial_field="False" is_conditional_field_name="False" rwtype="RES0">
    <field_msb>31</field_msb>
    <field_lsb>28</field_lsb>
    <rel_range>31:28</rel_range>
    <field_description order="before"/>
    <field_description order="before">
      <para>Reserved, <arm-defined-word>RES0</arm-defined-word>.</para>
    </field_description>
  </field>
  <field id="fieldset_0-27_27" has_partial_fieldset="False" is_linked_to_partial_fieldset="False" is_access_restriction_possible="False" is_variable_length="False" is_constant_value="False" is_partial_field="False" is_conditional_field_name="False">
    <field_name>GVMID</field_name>
    <field_msb>27</field_msb>
    <field_lsb>27</field_lsb>
    <rel_range>27</rel_range>
    <field_description order="before">
      <para>Execution of this instruction applies to all VMIDs or a specified VMID.</para>
    </field_description>
    <field_description order="after"><para>For target execution contexts other than EL0 or EL1, this field is <arm-defined-word>RES0</arm-defined-word>.</para>
<para>If the instruction is executed at EL0 or EL1, then this field has an Effective value of 0.</para>
<para>If EL2 is not implemented or not enabled for the target Security state, this field is <arm-defined-word>RES0</arm-defined-word>.</para></field_description>
    <field_values impdef="False">
      <field_value_instance>
        <field_value>0b0</field_value>
        <field_value_description>
          <para>Applies to specified VMID for an EL0 or EL1 target execution context.</para>
        </field_value_description>
      </field_value_instance>
      <field_value_instance>
        <field_value>0b1</field_value>
        <field_value_description>
          <para>Applies to all VMIDs for an EL0 or EL1 target execution context.</para>
        </field_value_description>
      </field_value_instance>
    </field_values>
  </field>
  <field id="fieldset_0-26_26" has_partial_fieldset="False" is_linked_to_partial_fieldset="False" is_access_restriction_possible="False" is_variable_length="False" is_constant_value="False" is_partial_field="False" is_conditional_field_name="False">
    <field_name>NS</field_name>
    <field_msb>26</field_msb>
    <field_lsb>26</field_lsb>
    <rel_range>26</rel_range>
    <field_description order="before">
      <para>Security State.</para>
    </field_description>
    <field_description order="after">
      <para>If the instruction is executed in Non-secure state, this field is treated as 1.</para>
    </field_description>
    <field_values impdef="False">
      <field_value_instance>
        <field_value>0b0</field_value>
        <field_value_description>
          <para>Secure state.</para>
        </field_value_description>
      </field_value_instance>
      <field_value_instance>
        <field_value>0b1</field_value>
        <field_value_description>
          <para>Non-secure state.</para>
        </field_value_description>
      </field_value_instance>
    </field_values>
  </field>
  <field id="fieldset_0-25_24" has_partial_fieldset="False" is_linked_to_partial_fieldset="False" is_access_restriction_possible="False" is_variable_length="False" is_constant_value="False" is_partial_field="False" is_conditional_field_name="False">
    <field_name>EL</field_name>
    <field_msb>25</field_msb>
    <field_lsb>24</field_lsb>
    <rel_range>25:24</rel_range>
    <field_description order="before">
      <para>Exception Level. Indicates the Exception level of the target execution context.</para>
    </field_description>
    <field_description order="after">
      <para>If the instruction is executed at an Exception level lower than the specified level, or is specified to apply to a combination of Exception level and Security state that is not implemented, this instruction is treated as a NOP.</para>
    </field_description>
    <field_values impdef="False">
      <field_value_instance>
        <field_value>0b00</field_value>
        <field_value_description>
          <para>EL0.</para>
        </field_value_description>
      </field_value_instance>
      <field_value_instance>
        <field_value>0b01</field_value>
        <field_value_description>
          <para>EL1</para>
        </field_value_description>
      </field_value_instance>
      <field_value_instance>
        <field_value>0b10</field_value>
        <field_value_description>
          <para>EL2</para>
        </field_value_description>
        <field_value_condition>When FEAT_EL2 is implemented</field_value_condition>
      </field_value_instance>
      <field_value_instance>
        <field_value>0b11</field_value>
        <field_value_description>
          <para>EL3</para>
        </field_value_description>
        <field_value_condition>When FEAT_EL3 is implemented</field_value_condition>
      </field_value_instance>
    </field_values>
  </field>
  <field id="fieldset_0-23_16" has_partial_fieldset="False" is_linked_to_partial_fieldset="False" is_access_restriction_possible="False" is_variable_length="False" is_constant_value="False" is_partial_field="False" is_conditional_field_name="False">
    <field_name>VMID</field_name>
    <field_msb>23</field_msb>
    <field_lsb>16</field_lsb>
    <rel_range>23:16</rel_range>
    <field_description order="before"><para>Only applies when bit[27] is 0 and the target execution context is either:</para>
<list type="unordered">
<listitem><content>EL1.</content>
</listitem><listitem><content>EL0 when EL2 is using AArch32 or the Effective value of <register_link state="AArch64" id="AArch64-hcr_el2.xml">HCR_EL2</register_link>.{E2H, TGE} is not {1, 1}.</content>
</listitem></list>
<para>Otherwise this field is <arm-defined-word>RES0</arm-defined-word>.</para>
<para>When the instruction is executed at EL1, this field is treated as the current VMID.</para>
<para>When the instruction is executed at EL0, this field is treated as the current VMID if any of the following are true:</para>
<list type="unordered">
<listitem><content>EL2 is using AArch32.</content>
</listitem><listitem><content>The Effective value of <register_link state="AArch64" id="AArch64-hcr_el2.xml">HCR_EL2</register_link>.{E2H, TGE} is not {1, 1}.</content>
</listitem></list>
<para>When the instruction is executed at EL0 and the Effective value of <register_link state="AArch64" id="AArch64-hcr_el2.xml">HCR_EL2</register_link>.{E2H, TGE} is {1, 1}, this field is ignored.</para>
<para>If EL2 is not implemented or not enabled for the target Security state, this field is <arm-defined-word>RES0</arm-defined-word>.</para></field_description>
  </field>
  <field id="fieldset_0-15_9" has_partial_fieldset="False" is_linked_to_partial_fieldset="False" is_access_restriction_possible="False" is_variable_length="False" is_constant_value="False" is_partial_field="False" is_conditional_field_name="False" rwtype="RES0">
    <field_msb>15</field_msb>
    <field_lsb>9</field_lsb>
    <rel_range>15:9</rel_range>
    <field_description order="before"/>
    <field_description order="before">
      <para>Reserved, <arm-defined-word>RES0</arm-defined-word>.</para>
    </field_description>
  </field>
  <field id="fieldset_0-8_8" has_partial_fieldset="False" is_linked_to_partial_fieldset="False" is_access_restriction_possible="False" is_variable_length="False" is_constant_value="False" is_partial_field="False" is_conditional_field_name="False">
    <field_name>GASID</field_name>
    <field_msb>8</field_msb>
    <field_lsb>8</field_lsb>
    <rel_range>8</rel_range>
    <field_description order="before">
      <para>Execution of this instruction applies to all ASIDs, or a specified ASID.</para>
    </field_description>
    <field_description order="after"><para>For target execution contexts other than EL0, this field is <arm-defined-word>RES0</arm-defined-word>.</para>
<para>If the instruction is executed at EL0, this field has an Effective value of 0.</para></field_description>
    <field_values impdef="False">
      <field_value_instance>
        <field_value>0b0</field_value>
        <field_value_description>
          <para>Applies to specified ASID for an EL0 target execution context.</para>
        </field_value_description>
      </field_value_instance>
      <field_value_instance>
        <field_value>0b1</field_value>
        <field_value_description>
          <para>Applies to all ASIDs for an EL0 target execution context.</para>
        </field_value_description>
      </field_value_instance>
    </field_values>
  </field>
  <field id="fieldset_0-7_0" has_partial_fieldset="False" is_linked_to_partial_fieldset="False" is_access_restriction_possible="False" is_variable_length="False" is_constant_value="False" is_partial_field="False" is_conditional_field_name="False">
    <field_name>ASID</field_name>
    <field_msb>7</field_msb>
    <field_lsb>0</field_lsb>
    <rel_range>7:0</rel_range>
    <field_description order="before"><para>Only applies to an EL0 target execution context and when bit[8] is 0.</para>
<para>Otherwise, this field is <arm-defined-word>RES0</arm-defined-word>.</para>
<para>When the instruction is executed at EL0, this field is treated as the current ASID.</para></field_description>
  </field>
  <text_after_fields/>
</fields>




<reg_fieldset length="32">
  <fieldat id="fieldset_0-31_28" msb="31" lsb="28"/>
  <fieldat id="fieldset_0-27_27" msb="27" lsb="27"/>
  <fieldat id="fieldset_0-26_26" msb="26" lsb="26"/>
  <fieldat id="fieldset_0-25_24" msb="25" lsb="24"/>
  <fieldat id="fieldset_0-23_16" msb="23" lsb="16"/>
  <fieldat id="fieldset_0-15_9" msb="15" lsb="9"/>
  <fieldat id="fieldset_0-8_8" msb="8" lsb="8"/>
  <fieldat id="fieldset_0-7_0" msb="7" lsb="0"/>
</reg_fieldset>


      </reg_fieldsets>

      <access_mechanisms>
          






    
        
        <access_mechanism accessor="MCR COSPRCTX" type="SystemAccessor">
            <encoding>
            <access_instruction>MCR{&lt;c&gt;}{&lt;q&gt;} &lt;coproc&gt;, {#}&lt;opc1&gt;, &lt;Rt&gt;, &lt;CRn&gt;, &lt;CRm&gt;{, {#}&lt;opc2&gt;}</access_instruction>
                
                <enc n="coproc" v="0b1111"/>
                
                <enc n="opc1" v="0b000"/>
                
                <enc n="CRn" v="0b0111"/>
                
                <enc n="CRm" v="0b0011"/>
                
                <enc n="opc2" v="0b110"/>
            </encoding>
            <access_permission>
                <ps name="MCR" sections="1" secttype="access_permission">
                <pstext>
if !(IsFeatureImplemented(FEAT_AA32) &amp;&amp; IsFeatureImplemented(FEAT_SPECRES2)) then
    Undefined();
elsif PSTATE.EL == EL0 then
    if IsFeatureImplemented(FEAT_AA64EL1) &amp;&amp; !ELUsingAArch32(EL1) &amp;&amp; !ELIsInHost(EL0) &amp;&amp; SCTLR_EL1().EnRCTX == '0' then
        if EL2Enabled() &amp;&amp; (IsFeatureImplemented(FEAT_AA64EL2) &amp;&amp; !ELUsingAArch32(EL2)) &amp;&amp; HCR_EL2().TGE == '1' then
            AArch64_AArch32SystemAccessTrap(EL2, 0x03);
        else
            AArch64_AArch32SystemAccessTrap(EL1, 0x03);
        end;
    elsif IsFeatureImplemented(FEAT_AA32EL1) &amp;&amp; ELUsingAArch32(EL1) &amp;&amp; SCTLR().EnRCTX == '0' then
        if EL2Enabled() &amp;&amp; (IsFeatureImplemented(FEAT_AA64EL2) &amp;&amp; !ELUsingAArch32(EL2)) &amp;&amp; HCR_EL2().TGE == '1' then
            AArch64_AArch32SystemAccessTrap(EL2, 0x03);
        elsif EL2Enabled() &amp;&amp; (IsFeatureImplemented(FEAT_AA32EL2) &amp;&amp; ELUsingAArch32(EL2)) &amp;&amp; HCR().TGE == '1' then
            AArch32_TakeHypTrapException(0x00);
        else
            Undefined();
        end;
    elsif EL2Enabled() &amp;&amp; (IsFeatureImplemented(FEAT_AA64EL2) &amp;&amp; !ELUsingAArch32(EL2)) &amp;&amp; !ELIsInHost(EL0) &amp;&amp; HSTR_EL2().T7 == '1' then
        AArch64_AArch32SystemAccessTrap(EL2, 0x03);
    elsif EL2Enabled() &amp;&amp; (IsFeatureImplemented(FEAT_AA32EL2) &amp;&amp; ELUsingAArch32(EL2)) &amp;&amp; HSTR().T7 == '1' then
        AArch32_TakeHypTrapException(0x03);
    elsif EL2Enabled() &amp;&amp; (IsFeatureImplemented(FEAT_AA64EL1) &amp;&amp; !ELUsingAArch32(EL1)) &amp;&amp; !ELIsInHost(EL0) &amp;&amp; IsFeatureImplemented(FEAT_FGT) &amp;&amp; (!HaveEL(EL3) || SCR_EL3().FGTEn == '1') &amp;&amp; HFGITR_EL2().COSPRCTX == '1' then
        AArch64_AArch32SystemAccessTrap(EL2, 0x03);
    elsif ELIsInHost(EL0) &amp;&amp; SCTLR_EL2().EnRCTX == '0' then
        AArch64_AArch32SystemAccessTrap(EL2, 0x03);
    else
        AArch32_RestrictPrediction(R(t), RestrictType_Other);
    end;
elsif PSTATE.EL == EL1 then
    if EL2Enabled() &amp;&amp; IsFeatureImplemented(FEAT_AA64EL2) &amp;&amp; !ELUsingAArch32(EL2) &amp;&amp; HSTR_EL2().T7 == '1' then
        AArch64_AArch32SystemAccessTrap(EL2, 0x03);
    elsif EL2Enabled() &amp;&amp; IsFeatureImplemented(FEAT_AA32EL2) &amp;&amp; ELUsingAArch32(EL2) &amp;&amp; HSTR().T7 == '1' then
        AArch32_TakeHypTrapException(0x03);
    else
        AArch32_RestrictPrediction(R(t), RestrictType_Other);
    end;
elsif PSTATE.EL == EL2 then
    AArch32_RestrictPrediction(R(t), RestrictType_Other);
elsif PSTATE.EL == EL3 then
    AArch32_RestrictPrediction(R(t), RestrictType_Other);
end;
                </pstext>
                </ps>
            </access_permission>
        </access_mechanism>

      </access_mechanisms>

      <arch_variants>
      </arch_variants>
  </register>
</registers>
<timestamp>2026-03-26 20:27:25</timestamp>
<commit_id>2026-03_rel</commit_id>
</register_page>