lkml.org 
[lkml]   [2023]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v5 01/27] x86/boot: Align vmlinuz sections on page size
Date
To protect sections on page table level each section needs to be
aligned on page size (4KB).

Set sections alignment in linker script for the kernel decompressor
(boot/compressed/vmlinux.lds.S).

Also introduce symbols that can be used to reference compressed
kernel blob section later in the later patches.

Tested-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Evgeniy Baskov <baskov@ispras.ru>
---
arch/x86/boot/compressed/vmlinux.lds.S | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
index b22f34b8684a..a5015b958085 100644
--- a/arch/x86/boot/compressed/vmlinux.lds.S
+++ b/arch/x86/boot/compressed/vmlinux.lds.S
@@ -27,31 +27,32 @@ SECTIONS
HEAD_TEXT
_ehead = . ;
}
- .rodata..compressed : {
+ .rodata..compressed : ALIGN(PAGE_SIZE) {
+ _compressed = .;
*(.rodata..compressed)
+ _ecompressed = .;
}
- .text : {
+ .text : ALIGN(PAGE_SIZE) {
_text = .; /* Text */
*(.text)
*(.text.*)
*(.noinstr.text)
_etext = . ;
}
- .rodata : {
+ .rodata : ALIGN(PAGE_SIZE) {
_rodata = . ;
*(.rodata) /* read-only data */
*(.rodata.*)
_erodata = . ;
}
- .data : {
+ .data : ALIGN(PAGE_SIZE) {
_data = . ;
*(.data)
*(.data.*)
*(.bss.efistub)
_edata = . ;
}
- . = ALIGN(L1_CACHE_BYTES);
- .bss : {
+ .bss : ALIGN(L1_CACHE_BYTES) {
_bss = . ;
*(.bss)
*(.bss.*)
@@ -60,8 +61,7 @@ SECTIONS
_ebss = .;
}
#ifdef CONFIG_X86_64
- . = ALIGN(PAGE_SIZE);
- .pgtable : {
+ .pgtable : ALIGN(PAGE_SIZE) {
_pgtable = . ;
*(.pgtable)
_epgtable = . ;
--
2.39.2
\
 
 \ /
  Last update: 2023-03-27 00:59    [W:0.212 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site