• Suzuki K. Poulose's avatar
    arm64: Generalise msr_s/mrs_s operations · 9ded63aa
    Suzuki K. Poulose authored
    The system register encoding generated by sys_reg() works only
    for MRS/MSR(Register) operations, as we hardcode Bit20 to 1 in
    mrs_s/msr_s mask. This makes it unusable for generating instructions
    accessing registers with Op0 < 2(e.g, PSTATE.x with Op0=0).
    
    As per ARMv8 ARM, (Ref: ARMv8 ARM, Section: "System instruction class
    encoding overview", C5.2, version:ARM DDI 0487A.f), the instruction
    encoding reserves bits [20-19] for Op0.
    
    This patch generalises the sys_reg, mrs_s and msr_s macros, so that
    we could use them to access any of the supported system register.
    
    Cc: James Morse <james.morse@arm.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: default avatarSuzuki K. Poulose <suzuki.poulose@arm.com>
    Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    9ded63aa
sysreg.h 2.11 KB