diff options
| author | D Scott Phillips <[email protected]> | 2022-11-02 16:01:06 +0000 |
|---|---|---|
| committer | Catalin Marinas <[email protected]> | 2022-11-09 09:51:39 +0000 |
| commit | 8ec8490a1950efeccb00967698cf7cb2fcd25ca7 (patch) | |
| tree | 173c2eee88787a3f9337343bed02892316fd01d7 /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
| parent | arm64: fix rodata=full again (diff) | |
| download | kernel-8ec8490a1950efeccb00967698cf7cb2fcd25ca7.tar.gz kernel-8ec8490a1950efeccb00967698cf7cb2fcd25ca7.zip | |
arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro
CONFIG_UBSAN_SHIFT with gcc-5 complains that the shifting of
ARM_CPU_IMP_AMPERE (0xC0) into bits [31:24] by MIDR_CPU_MODEL() is
undefined behavior. Well, sort of, it actually spells the error as:
arch/arm64/kernel/proton-pack.c: In function 'spectre_bhb_loop_affected':
arch/arm64/include/asm/cputype.h:44:2: error: initializer element is not constant
(((imp) << MIDR_IMPLEMENTOR_SHIFT) | \
^
This isn't an issue for other Implementor codes, as all the other codes
have zero in the top bit and so are representable as a signed int.
Cast the implementor code to unsigned in MIDR_CPU_MODEL to remove the
undefined behavior.
Fixes: 0e5d5ae837c8 ("arm64: Add AMPERE1 to the Spectre-BHB affected list")
Reported-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: D Scott Phillips <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Catalin Marinas <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
0 files changed, 0 insertions, 0 deletions
