summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2023-07-04 08:46:26 +0300
committerAlexander Gordeev <agordeev@linux.ibm.com>2023-07-04 08:46:26 +0300
commit54372cf043276735e29045abf998895b2ac277cf (patch)
treeeed37120a84e3b2f45b89a2a51b264716ff35d16 /drivers
parent6aca56c024e42577c28706a85979a6967b9b5e97 (diff)
downloadlinux-54372cf043276735e29045abf998895b2ac277cf.tar.xz
Revert "s390/mm: get rid of VMEM_MAX_PHYS macro"
This reverts commit 456be42aa713e7f83b467db66ceae779431c7d9d. The assumption VMEM_MAX_PHYS should match ident_map_size is wrong. At least discontiguous saved segments (DCSS) could be loaded at addresses beyond ident_map_size and dcssblk device driver might fail as result. Reported-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/s390/char/sclp_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c
index 594b34cf1c2b..3c87057436d5 100644
--- a/drivers/s390/char/sclp_cmd.c
+++ b/drivers/s390/char/sclp_cmd.c
@@ -392,10 +392,10 @@ static void __init add_memory_merged(u16 rn)
goto skip_add;
start = rn2addr(first_rn);
size = (unsigned long long) num * sclp.rzm;
- if (start >= ident_map_size)
+ if (start >= VMEM_MAX_PHYS)
goto skip_add;
- if (start + size > ident_map_size)
- size = ident_map_size - start;
+ if (start + size > VMEM_MAX_PHYS)
+ size = VMEM_MAX_PHYS - start;
if (start >= ident_map_size)
goto skip_add;
if (start + size > ident_map_size)