2005-04-16 22:20:36 +00:00
|
|
|
/* ld script to make s390 Linux kernel
|
|
|
|
* Written by Martin Schwidefsky (schwidefsky@de.ibm.com)
|
|
|
|
*/
|
|
|
|
|
2008-11-27 10:05:58 +00:00
|
|
|
#include <asm/thread_info.h>
|
2007-10-12 14:11:50 +00:00
|
|
|
#include <asm/page.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <asm-generic/vmlinux.lds.h>
|
|
|
|
|
2006-01-06 08:19:28 +00:00
|
|
|
#ifndef CONFIG_64BIT
|
2005-04-16 22:20:36 +00:00
|
|
|
OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
|
|
|
|
OUTPUT_ARCH(s390)
|
|
|
|
ENTRY(_start)
|
|
|
|
jiffies = jiffies_64 + 4;
|
|
|
|
#else
|
|
|
|
OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
|
|
|
|
OUTPUT_ARCH(s390:64-bit)
|
|
|
|
ENTRY(_start)
|
|
|
|
jiffies = jiffies_64;
|
|
|
|
#endif
|
|
|
|
|
2008-01-26 13:11:21 +00:00
|
|
|
PHDRS {
|
|
|
|
text PT_LOAD FLAGS(5); /* R_E */
|
|
|
|
data PT_LOAD FLAGS(7); /* RWE */
|
|
|
|
note PT_NOTE FLAGS(0); /* ___ */
|
|
|
|
}
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
SECTIONS
|
|
|
|
{
|
2007-10-12 14:11:49 +00:00
|
|
|
. = 0x00000000;
|
|
|
|
.text : {
|
|
|
|
_text = .; /* Text and read-only data */
|
2009-04-26 02:11:06 +00:00
|
|
|
HEAD_TEXT
|
|
|
|
TEXT_TEXT
|
2007-10-12 14:11:49 +00:00
|
|
|
SCHED_TEXT
|
|
|
|
LOCK_TEXT
|
|
|
|
KPROBES_TEXT
|
2009-06-12 08:26:46 +00:00
|
|
|
IRQENTRY_TEXT
|
2007-10-12 14:11:49 +00:00
|
|
|
*(.fixup)
|
|
|
|
*(.gnu.warning)
|
2008-02-05 15:50:38 +00:00
|
|
|
} :text = 0x0700
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-10-12 14:11:49 +00:00
|
|
|
_etext = .; /* End of text section */
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-01-26 13:11:21 +00:00
|
|
|
NOTES :text :note
|
|
|
|
|
2007-10-12 14:11:49 +00:00
|
|
|
RODATA
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_SHARED_KERNEL
|
2007-10-12 14:11:50 +00:00
|
|
|
. = ALIGN(0x100000); /* VM shared segments are 1MB aligned */
|
2007-02-05 20:18:41 +00:00
|
|
|
#endif
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-10-12 14:11:50 +00:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2007-10-12 14:11:49 +00:00
|
|
|
_eshared = .; /* End of shareable data */
|
|
|
|
|
|
|
|
. = ALIGN(16); /* Exception table */
|
|
|
|
__ex_table : {
|
|
|
|
__start___ex_table = .;
|
|
|
|
*(__ex_table)
|
|
|
|
__stop___ex_table = .;
|
2008-08-25 16:13:26 +00:00
|
|
|
} :data
|
2007-10-12 14:11:49 +00:00
|
|
|
|
|
|
|
.data : { /* Data */
|
2009-09-11 08:28:43 +00:00
|
|
|
PAGE_ALIGNED_DATA(PAGE_SIZE)
|
2007-10-12 14:11:49 +00:00
|
|
|
DATA_DATA
|
|
|
|
CONSTRUCTORS
|
|
|
|
}
|
|
|
|
|
2007-10-12 14:11:50 +00:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2007-10-12 14:11:49 +00:00
|
|
|
.data_nosave : {
|
|
|
|
__nosave_begin = .;
|
|
|
|
*(.data.nosave)
|
|
|
|
}
|
2007-10-12 14:11:50 +00:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2007-10-12 14:11:49 +00:00
|
|
|
__nosave_end = .;
|
|
|
|
|
2007-10-12 14:11:50 +00:00
|
|
|
. = ALIGN(0x100);
|
2007-10-12 14:11:49 +00:00
|
|
|
.data.cacheline_aligned : {
|
|
|
|
*(.data.cacheline_aligned)
|
|
|
|
}
|
|
|
|
|
2007-10-12 14:11:50 +00:00
|
|
|
. = ALIGN(0x100);
|
2007-10-12 14:11:49 +00:00
|
|
|
.data.read_mostly : {
|
|
|
|
*(.data.read_mostly)
|
|
|
|
}
|
|
|
|
_edata = .; /* End of data section */
|
|
|
|
|
2008-11-27 10:05:58 +00:00
|
|
|
. = ALIGN(THREAD_SIZE); /* init_task */
|
2007-10-12 14:11:49 +00:00
|
|
|
.data.init_task : {
|
|
|
|
*(.data.init_task)
|
|
|
|
}
|
|
|
|
|
|
|
|
/* will be freed after init */
|
2007-10-12 14:11:50 +00:00
|
|
|
. = ALIGN(PAGE_SIZE); /* Init code and data */
|
2007-10-12 14:11:49 +00:00
|
|
|
__init_begin = .;
|
|
|
|
.init.text : {
|
|
|
|
_sinittext = .;
|
2008-01-20 13:15:03 +00:00
|
|
|
INIT_TEXT
|
2007-10-12 14:11:49 +00:00
|
|
|
_einittext = .;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* .exit.text is discarded at runtime, not link time,
|
|
|
|
* to deal with references from __bug_table
|
|
|
|
*/
|
|
|
|
.exit.text : {
|
2008-01-20 13:15:03 +00:00
|
|
|
EXIT_TEXT
|
2007-10-12 14:11:49 +00:00
|
|
|
}
|
|
|
|
|
[S390] Fix hypervisor detection for KVM
Currently we use the cpuid (via STIDP instruction) to recognize LPAR,
z/VM and KVM.
The architecture states, that bit 0-7 of STIDP returns all zero, and
if STIDP is executed in a virtual machine, the VM operating system
will replace bits 0-7 with FF.
KVM should not use FE to distinguish z/VM from KVM for interested
guests. The proper way to detect the hypervisor is the STSI (Store
System Information) instruction, which return information about the
hypervisors via function code 3, selector1=2, selector2=2.
This patch changes the detection routine of Linux to use STSI instead
of STIDP. This detection is earlier than bootmem, we have to use a
static buffer. Since STSI expects a 4kb block (4kb aligned) this
patch also changes the init.data alignment for s390. As this section
will be freed during boot, this should be no problem.
Patch is tested with LPAR, z/VM, KVM on LPAR, and KVM under z/VM.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-03-26 14:23:58 +00:00
|
|
|
/* early.c uses stsi, which requires page aligned data. */
|
|
|
|
. = ALIGN(PAGE_SIZE);
|
2007-10-12 14:11:49 +00:00
|
|
|
.init.data : {
|
2008-01-20 13:15:03 +00:00
|
|
|
INIT_DATA
|
2007-10-12 14:11:49 +00:00
|
|
|
}
|
2007-10-12 14:11:50 +00:00
|
|
|
. = ALIGN(0x100);
|
2007-10-12 14:11:49 +00:00
|
|
|
.init.setup : {
|
|
|
|
__setup_start = .;
|
|
|
|
*(.init.setup)
|
|
|
|
__setup_end = .;
|
|
|
|
}
|
|
|
|
.initcall.init : {
|
|
|
|
__initcall_start = .;
|
|
|
|
INITCALLS
|
|
|
|
__initcall_end = .;
|
|
|
|
}
|
|
|
|
|
|
|
|
.con_initcall.init : {
|
|
|
|
__con_initcall_start = .;
|
|
|
|
*(.con_initcall.init)
|
|
|
|
__con_initcall_end = .;
|
|
|
|
}
|
|
|
|
SECURITY_INIT
|
2007-02-10 09:44:44 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_BLK_DEV_INITRD
|
2007-10-12 14:11:50 +00:00
|
|
|
. = ALIGN(0x100);
|
2007-10-12 14:11:49 +00:00
|
|
|
.init.ramfs : {
|
|
|
|
__initramfs_start = .;
|
|
|
|
*(.init.ramfs)
|
|
|
|
. = ALIGN(2);
|
|
|
|
__initramfs_end = .;
|
|
|
|
}
|
2007-02-10 09:44:44 +00:00
|
|
|
#endif
|
2007-10-12 14:11:49 +00:00
|
|
|
|
2007-10-12 14:11:50 +00:00
|
|
|
PERCPU(PAGE_SIZE)
|
|
|
|
. = ALIGN(PAGE_SIZE);
|
2007-10-12 14:11:49 +00:00
|
|
|
__init_end = .; /* freed after init ends here */
|
|
|
|
|
|
|
|
/* BSS */
|
|
|
|
.bss : {
|
|
|
|
__bss_start = .;
|
|
|
|
*(.bss)
|
|
|
|
. = ALIGN(2);
|
|
|
|
__bss_stop = .;
|
|
|
|
}
|
|
|
|
|
|
|
|
_end = . ;
|
|
|
|
|
|
|
|
/* Sections to be discarded */
|
|
|
|
/DISCARD/ : {
|
2008-01-20 13:15:03 +00:00
|
|
|
EXIT_DATA
|
2007-10-12 14:11:49 +00:00
|
|
|
*(.exitcall.exit)
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Debugging sections. */
|
|
|
|
STABS_DEBUG
|
|
|
|
DWARF_DEBUG
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|