Skip to content

Commit

Permalink
s390/boot: Make identity mapping base address explicit
Browse files Browse the repository at this point in the history
This is a preparatory rework to allow uncoupling virtual
and physical addresses spaces.

Currently the identity mapping base address is implicit
and is always set to zero. Make it explicit by putting
into __identity_base persistent boot variable and use it
in proper context - which is the value of PAGE_OFFSET.

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 3bb1123 commit 7de0446
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/s390/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,15 @@ int arch_make_page_accessible(struct page *page);
struct vm_layout {
unsigned long kaslr_offset;
unsigned long kaslr_offset_phys;
unsigned long identity_base;
unsigned long identity_size;
};

extern struct vm_layout vm_layout;

#define __kaslr_offset vm_layout.kaslr_offset
#define __kaslr_offset_phys vm_layout.kaslr_offset_phys
#define __identity_base vm_layout.identity_base
#define ident_map_size vm_layout.identity_size

static inline unsigned long kaslr_offset(void)
Expand All @@ -203,8 +205,8 @@ static inline int kaslr_enabled(void)
return 0;
}

#define __PAGE_OFFSET 0x0UL
#define PAGE_OFFSET 0x0UL
#define __PAGE_OFFSET __identity_base
#define PAGE_OFFSET __PAGE_OFFSET

#define __pa_nodebug(x) ((unsigned long)(x))

Expand Down
1 change: 1 addition & 0 deletions arch/s390/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ unsigned long __bootdata_preserved(max_mappable);
struct physmem_info __bootdata(physmem_info);

struct vm_layout __bootdata_preserved(vm_layout);
EXPORT_SYMBOL_GPL(vm_layout);
int __bootdata_preserved(__kaslr_enabled);
unsigned int __bootdata_preserved(zlib_dfltcc_support);
EXPORT_SYMBOL(zlib_dfltcc_support);
Expand Down

0 comments on commit 7de0446

Please sign in to comment.