linux-stable/include/vdso
Arnd Bergmann d4a65302dd vdso: Change PAGE_MASK to signed on all 32-bit architectures
With the introduction of an architecture-independent defintion of
PAGE_MASK, we had to make a choice between defining it as 'unsigned long'
as on 64-bit architectures, or as signed 'long' as required for
architectures with a 64-bit phys_addr_t.

To reduce the risk for regressions and minimize the changes in behavior,
the result was using the signed value only when CONFIG_PHYS_ADDR_T_64BIT
is set, but that ended up causing a regression after all in the
early_init_dt_add_memory_arch() function that uses 64-bit integers for
address calculation.

Presumably the same regression also affects mips32 and powerpc32 when
dealing with large amounts of memory on DT platforms: like arm32, they were
using the signed version unconditionally.

The two most sensible options for addressing the regression are either to
go back to an architecture specific definition, using a signed constant on
arm/powerpc/mips and unsigned on the others, or to use the same definition
everywhere.

Use the simpler of those two and change them all to the signed version, in
the hope that this does not cause a different type of bug. Most of the
other 32-bit architectures have no large physical address support and are
rarely used, so it seems more likely that using the same definition helps
than hurts here.

In particular, x86-32 does have physical addressing extensions, so it
already changed to the signed version after the previous patch, so it makes
sense to use the same version on non-PAE as well.

Fixes: efe8419ae7 ("vdso: Introduce vdso/page.h")
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Anders Roxell <anders.roxell@linaro.org>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/all/20241024133447.3117273-1-arnd@kernel.org
Link: https://lore.kernel.org/lkml/CA+G9fYt86bUAu_v5dXPWnDUwQNVipj+Wq3Djir1KUSKdr9QLNg@mail.gmail.com/
2024-10-28 16:56:15 +01:00
..
bits.h vdso/bits.h: Add BIT_ULL() for the sake of consistency 2023-01-31 14:42:10 +01:00
clocksource.h vdso: Fix clocksource.h macro detection 2020-03-23 18:51:08 +01:00
const.h linux/const.h: Extract common header for vDSO 2020-03-21 15:23:53 +01:00
datapage.h Random number generator updates for Linux 6.11-rc1. 2024-07-24 10:29:50 -07:00
getrandom.h random: vDSO: add a __vdso_getrandom prototype for all architectures 2024-09-13 17:28:35 +02:00
gettime.h arch: vdso: consolidate gettime prototypes 2023-11-23 11:32:32 +01:00
helpers.h random: vDSO: minimize and simplify header includes 2024-09-13 17:28:35 +02:00
jiffies.h linux/jiffies.h: Extract common header for vDSO 2020-03-21 15:23:58 +01:00
ktime.h linux/ktime.h: Extract common header for vDSO 2020-03-21 15:23:59 +01:00
limits.h linux/limits.h: Extract common header for vDSO 2020-03-21 15:23:54 +01:00
math64.h vdso, math64: Provide mul_u64_u32_add_u64_shr() 2024-04-08 15:03:07 +02:00
page.h vdso: Change PAGE_MASK to signed on all 32-bit architectures 2024-10-28 16:56:15 +01:00
processor.h common: Introduce processor.h 2020-03-21 15:23:59 +01:00
time32.h linux/time32.h: Extract common header for vDSO 2020-03-21 15:23:57 +01:00
time64.h time64.h: Consolidated PSEC_PER_SEC definition 2021-04-06 16:32:17 -07:00
time.h linux/time.h: Extract common header for vDSO 2020-03-21 15:23:57 +01:00
unaligned.h random: vDSO: minimize and simplify header includes 2024-09-13 17:28:35 +02:00
vsyscall.h timekeeping/vsyscall: Provide vdso_update_begin/end() 2020-08-06 10:57:30 +02:00