2005-04-17 02:20:36 +04:00
/ * ld s c r i p t t o m a k e s39 0 L i n u x k e r n e l
* Written b y M a r t i n S c h w i d e f s k y ( s c h w i d e f s k y @de.ibm.com)
* /
2008-11-27 13:05:58 +03:00
# include < a s m / t h r e a d _ i n f o . h >
2007-10-12 18:11:50 +04:00
# include < a s m / p a g e . h >
2005-04-17 02:20:36 +04:00
# include < a s m - g e n e r i c / v m l i n u x . l d s . h >
2006-01-06 11:19:28 +03:00
# ifndef C O N F I G _ 6 4 B I T
2005-04-17 02:20:36 +04:00
OUTPUT_ F O R M A T ( " e l f32 - s39 0 " , " e l f32 - s39 0 " , " e l f32 - s39 0 " )
OUTPUT_ A R C H ( s39 0 )
2012-01-18 21:03:39 +04:00
ENTRY( s t a r t u p )
2005-04-17 02:20:36 +04:00
jiffies = j i f f i e s _ 6 4 + 4 ;
# else
OUTPUT_ F O R M A T ( " e l f64 - s39 0 " , " e l f64 - s39 0 " , " e l f64 - s39 0 " )
OUTPUT_ A R C H ( s39 0 : 6 4 - b i t )
2012-01-18 21:03:39 +04:00
ENTRY( s t a r t u p )
2005-04-17 02:20:36 +04:00
jiffies = j i f f i e s _ 6 4 ;
# endif
2008-01-26 16:11:21 +03:00
PHDRS {
text P T _ L O A D F L A G S ( 5 ) ; /* R_E */
data P T _ L O A D F L A G S ( 7 ) ; /* RWE */
note P T _ N O T E F L A G S ( 0 ) ; /* ___ */
}
2005-04-17 02:20:36 +04:00
SECTIONS
{
2007-10-12 18:11:49 +04:00
. = 0 x0 0 0 0 0 0 0 0 ;
.text : {
_ text = . ; /* Text and read-only data */
2009-04-26 06:11:06 +04:00
HEAD_ T E X T
TEXT_ T E X T
2007-10-12 18:11:49 +04:00
SCHED_ T E X T
LOCK_ T E X T
KPROBES_ T E X T
2009-06-12 12:26:46 +04:00
IRQENTRY_ T E X T
2007-10-12 18:11:49 +04:00
* ( .fixup )
* ( .gnu .warning )
2008-02-05 18:50:38 +03:00
} : text = 0 x07 0 0
2005-04-17 02:20:36 +04:00
2007-10-12 18:11:49 +04:00
_ etext = . ; /* End of text section */
2005-04-17 02:20:36 +04:00
2008-01-26 16:11:21 +03:00
NOTES : t e x t : n o t e
2011-11-14 14:19:02 +04:00
.dummy : { * ( .dummy ) } : data
2007-10-12 18:11:49 +04:00
RODATA
2005-04-17 02:20:36 +04:00
# ifdef C O N F I G _ S H A R E D _ K E R N E L
2007-10-12 18:11:50 +04:00
. = ALIGN( 0 x10 0 0 0 0 ) ; /* VM shared segments are 1MB aligned */
2007-02-05 23:18:41 +03:00
# endif
2005-04-17 02:20:36 +04:00
2007-10-12 18:11:50 +04:00
. = ALIGN( P A G E _ S I Z E ) ;
2007-10-12 18:11:49 +04:00
_ eshared = . ; /* End of shareable data */
2009-10-06 12:33:57 +04:00
_ sdata = . ; /* Start of data section */
2007-10-12 18:11:49 +04:00
2009-09-11 12:28:44 +04:00
EXCEPTION_ T A B L E ( 1 6 ) : d a t a
2007-10-12 18:11:49 +04:00
2009-09-11 12:28:44 +04:00
RW_ D A T A _ S E C T I O N ( 0 x10 0 , P A G E _ S I Z E , T H R E A D _ S I Z E )
2007-10-12 18:11:49 +04:00
_ edata = . ; /* End of data section */
/* will be freed after init */
2007-10-12 18:11:50 +04:00
. = ALIGN( P A G E _ S I Z E ) ; /* Init code and data */
2007-10-12 18:11:49 +04:00
_ _ init_ b e g i n = . ;
2009-09-11 12:28:44 +04:00
INIT_ T E X T _ S E C T I O N ( P A G E _ S I Z E )
2007-10-12 18:11:49 +04:00
/ *
* .exit .text is discarded a t r u n t i m e , n o t l i n k t i m e ,
* to d e a l w i t h r e f e r e n c e s f r o m _ _ b u g _ t a b l e
* /
.exit .text : {
2008-01-20 16:15:03 +03:00
EXIT_ T E X T
2007-10-12 18:11:49 +04: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 17:23:58 +03:00
/* early.c uses stsi, which requires page aligned data. */
. = ALIGN( P A G E _ S I Z E ) ;
2009-09-11 12:28:44 +04:00
INIT_ D A T A _ S E C T I O N ( 0 x10 0 )
2007-10-12 18:11:49 +04:00
2011-03-24 20:50:09 +03:00
PERCPU_ S E C T I O N ( 0 x10 0 )
2007-10-12 18:11:50 +04:00
. = ALIGN( P A G E _ S I Z E ) ;
2007-10-12 18:11:49 +04:00
_ _ init_ e n d = . ; /* freed after init ends here */
2009-09-11 12:28:44 +04:00
BSS_ S E C T I O N ( 0 , 2 , 0 )
2007-10-12 18:11:49 +04:00
_ end = . ;
/* Debugging sections. */
STABS_ D E B U G
DWARF_ D E B U G
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 06:27:40 +04:00
/* Sections to be discarded */
DISCARDS
2005-04-17 02:20:36 +04:00
}