2005-04-17 06:20:36 +08:00
|
|
|
/* ld script to make s390 Linux kernel
|
|
|
|
* Written by Martin Schwidefsky (schwidefsky@de.ibm.com)
|
|
|
|
*/
|
|
|
|
|
2008-11-27 18:05:58 +08:00
|
|
|
#include <asm/thread_info.h>
|
2007-10-12 22:11:50 +08:00
|
|
|
#include <asm/page.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <asm-generic/vmlinux.lds.h>
|
|
|
|
|
2006-01-06 16:19:28 +08:00
|
|
|
#ifndef CONFIG_64BIT
|
2005-04-17 06:20:36 +08:00
|
|
|
OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
|
|
|
|
OUTPUT_ARCH(s390)
|
2012-01-19 01:03:39 +08:00
|
|
|
ENTRY(startup)
|
2005-04-17 06:20:36 +08:00
|
|
|
jiffies = jiffies_64 + 4;
|
|
|
|
#else
|
|
|
|
OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
|
|
|
|
OUTPUT_ARCH(s390:64-bit)
|
2012-01-19 01:03:39 +08:00
|
|
|
ENTRY(startup)
|
2005-04-17 06:20:36 +08:00
|
|
|
jiffies = jiffies_64;
|
|
|
|
#endif
|
|
|
|
|
2008-01-26 21:11:21 +08:00
|
|
|
PHDRS {
|
|
|
|
text PT_LOAD FLAGS(5); /* R_E */
|
|
|
|
data PT_LOAD FLAGS(7); /* RWE */
|
|
|
|
note PT_NOTE FLAGS(0); /* ___ */
|
|
|
|
}
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
SECTIONS
|
|
|
|
{
|
2007-10-12 22:11:49 +08:00
|
|
|
. = 0x00000000;
|
|
|
|
.text : {
|
|
|
|
_text = .; /* Text and read-only data */
|
2009-04-26 10:11:06 +08:00
|
|
|
HEAD_TEXT
|
|
|
|
TEXT_TEXT
|
2007-10-12 22:11:49 +08:00
|
|
|
SCHED_TEXT
|
|
|
|
LOCK_TEXT
|
|
|
|
KPROBES_TEXT
|
2009-06-12 16:26:46 +08:00
|
|
|
IRQENTRY_TEXT
|
2007-10-12 22:11:49 +08:00
|
|
|
*(.fixup)
|
|
|
|
*(.gnu.warning)
|
2008-02-05 23:50:38 +08:00
|
|
|
} :text = 0x0700
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-10-12 22:11:49 +08:00
|
|
|
_etext = .; /* End of text section */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2008-01-26 21:11:21 +08:00
|
|
|
NOTES :text :note
|
|
|
|
|
2011-11-14 18:19:02 +08:00
|
|
|
.dummy : { *(.dummy) } :data
|
|
|
|
|
2012-07-24 22:32:39 +08:00
|
|
|
RO_DATA_SECTION(PAGE_SIZE)
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_SHARED_KERNEL
|
2007-10-12 22:11:50 +08:00
|
|
|
. = ALIGN(0x100000); /* VM shared segments are 1MB aligned */
|
2007-02-06 04:18:41 +08:00
|
|
|
#endif
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-10-12 22:11:50 +08:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2007-10-12 22:11:49 +08:00
|
|
|
_eshared = .; /* End of shareable data */
|
2009-10-06 16:33:57 +08:00
|
|
|
_sdata = .; /* Start of data section */
|
2007-10-12 22:11:49 +08:00
|
|
|
|
2009-09-11 16:28:44 +08:00
|
|
|
EXCEPTION_TABLE(16) :data
|
2007-10-12 22:11:49 +08:00
|
|
|
|
2009-09-11 16:28:44 +08:00
|
|
|
RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE)
|
2007-10-12 22:11:49 +08:00
|
|
|
|
|
|
|
_edata = .; /* End of data section */
|
|
|
|
|
|
|
|
/* will be freed after init */
|
2007-10-12 22:11:50 +08:00
|
|
|
. = ALIGN(PAGE_SIZE); /* Init code and data */
|
2007-10-12 22:11:49 +08:00
|
|
|
__init_begin = .;
|
2009-09-11 16:28:44 +08:00
|
|
|
|
|
|
|
INIT_TEXT_SECTION(PAGE_SIZE)
|
|
|
|
|
2007-10-12 22:11:49 +08:00
|
|
|
/*
|
|
|
|
* .exit.text is discarded at runtime, not link time,
|
|
|
|
* to deal with references from __bug_table
|
|
|
|
*/
|
|
|
|
.exit.text : {
|
2008-01-20 21:15:03 +08:00
|
|
|
EXIT_TEXT
|
2007-10-12 22:11:49 +08: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 22:23:58 +08:00
|
|
|
/* early.c uses stsi, which requires page aligned data. */
|
|
|
|
. = ALIGN(PAGE_SIZE);
|
2009-09-11 16:28:44 +08:00
|
|
|
INIT_DATA_SECTION(0x100)
|
2007-10-12 22:11:49 +08:00
|
|
|
|
2011-03-25 01:50:09 +08:00
|
|
|
PERCPU_SECTION(0x100)
|
2007-10-12 22:11:50 +08:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2007-10-12 22:11:49 +08:00
|
|
|
__init_end = .; /* freed after init ends here */
|
|
|
|
|
2009-09-11 16:28:44 +08:00
|
|
|
BSS_SECTION(0, 2, 0)
|
2007-10-12 22:11:49 +08:00
|
|
|
|
|
|
|
_end = . ;
|
|
|
|
|
|
|
|
/* Debugging sections. */
|
|
|
|
STABS_DEBUG
|
|
|
|
DWARF_DEBUG
|
linker script: unify usage of discard definition
Discarded sections in different archs share some commonality but have
considerable differences. This led to linker script for each arch
implementing its own /DISCARD/ definition, which makes maintaining
tedious and adding new entries error-prone.
This patch makes all linker scripts to move discard definitions to the
end of the linker script and use the common DISCARDS macro. As ld
uses the first matching section definition, archs can include default
discarded sections by including them earlier in the linker script.
ia64 is notable because it first throws away some ia64 specific
subsections and then include the rest of the sections into the final
image, so those sections must be discarded before the inclusion.
defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
alpha, sparc, sparc64 and s390. Michal Simek tested microblaze.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Michal Simek <monstr@monstr.eu>
Cc: linux-arch@vger.kernel.org
Cc: Michal Simek <monstr@monstr.eu>
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Tony Luck <tony.luck@intel.com>
2009-07-09 10:27:40 +08:00
|
|
|
|
|
|
|
/* Sections to be discarded */
|
|
|
|
DISCARDS
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|