• Mark Rutland's avatar
    arm64: ensure __raw_read_system_reg() is self-consistent · 965861d6
    Mark Rutland authored
    We recently discovered that __raw_read_system_reg() erroneously mapped
    sysreg IDs to the wrong registers.
    
    To ensure that we don't get hit by a similar issue in future, this patch
    makes __raw_read_system_reg() use a macro for each case statement,
    ensuring that each case reads the correct register.
    
    To ensure that this patch hasn't introduced an issue, I've binary-diffed
    the object files before and after this patch. No code or data sections
    differ (though some debug section differ due to line numbering
    changing).
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
    Cc: Will Deacon <will.deacon@arm.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    965861d6
cpufeature.c 39.3 KB