Thread (3 messages) 3 messages, 2 authors, 28d ago

Re: [PATCH v2] powerpc/fadump: define MIN_RMA in bytes value to fix overflow

From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Date: 2026-06-15 09:44:46
Also in: lkml

Sayali Patil [off-list ref] writes:
The MIN_RMA size checks in fadump_setup_param_area() use
(MIN_RMA * 1024 * 1024), which is evaluated in int and can
overflow when MIN_RMA is increased to values such as SZ_2G.
This triggers compiler warnings such as:

warning: integer overflow in expression of type 'int'
results in '0' [-Woverflow]

Define MIN_RMA directly in bytes using SZ_1M and update the
callers accordingly. This avoids repeated unit conversions and
prevents integer overflow.

Also convert MIN_RMA back to MB when populating the firmware
architecture vector, since firmware expects the value in MB.

Fixes: b7bb46062457 ("powerpc/fadump: fix additional param memory reservation for HASH MMU")
Since this is not a bug per-se, so we need not add a Fixes tag.
But while we are at it, we may correct the commit subject to...

    powerpc/fadump: Define MIN_RMA in bytes rather than MB

... since there is no overflow with it's current value.

With the above changes in place, feel free to add:
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help