Skip to content

Commit 456be42

Browse files
author
Alexander Gordeev
committed
s390/mm: get rid of VMEM_MAX_PHYS macro
VMEM_MAX_PHYS is supposed to be the highest physical address that can be added to the identity mapping. It should match ident_map_size, which has the same meaning. However, unlike ident_map_size it is not adjusted against various limiting factors (see the comment to setup_ident_map_size() function). That renders all checks against VMEM_MAX_PHYS invalid. Further, VMEM_MAX_PHYS is currently set to vmemmap, which is an address in virtual memory space. However, it gets compared against physical addresses in various locations. That works, because both address spaces are the same on s390, but otherwise it is wrong. Instead of fixing VMEM_MAX_PHYS misuse and semantics just remove it. Acked-by: Heiko Carstens <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent 6a46676 commit 456be42

File tree

5 files changed

+5
-8
lines changed

5 files changed

+5
-8
lines changed

arch/s390/boot/startup.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ static unsigned long setup_kernel_memory_layout(void)
220220
pages = SECTION_ALIGN_UP(pages);
221221
/* keep vmemmap_start aligned to a top level region table entry */
222222
vmemmap_start = round_down(VMALLOC_START - pages * sizeof(struct page), rte_size);
223-
/* vmemmap_start is the future VMEM_MAX_PHYS, make sure it is within MAX_PHYSMEM */
224223
vmemmap_start = min(vmemmap_start, 1UL << MAX_PHYSMEM_BITS);
225224
/* make sure identity map doesn't overlay with vmemmap */
226225
ident_map_size = min(ident_map_size, vmemmap_start);

arch/s390/include/asm/pgtable.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ extern unsigned long __bootdata_preserved(VMALLOC_END);
8989
extern struct page *__bootdata_preserved(vmemmap);
9090
extern unsigned long __bootdata_preserved(vmemmap_size);
9191

92-
#define VMEM_MAX_PHYS ((unsigned long) vmemmap)
93-
9492
extern unsigned long __bootdata_preserved(MODULES_VADDR);
9593
extern unsigned long __bootdata_preserved(MODULES_END);
9694
#define MODULES_VADDR MODULES_VADDR

arch/s390/mm/extmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ void segment_warning(int rc, char *seg_name)
642642
break;
643643
case -ERANGE:
644644
pr_err("DCSS %s exceeds the kernel mapping range (%lu) "
645-
"and cannot be loaded\n", seg_name, VMEM_MAX_PHYS);
645+
"and cannot be loaded\n", seg_name, ident_map_size);
646646
break;
647647
default:
648648
break;

arch/s390/mm/vmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ struct range arch_get_mappable_range(void)
529529
struct range mhp_range;
530530

531531
mhp_range.start = 0;
532-
mhp_range.end = VMEM_MAX_PHYS - 1;
532+
mhp_range.end = ident_map_size - 1;
533533
return mhp_range;
534534
}
535535

drivers/s390/char/sclp_cmd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,10 @@ static void __init add_memory_merged(u16 rn)
392392
goto skip_add;
393393
start = rn2addr(first_rn);
394394
size = (unsigned long long) num * sclp.rzm;
395-
if (start >= VMEM_MAX_PHYS)
395+
if (start >= ident_map_size)
396396
goto skip_add;
397-
if (start + size > VMEM_MAX_PHYS)
398-
size = VMEM_MAX_PHYS - start;
397+
if (start + size > ident_map_size)
398+
size = ident_map_size - start;
399399
if (start >= ident_map_size)
400400
goto skip_add;
401401
if (start + size > ident_map_size)

0 commit comments

Comments
 (0)