DSB

Branches, exception generating and system instructions

fixed bit field field the encoding fixes should be

System barriers dsb

313029282726252423222120191817161514131211109876543210
11010101000000110011CRm10011111
opc

11010101000000110011xxxx10011111

Decode Sail

let nXS : bool = false;
alias : DSBAlias = undefined;
match CRm {
  0b0000 => {
      alias = DSBAlias_SSBB
  },
  0b0100 => {
      alias = DSBAlias_PSSBB
  },
  _ => {
      alias = DSBAlias_DSB
  }
};
let alias = alias;
domain : MBReqDomain = undefined;
match CRm[3 .. 2] {
  0b00 => {
      domain = MBReqDomain_OuterShareable
  },
  0b01 => {
      domain = MBReqDomain_Nonshareable
  },
  0b10 => {
      domain = MBReqDomain_InnerShareable
  },
  0b11 => {
      domain = MBReqDomain_FullSystem
  }
};
types : MBReqTypes = undefined;
match CRm[1 .. 0] {
  0b00 => {
      types = MBReqTypes_All;
      domain = MBReqDomain_FullSystem
  },
  0b01 => {
      types = MBReqTypes_Reads
  },
  0b10 => {
      types = MBReqTypes_Writes
  },
  0b11 => {
      types = MBReqTypes_All
  }
};
execute_aarch64_instrs_system_barriers_dsb(alias, domain, nXS, types)

System barriers dsb nxs

313029282726252423222120191817161514131211109876543210
11010101000000110011imm21000111111

11010101000000110011xx1000111111

Decode

The Sail has no decode_dsb_aarch64_instrs_system_barriers_dsb_nxs: ScarletNX's extract of sail-arm keeps what its roots reach, and none reaches it.

Operation Sail

nXS : bool = nXS__arg;
match alias {
  DSBAlias_SSBB => {
      SpeculativeStoreBypassBarrierToVA()
  },
  DSBAlias_PSSBB => {
      SpeculativeStoreBypassBarrierToPA()
  },
  DSBAlias_DSB => {
      if HaveTME() & TSTATE.depth > 0 then {
          FailTransaction(TMFailure_ERR, false)
      };
      if not_bool(nXS) & HaveFeatXS() then {
          nXS = ((PSTATE.EL == EL0 | PSTATE.EL == EL1) & IsHCRXEL2Enabled()) & HCRX_EL2[FnXS] == 0b1
      };
      DataSynchronizationBarrier(domain, types, nXS)
  },
  _ => {
      Unreachable()
  }
}

Made from ScarletNX's Sail at 166ad3910f80. sail-arm's definitions are Arm's ASL in Sail (BSD 3-Clause Clear, license); ScarletNX's fixups are GPL-3.0-or-later.