Skip to content

Commit 3739534

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/mm/ptdump: Fix handling of identity mapping area
Since virtual and real addresses are not the same anymore the assumption that the kernel image is contained within the identity mapping is also not true anymore. Fix this by adding two explicit areas and at the correct locations: one for the 8kb lowcore area, and one for the identity mapping. Fixes: c98d2ec ("s390/mm: Uncouple physical vs virtual address spaces") Reviewed-by: Alexander Gordeev <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent c8e4d73 commit 3739534

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

arch/s390/mm/dump_pagetables.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ struct addr_marker {
2020
};
2121

2222
enum address_markers_idx {
23-
IDENTITY_BEFORE_NR = 0,
24-
IDENTITY_BEFORE_END_NR,
23+
LOWCORE_START_NR = 0,
24+
LOWCORE_END_NR,
2525
AMODE31_START_NR,
2626
AMODE31_END_NR,
2727
KERNEL_START_NR,
@@ -30,8 +30,8 @@ enum address_markers_idx {
3030
KFENCE_START_NR,
3131
KFENCE_END_NR,
3232
#endif
33-
IDENTITY_AFTER_NR,
34-
IDENTITY_AFTER_END_NR,
33+
IDENTITY_START_NR,
34+
IDENTITY_END_NR,
3535
VMEMMAP_NR,
3636
VMEMMAP_END_NR,
3737
VMALLOC_NR,
@@ -59,8 +59,10 @@ enum address_markers_idx {
5959
};
6060

6161
static struct addr_marker address_markers[] = {
62-
[IDENTITY_BEFORE_NR] = {0, "Identity Mapping Start"},
63-
[IDENTITY_BEFORE_END_NR] = {(unsigned long)_stext, "Identity Mapping End"},
62+
[LOWCORE_START_NR] = {0, "Lowcore Start"},
63+
[LOWCORE_END_NR] = {0, "Lowcore End"},
64+
[IDENTITY_START_NR] = {0, "Identity Mapping Start"},
65+
[IDENTITY_END_NR] = {0, "Identity Mapping End"},
6466
[AMODE31_START_NR] = {0, "Amode31 Area Start"},
6567
[AMODE31_END_NR] = {0, "Amode31 Area End"},
6668
[KERNEL_START_NR] = {(unsigned long)_stext, "Kernel Image Start"},
@@ -69,8 +71,6 @@ static struct addr_marker address_markers[] = {
6971
[KFENCE_START_NR] = {0, "KFence Pool Start"},
7072
[KFENCE_END_NR] = {0, "KFence Pool End"},
7173
#endif
72-
[IDENTITY_AFTER_NR] = {(unsigned long)_end, "Identity Mapping Start"},
73-
[IDENTITY_AFTER_END_NR] = {0, "Identity Mapping End"},
7474
[VMEMMAP_NR] = {0, "vmemmap Area Start"},
7575
[VMEMMAP_END_NR] = {0, "vmemmap Area End"},
7676
[VMALLOC_NR] = {0, "vmalloc Area Start"},
@@ -310,7 +310,10 @@ static int pt_dump_init(void)
310310
*/
311311
max_addr = (get_lowcore()->kernel_asce.val & _REGION_ENTRY_TYPE_MASK) >> 2;
312312
max_addr = 1UL << (max_addr * 11 + 31);
313-
address_markers[IDENTITY_AFTER_END_NR].start_address = ident_map_size;
313+
address_markers[LOWCORE_START_NR].start_address = 0;
314+
address_markers[LOWCORE_END_NR].start_address = sizeof(struct lowcore);
315+
address_markers[IDENTITY_START_NR].start_address = __identity_base;
316+
address_markers[IDENTITY_END_NR].start_address = __identity_base + ident_map_size;
314317
address_markers[AMODE31_START_NR].start_address = (unsigned long)__samode31;
315318
address_markers[AMODE31_END_NR].start_address = (unsigned long)__eamode31;
316319
address_markers[MODULES_NR].start_address = MODULES_VADDR;

0 commit comments

Comments
 (0)