qemu-cr16/target/ppc/translate
Denis Sergeev 6c51df580d
target/ppc: use MAKE_64BIT_MASK for mcrfs exception clear mask
In gen_mcrfs() the FPSCR nibble mask is computed as:
      `~((0xF << shift) & FP_EX_CLEAR_BITS)`

Here, 0xF is of type int, so the left shift is performed in
32-bit signed arithmetic. For bfa=0 we get shift=28,
and (0xF << 28) = 0xF0000000, which is not representable as a 32-bit
signed int. Static analyzers flag this as a potential integer
overflow.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Denis Sergeev <zeff@altlinux.org>
Reviewed-by: Chinmay Rath <rathc@linux.ibm.com>
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Link: https://lore.kernel.org/r/20250915080118.29898-1-zeff@altlinux.org
Message-ID: <20250915080118.29898-1-zeff@altlinux.org>
2025-09-28 23:50:36 +05:30
..
bhrb-impl.c.inc target/ppc: Add clrbhrb and mfbhrbe instructions 2024-05-24 09:33:32 +10:00
branch-impl.c.inc target/ppc: Add recording of taken branches to BHRB 2024-05-24 09:33:06 +10:00
dfp-impl.c.inc tcg: Rename cpu_env to tcg_env 2023-10-03 08:01:02 -07:00
fixedpoint-impl.c.inc target/ppc: Move logical fixed-point instructions to decodetree. 2024-05-24 08:57:50 +10:00
fp-impl.c.inc target/ppc: use MAKE_64BIT_MASK for mcrfs exception clear mask 2025-09-28 23:50:36 +05:30
fp-ops.c.inc target/ppc: Move remaining floating-point move instructions to decodetree. 2025-09-28 23:47:37 +05:30
misc-impl.c.inc target/ppc: Implement attn instruction on BookS 64-bit processors 2024-05-24 09:34:38 +10:00
ppe-impl.c.inc target/ppc: Add IBM PPE42 special instructions 2025-09-28 23:36:13 +05:30
processor-ctrl-impl.c.inc target/ppc: add SMT support to msgsnd broadcast 2024-05-24 09:34:41 +10:00
spe-impl.c.inc tcg: Rename cpu_env to tcg_env 2023-10-03 08:01:02 -07:00
spe-ops.c.inc meson: rename included C source files to .c.inc 2020-08-21 06:18:30 -04:00
storage-ctrl-impl.c.inc target/ppc: Fix broadcast tlbie synchronisation 2024-05-24 08:57:50 +10:00
vmx-impl.c.inc target/ppc: Fix facility interrupt checks for VSX 2025-03-21 13:54:35 +10:00
vmx-ops.c.inc target/ppc: Move VMX integer add/sub saturate insns to decodetree. 2024-07-26 09:51:33 +10:00
vsx-impl.c.inc target/ppc: Fix facility interrupt checks for VSX 2025-03-21 13:54:35 +10:00
vsx-ops.c.inc target/ppc: Move VSX fp compare insns to decodetree. 2024-07-26 09:51:33 +10:00