xen/arm: Avoid overflow using MIDR_IMPLEMENTOR_MASK
authorMichal Orzel <michal.orzel@arm.com>
Thu, 5 May 2022 11:59:06 +0000 (13:59 +0200)
committerStefano Stabellini <stefano.stabellini@amd.com>
Wed, 3 Aug 2022 21:57:43 +0000 (14:57 -0700)
commit048185188fbae9d0e7d25992d8318be2a4a5a2cc
treed7259b5caa9320420a9866a18204f3b32f2f8564
parentfe02a5342d3ef372ac8eea12dcdbdf3ff7c47379
xen/arm: Avoid overflow using MIDR_IMPLEMENTOR_MASK

Value of macro MIDR_IMPLEMENTOR_MASK exceeds the range of integer
and can lead to overflow. Currently there is no issue as it is used
in an expression implicitly casted to u32 in MIDR_IS_CPU_MODEL_RANGE.
To avoid possible problems, fix the macro.

Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Link: https://lore.kernel.org/r/20220426070603.56031-1-michal.orzel@arm.com
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
(cherry picked from commit aa1cba100bff84b211f27639bd6efeaf7e701bcc)
xen/include/asm-arm/processor.h