From dc10f7b8d3d500fe9efd389eb01bb111644d74ae Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 2 Sep 2009 22:48:57 -0700 Subject: [PATCH] core: move the generated IDT stubs to a separate .gentext16 section Move the generated IDT stubs to a separate section, .gentext16, so that they aren't immediately adjacent to a piece of highly mutable data. Signed-off-by: H. Peter Anvin --- core/layout.inc | 1 + core/pm.inc | 5 +++-- core/syslinux.ld | 14 +++++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/core/layout.inc b/core/layout.inc index 3df0772..c67105a 100644 --- a/core/layout.inc +++ b/core/layout.inc @@ -38,6 +38,7 @@ LATEBSS_START equ 0B800h section .earlybss nobits section .config write progbits align=4 section .replacestub exec write progbits align=16 + section .gentextnr exec write nobits align=16 ; Use .bss16 for things that doesn't have to be in low memory; ; .earlybss should be used for things that absolutely have diff --git a/core/pm.inc b/core/pm.inc index 873da08..9584cda 100644 --- a/core/pm.inc +++ b/core/pm.inc @@ -440,10 +440,11 @@ pm_init: section .earlybss alignb 8 IDT: resq 256 -IRQStubs: resb 4*256+3*8 - RealModeSSSP resd 1 ; Real-mode SS:SP + section .gentextnr ; Autogenerated 32-bit code +IRQStubs: resb 4*256+3*8 + section .text16 %include "callback.inc" ; Real-mode callbacks diff --git a/core/syslinux.ld b/core/syslinux.ld index 50e7305..c2e49a2 100644 --- a/core/syslinux.ld +++ b/core/syslinux.ld @@ -60,7 +60,9 @@ SECTIONS __config_len = __config_end - __config_start; __config_dwords = (__config_len + 3) >> 2; - . = ALIGN(16); + /* Generated and/or copied code */ + + . = ALIGN(128); /* Minimum separation from mutable data */ .replacestub : AT (__replacestub_lma) { __replacestub_start = .; *(.replacestub) @@ -69,6 +71,16 @@ SECTIONS __replacestub_len = __replacestub_end - __replacestub_start; __replacestub_dwords = (__replacestub_len + 3) >> 2; + . = ALIGN(16); + __gentextnr_lma = .; + .gentextnr : AT(__gentextnr_lma) { + __gentextnr_start = .; + *(.gentextnr) + __gentextnr_end = .; + } + __gentextnr_len = __gentextnr_end - __gentextnr_start; + __gentextnr_dwords = (__gentextnr_len + 3) >> 2; + /* 16-bit stack */ STACK16_BASE = 0x7c00 - STACK16_LEN; -- 2.7.4