Skip to content

Commit

Permalink
s390/os_info: Store virtual memory layout
Browse files Browse the repository at this point in the history
This is a preparatory rework to allow uncoupling virtual
and physical addresses spaces.

The virtual memory layout will be read out by makedumpfile,
crash and other user tools for virtual address translation.

Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
  • Loading branch information
Alexander Gordeev committed Apr 17, 2024
1 parent 8870279 commit 8572f52
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 8 additions & 2 deletions arch/s390/include/asm/os_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
#define OS_INFO_REIPL_BLOCK 1
#define OS_INFO_FLAGS_ENTRY 2
#define OS_INFO_RESERVED 3
#define OS_INFO_IDENTITY_BASE 4
#define OS_INFO_KASLR_OFFSET 5
#define OS_INFO_KASLR_OFF_PHYS 6
#define OS_INFO_VMEMMAP 7
#define OS_INFO_AMODE31_START 8
#define OS_INFO_AMODE31_END 9

#define OS_INFO_FLAG_REIPL_CLEAR (1UL << 0)

Expand All @@ -37,8 +43,8 @@ struct os_info {
u16 version_minor;
u64 crashkernel_addr;
u64 crashkernel_size;
struct os_info_entry entry[4];
u8 reserved[3984];
struct os_info_entry entry[10];
u8 reserved[3864];
} __packed;

void os_info_init(void);
Expand Down
7 changes: 7 additions & 0 deletions arch/s390/kernel/os_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <asm/checksum.h>
#include <asm/abs_lowcore.h>
#include <asm/os_info.h>
#include <asm/physmem_info.h>
#include <asm/maccess.h>
#include <asm/asm-offsets.h>

Expand Down Expand Up @@ -74,6 +75,12 @@ void __init os_info_init(void)
os_info.version_major = OS_INFO_VERSION_MAJOR;
os_info.version_minor = OS_INFO_VERSION_MINOR;
os_info.magic = OS_INFO_MAGIC;
os_info_entry_add_val(OS_INFO_IDENTITY_BASE, __identity_base);
os_info_entry_add_val(OS_INFO_KASLR_OFFSET, kaslr_offset());
os_info_entry_add_val(OS_INFO_KASLR_OFF_PHYS, __kaslr_offset_phys);
os_info_entry_add_val(OS_INFO_VMEMMAP, (unsigned long)vmemmap);
os_info_entry_add_val(OS_INFO_AMODE31_START, AMODE31_START);
os_info_entry_add_val(OS_INFO_AMODE31_END, AMODE31_END);
os_info.csum = os_info_csum(&os_info);
abs_lc = get_abs_lowcore();
abs_lc->os_info = __pa(&os_info);
Expand Down

0 comments on commit 8572f52

Please sign in to comment.