MSR (immediate)

Move immediate value to Special Register moves an immediate value to selected bits of the PSTATE. For more information, see Process state, PSTATE.

The bits that can be written by this instruction are:

This instruction is used by the aliases SMSTART, and SMSTOP.

313029282726252423222120191817161514131211109876543210
1101010100000op10100CRmop211111

MSR <pstatefield>, #<imm>

if op1 == '000' && op2 == '000' then SEE "CFINV"; if op1 == '000' && op2 == '001' then SEE "XAFLAG"; if op1 == '000' && op2 == '010' then SEE "AXFLAG"; AArch64.CheckSystemAccess('00', op1, '0100', CRm, op2, '11111', '0'); bits(2) min_EL; boolean need_secure = FALSE; case op1 of when '00x' min_EL = EL1; when '010' min_EL = EL1; when '011' min_EL = EL0; when '100' min_EL = EL2; when '101' if !HaveVirtHostExt() then UNDEFINED; min_EL = EL2; when '110' min_EL = EL3; when '111' min_EL = EL1; need_secure = TRUE; if UInt(PSTATE.EL) < UInt(min_EL) || (need_secure && !IsSecure()) then UNDEFINED; bits(4) operand = CRm; PSTATEField field; case op1:op2 of when '000 011' if !HaveUAOExt() then UNDEFINED; field = PSTATEField_UAO; when '000 100' if !HavePANExt() then UNDEFINED; field = PSTATEField_PAN; when '000 101' field = PSTATEField_SP; when '001 000' if !HaveFeatNMI() then UNDEFINED; if CRm<3:1> != '000' then UNDEFINED; field = PSTATEField_ALLINT; when '011 010' if !HaveDITExt() then UNDEFINED; field = PSTATEField_DIT; when '011 011' case CRm of when '001x' if !HaveSME() then UNDEFINED; field = PSTATEField_SVCRSM; when '010x' if !HaveSME() then UNDEFINED; field = PSTATEField_SVCRZA; when '011x' if !HaveSME() then UNDEFINED; field = PSTATEField_SVCRSMZA; otherwise UNDEFINED; when '011 100' if !HaveMTEExt() then UNDEFINED; field = PSTATEField_TCO; when '011 110' field = PSTATEField_DAIFSet; when '011 111' field = PSTATEField_DAIFClr; when '011 001' if !HaveSSBSExt() then UNDEFINED; field = PSTATEField_SSBS; otherwise UNDEFINED; // Check that an AArch64 MSR/MRS access to the DAIF flags is permitted if PSTATE.EL == EL0 && field IN {PSTATEField_DAIFSet, PSTATEField_DAIFClr} then if !ELUsingAArch32(EL1) && ((EL2Enabled() && HCR_EL2.<E2H,TGE> == '11') || SCTLR_EL1.UMA == '0') then if EL2Enabled() && !ELUsingAArch32(EL2) && HCR_EL2.TGE == '1' then AArch64.SystemAccessTrap(EL2, 0x18); else AArch64.SystemAccessTrap(EL1, 0x18);

Assembler Symbols

<pstatefield>

Is a PSTATE field name. For the MSR instruction, this is encoded in op1:op2:CRm:

op1 op2 CRm <pstatefield> Architectural Feature
000 00x xxxx SEE PSTATE -
000 010 xxxx SEE PSTATE -
000 011 xxxx UAO FEAT_UAO
000 100 xxxx PAN FEAT_PAN
000 101 xxxx SPSel -
000 11x xxxx RESERVED -
001 000 000x ALLINT FEAT_NMI
001 000 001x RESERVED -
001 000 01xx RESERVED -
001 000 1xxx RESERVED -
001 001 xxxx RESERVED -
001 01x xxxx RESERVED -
001 1xx xxxx RESERVED -
010 xxx xxxx RESERVED -
011 000 xxxx RESERVED -
011 001 xxxx SSBS FEAT_SSBS
011 010 xxxx DIT FEAT_DIT
011 011 000x RESERVED -
011 011 001x SVCRSM FEAT_SME
011 011 010x SVCRZA FEAT_SME
011 011 011x SVCRSMZA FEAT_SME
011 011 1xxx RESERVED -
011 100 xxxx TCO FEAT_MTE
011 101 xxxx RESERVED -
011 110 xxxx DAIFSet -
011 111 xxxx DAIFClr -
1xx xxx xxxx RESERVED -
For the SMSTART and SMSTOP aliases, this is encoded in "CRm<2:1>", where 0b01 specifies SVCRSM, 0b10 specifies SVCRZA, and 0b11 specifies SVCRSMZA.
<imm>

Is a 4-bit unsigned immediate, in the range 0 to 15, encoded in the "CRm" field. Restricted to the range 0 to 1, encoded in "CRm<0>", when <pstatefield> is ALLINT, SVCRSM, SVCRSMZA, or SVCRZA.

Alias Conditions

AliasIs preferred when
SMSTARTop1 == '011' && CRm == '0xx1' && op2 == '011'
SMSTOPop1 == '011' && CRm == '0xx0' && op2 == '011'

Operation

case field of when PSTATEField_SSBS PSTATE.SSBS = operand<0>; when PSTATEField_SP PSTATE.SP = operand<0>; when PSTATEField_DAIFSet PSTATE.D = PSTATE.D OR operand<3>; PSTATE.A = PSTATE.A OR operand<2>; PSTATE.I = PSTATE.I OR operand<1>; PSTATE.F = PSTATE.F OR operand<0>; when PSTATEField_DAIFClr PSTATE.D = PSTATE.D AND NOT(operand<3>); PSTATE.A = PSTATE.A AND NOT(operand<2>); PSTATE.I = PSTATE.I AND NOT(operand<1>); PSTATE.F = PSTATE.F AND NOT(operand<0>); when PSTATEField_PAN PSTATE.PAN = operand<0>; when PSTATEField_UAO PSTATE.UAO = operand<0>; when PSTATEField_DIT PSTATE.DIT = operand<0>; when PSTATEField_TCO PSTATE.TCO = operand<0>; when PSTATEField_ALLINT if (PSTATE.EL == EL1 && IsHCRXEL2Enabled() && HCRX_EL2.TALLINT == '1' && operand<0> == '1') then AArch64.SystemAccessTrap(EL2, 0x18); PSTATE.ALLINT = operand<0>; when PSTATEField_SVCRSM CheckSMEAccess(); SetPSTATE_SM(operand<0>); when PSTATEField_SVCRZA CheckSMEAccess(); SetPSTATE_ZA(operand<0>); when PSTATEField_SVCRSMZA CheckSMEAccess(); SetPSTATE_SM(operand<0>); SetPSTATE_ZA(operand<0>);


Internal version only: isa v33.11seprel, AdvSIMD v29.05, pseudocode v2021-09_rel, sve v2021-09_rc3d ; Build timestamp: 2021-10-06T11:41

Copyright © 2010-2021 Arm Limited or its affiliates. All rights reserved. This document is Non-Confidential.