Home | History | Annotate | Download | only in conf
History log of /src/sys/arch/i386/conf/kern.ldscript
RevisionDateAuthorComments
 1.22  24-Jun-2018  maxv Sync the ld scripts:

* Force a PAGE_SIZE alignment of .bss on i386. Normally that's not
required since the bootloader ensures page alignment, but let's be
safe. Same on Xen-i386.

* Fill the .text section padding with int3 instructions on Xen kernels,
to prevent FALLTHROUGHs if a pointer goes crazy, same as native.
 1.21  07-Jan-2018  maxv branches: 1.21.2;
Implement a real hotpatch feature.

Define a HOTPATCH() macro, that puts a label and additional information
in the new .rodata.hotpatch kernel section. In patch.c, scan the section
and patch what needs to be. Now it is possible to hotpatch the content of
a macro.

SMAP is switched to use this new system; this saves a call+ret in each
kernel entry/exit point.

Many other operating systems do the same.
 1.20  18-Aug-2017  maxv Fill the .text padding with 0xcc (int3), in such a way that any jump into
this area will automatically fault. The alignment within the section is
necessary, in order to fill strictly all of the padding (took me a while
to figure this out); but it does not change the kernel size.

Greatly inspired from FreeBSD, but for some reason they decided not to
apply the alignment.
 1.19  14-May-2016  maxv branches: 1.19.10;
Align the segments on i386. We're going to map them independently.
 1.18  13-May-2016  maxv Define __kernel_end.
 1.17  12-May-2016  maxv Split the {text+rodata} chunk in two separate chunks on x86. The
rodata segment now loses the large page optimization, gets mapped inside
the data segment, and therefore becomes RWX. It may break the build on
Xen.
 1.16  28-Nov-2015  maxv KNF
 1.15  25-Aug-2015  uebayasi Replace a constant in ldscript.
 1.14  22-Aug-2015  uebayasi Don't need to specify OUTPUT_FORMAT/OUTPUT_ARCH in linker scripts.
 1.13  20-Aug-2015  uebayasi Simplify these by doing AT () relocation once.
 1.12  20-Aug-2015  uebayasi Indent with 2 spaces.
 1.11  02-Nov-2014  uebayasi branches: 1.11.2;
Revert previous per joerg@'s request.

According to him, exposing .data.{read_mostly,cacheline_aligned} is
intentional so that people can easily see which variables are optimized.
 1.10  01-Nov-2014  uebayasi amd64, i386: Don't expose .data.{read_mostly,cacheline_aligned} sections
 1.9  23-Sep-2012  chs sync ldscripts; add cacheline_aligned and read_mostly handling
to the non-default ones.
 1.8  01-Jun-2010  mjf branches: 1.8.8; 1.8.14; 1.8.18;
Add __cacheline_aligned and __read_mostly annotations.

These annotations help to mitigate false sharing on multiprocessor
systems.

Variables annotated with __cacheline_aligned are placed into the
.data.cacheline_aligned section in the kernel. Each item in this
section is aligned on a cachline boundary - this avoids false
sharing. Highly contended global locks are a good candidate for
__cacheline_aligned annotation.

Variables annotated with __read_mostly are packed together tightly
into a .data.read_mostly section in the kernel. The idea here is that
we can pack infrequently modified data items into a cacheline and
avoid having to purge the cache, which would happen if read mostly
data and write mostly data shared a cachline. Initialisation variables
are a prime candiate for __read_mostly annotations.
 1.7  18-Oct-2007  yamt branches: 1.7.20; 1.7.34; 1.7.40; 1.7.42;
merge yamt-x86pmap branch.

- reduce differences between amd64 and i386. notably, share pmap.c
between them. it makes several i386 pmap improvements available to
amd64, including tlb shootdown reduction and bug fixes from Stephan Uphoff.
- implement deferred pmap switching for amd64.
- remove LARGEPAGES option. always use large pages if available.
also, make it work on amd64.
 1.6  02-Dec-2006  christos branches: 1.6.6; 1.6.22; 1.6.24; 1.6.26; 1.6.28;
keep the note section
 1.5  26-May-2006  pavel branches: 1.5.6; 1.5.8;
New linker scripts for the i386 kernel. The main improvement is setting the
physical load address correctly. (Before, it was set to the same very high
value as the virtual address.)

Provided by Jason Thorpe in
http://mail-index.netbsd.org/port-i386/2006/02/10/0008.html
with some modifications by me, mainly to make the output more similar to
the current one, and to not hardwire the physical and virtual addresses.

See also:
http://mail-index.netbsd.org/port-i386/2006/05/19/0001.html

Now an unpatched grub can load a NetBSD Multiboot kernel.
 1.4  11-Dec-2005  christos branches: 1.4.4; 1.4.6; 1.4.8; 1.4.14;
merge ktrace-lwp.
 1.3  23-May-2004  christos branches: 1.3.12;
put back SIZEOF_HEADERS now that bfd is fixed; you will need to recompile
libbfd...
 1.2  22-May-2004  christos Use 1024 instead of SIZEOF_HEADERS, so that we can include a note section.
 1.1  20-Jan-2001  thorpej branches: 1.1.2; 1.1.4; 1.1.28;
Add a linker script for the kernel, which places _etext after
all of the read-only data. Move _etext after all the read-only
data in the LARGEPAGES script, as well.

This will cause const data to actually be const on i386 kernels now
(it was, by sheer luck, on LARGEPAGES kernels simply because of the
section rounding that the LARGEPAGES script performed).
 1.1.28.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.28.2  18-Sep-2004  skrll Sync with HEAD.
 1.1.28.1  03-Aug-2004  skrll Sync with HEAD
 1.1.4.2  11-Feb-2001  bouyer Sync with HEAD.
 1.1.4.1  20-Jan-2001  bouyer file kern.ldscript was added on branch thorpej_scsipi on 2001-02-11 19:10:53 +0000
 1.1.2.2  20-Jan-2001  thorpej Add a linker script for the kernel, which places _etext after
all of the read-only data. Move _etext after all the read-only
data in the LARGEPAGES script, as well.

This will cause const data to actually be const on i386 kernels now
(it was, by sheer luck, on LARGEPAGES kernels simply because of the
section rounding that the LARGEPAGES script performed).
 1.1.2.1  20-Jan-2001  thorpej file kern.ldscript was added on branch sommerfeld_i386mp_1 on 2001-01-20 01:05:24 +0000
 1.3.12.3  27-Oct-2007  yamt sync with head.
 1.3.12.2  30-Dec-2006  yamt sync with head.
 1.3.12.1  21-Jun-2006  yamt sync with head.
 1.4.14.1  19-Jun-2006  chap Sync with head.
 1.4.8.1  26-Jun-2006  yamt sync with head.
 1.4.6.1  01-Jun-2006  kardel Sync with head.
 1.4.4.1  09-Sep-2006  rpaulo sync with head
 1.5.8.1  10-Dec-2006  yamt sync with head.
 1.5.6.1  12-Jan-2007  ad Sync with head.
 1.6.28.1  25-Oct-2007  bouyer Sync with HEAD.
 1.6.26.1  04-Oct-2007  yamt - move etext before rodata. define __data_start at the start of
.data section and use it instead of etext where appropriate.
- put .rodata.* into .rodata section as well.
- pmap_bootstrap: don't assume NBPD_L2 alignment.
- pmap_bootstrap: if DEBUG, print how many large pages and normal pages are
used to map kernel text.
 1.6.24.1  06-Nov-2007  matt sync with HEAD
 1.6.22.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.6.6.1  23-Oct-2007  ad Sync with head.
 1.7.42.1  03-Jul-2010  rmind sync with head
 1.7.40.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.7.34.2  29-Mar-2011  jym More sync fixes. And add the mbr_gpt files.
 1.7.34.1  24-Oct-2010  jym Sync with HEAD
 1.7.20.1  11-Aug-2010  yamt sync with head.
 1.8.18.2  03-Dec-2017  jdolecek update from HEAD
 1.8.18.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.8.14.1  22-Nov-2012  riz Pull up following revision(s) (requested by chs in ticket #684):
sys/arch/i386/conf/kern.ldscript.Xen: revision 1.4
sys/arch/i386/conf/kern.ldscript: revision 1.9
sys/arch/i386/conf/kern.ldscript.4MB: revision 1.10
sync ldscripts; add cacheline_aligned and read_mostly handling
to the non-default ones.
 1.8.8.1  30-Oct-2012  yamt sync with head
 1.11.2.4  28-Aug-2017  skrll Sync with HEAD
 1.11.2.3  29-May-2016  skrll Sync with HEAD
 1.11.2.2  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.11.2.1  22-Sep-2015  skrll Sync with HEAD
 1.19.10.1  06-Mar-2018  martin Pull up the following revisions, requested by maxv in ticket #603:

amd64/conf/kern.ldscript 1.25 (patch)
amd64/conf/kern.ldscript.Xen 1.14 (patch)
i386/conf/kern.ldscript 1.21 (patch)
i386/conf/kern.ldscript.Xen 1.15 (patch)
x86/include/cpufunc.h 1.24 (patch)
x86/x86/patch.c 1.25 (partial) 1.26 (partial)

Backport x86_hotpatch.
 1.21.2.1  25-Jun-2018  pgoyette Sync with HEAD

RSS XML Feed