1. 13 Jun, 2016 2 commits
    • Heiko Carstens's avatar
      s390: add proper __ro_after_init support · d07a980c
      Heiko Carstens authored
      On s390 __ro_after_init is currently mapped to __read_mostly which
      means that data marked as __ro_after_init will not be protected.
      Reason for this is that the common code __ro_after_init implementation
      is x86 centric: the ro_after_init data section was added to rodata,
      since x86 enables write protection to kernel text and rodata very
      late. On s390 we have write protection for these sections enabled with
      the initial page tables. So adding the ro_after_init data section to
      rodata does not work on s390.
      In order to make __ro_after_init work properly on s390 move the
      ro_after_init data, right behind rodata. Unlike the rodata section it
      will be marked read-only later after all init calls happened.
      This s390 specific implementation adds new __start_ro_after_init and
      __end_ro_after_init labels. Everything in between will be marked
      read-only after the init calls happened. In addition to the
      __ro_after_init data move also the exception table there, since from a
      practical point of view it fits the __ro_after_init requirements.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    • Heiko Carstens's avatar
      s390/mm: align swapper_pg_dir to 16k · 0ccb32c9
      Heiko Carstens authored
      The segment/region table that is part of the kernel image must be
      properly aligned to 16k in order to make the crdte inline assembly
      Otherwise it will calculate a wrong segment/region table start address
      and access incorrect memory locations if the swapper_pg_dir is not
      aligned to 16k.
      Therefore define BSS_FIRST_SECTIONS in order to put the swapper_pg_dir
      at the beginning of the bss section and also align the bss section to
      16k just like other architectures did.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
  2. 25 Mar, 2016 1 commit
  3. 25 Mar, 2015 1 commit
    • Heiko Carstens's avatar
      s390: remove 31 bit support · 5a79859a
      Heiko Carstens authored
      Remove the 31 bit support in order to reduce maintenance cost and
      effectively remove dead code. Since a couple of years there is no
      distribution left that comes with a 31 bit kernel.
      The 31 bit kernel also has been broken since more than a year before
      anybody noticed. In addition I added a removal warning to the kernel
      shown at ipl for 5 minutes: a960062e
       ("s390: add 31 bit warning
      message") which let everybody know about the plan to remove 31 bit
      code. We didn't get any response.
      Given that the last 31 bit only machine was introduced in 1999 let's
      remove the code.
      Anybody with 31 bit user space code can still use the compat mode.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
  4. 14 Feb, 2013 1 commit
  5. 18 Oct, 2012 1 commit
    • Heiko Carstens's avatar
      s390: fix linker script for 31 bit builds · c985cb37
      Heiko Carstens authored
      Because of a change in the s390 arch backend of binutils (commit 23ecd77
      "Pick the default arch depending on the target size" in binutils repo)
      31 bit builds will fail since the linker would now try to create 64 bit
      binary output.
      Fix this by setting OUTPUT_ARCH to s390:31-bit instead of s390.
      Thanks to Andreas Krebbel for figuring out the issue.
      Fixes this build error:
        LD      init/built-in.o
      s390x-4.7.2-ld: s390:31-bit architecture of input file
       `arch/s390/kernel/head.o' is incompatible with s390:64-bit output
      Cc: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
  6. 26 Jul, 2012 1 commit
  7. 18 Jan, 2012 1 commit
    • Christian Borntraeger's avatar
      [S390] cleanup entry point definition · e0a15d5b
      Christian Borntraeger authored
      The vmlinux file for s390 contains a currently unused entry point,
      which is specified in two different locations: the linker script
      and the makefile. As it happens both definitions are different and
      the linker file is broken (_start does not exist) and the makefile
      specifies an entry point which makes no sense (the SALIPL loader
      entry point).
      So lets get rid of one definition (the makefile) and use the entry
      point of all other ipl methods (0x10000 -> startup) to be consistent.
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
  8. 14 Nov, 2011 1 commit
    • Martin Schwidefsky's avatar
      [S390] incorrect note program header · 7a2512b7
      Martin Schwidefsky authored
      'readelf -n' on the s390 vmlinux file generates lots of warnings about
      corrupt notes. The reason is that the 'NOTE' program header has incorrect
      file and memory sizes. The problem is that the section following the
      NOTES section do not switch to a different phdr and they get added to
      the NOTE program section. Add a dummy entry to the linker script that
      switches to the data phdr before the start of the RODATA section.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
  9. 24 Mar, 2011 1 commit
    • Tejun Heo's avatar
      percpu: Always align percpu output section to PAGE_SIZE · 0415b00d
      Tejun Heo authored
      Percpu allocator honors alignment request upto PAGE_SIZE and both the
      percpu addresses in the percpu address space and the translated kernel
      addresses should be aligned accordingly.  The calculation of the
      former depends on the alignment of percpu output section in the kernel
      The linker script macros PERCPU_VADDR() and PERCPU() are used to
      define this output section and the latter takes @align parameter.
      Several architectures are using @align smaller than PAGE_SIZE breaking
      percpu memory alignment.
      This patch removes @align parameter from PERCPU(), renames it to
      PERCPU_SECTION() and makes it always align to PAGE_SIZE.  While at it,
      add PCPU_SETUP_BUG_ON() checks such that alignment problems are
      reliably detected and remove percpu alignment comment recently added
      in workqueue.c as the condition would trigger BUG way before reaching
      For um, this patch raises the alignment of percpu area.  As the area
      is in .init, there shouldn't be any noticeable difference.
      This problem was discovered by David Howells while debugging boot
      failure on mn10300.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
      Cc: uclinux-dist-devel@blackfin.uclinux.org
      Cc: David Howells <dhowells@redhat.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: user-mode-linux-devel@lists.sourceforge.net
  10. 25 Jan, 2011 1 commit
    • Tejun Heo's avatar
      percpu: align percpu readmostly subsection to cacheline · 19df0c2f
      Tejun Heo authored
      Currently percpu readmostly subsection may share cachelines with other
      percpu subsections which may result in unnecessary cacheline bounce
      and performance degradation.
      This patch adds @cacheline parameter to PERCPU() and PERCPU_VADDR()
      linker macros, makes each arch linker scripts specify its cacheline
      size and use it to align percpu subsections.
      This is based on Shaohua's x86 only patch.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Shaohua Li <shaohua.li@intel.com>
  11. 06 Oct, 2009 1 commit
  12. 11 Sep, 2009 2 commits
  13. 09 Jul, 2009 1 commit
    • Tejun Heo's avatar
      linker script: unify usage of discard definition · 023bf6f1
      Tejun Heo authored
      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: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarPaul Mundt <lethal@linux-sh.org>
      Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
      Tested-by: default avatarMichal 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>
  14. 24 Jun, 2009 1 commit
    • Tejun Heo's avatar
      linker script: throw away .discard section · 405d967d
      Tejun Heo authored
      x86 throws away .discard section but no other archs do.  Also,
      .discard is not thrown away while linking modules.  Make every arch
      and module linking throw it away.  This will be used to define dummy
      variables for percpu declarations and definitions.
      This patch is based on Ivan Kokshaysky's alpha percpu patch.
      [ Impact: always throw away everything in .discard ]
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Bryan Wu <cooloney@kernel.org>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Ingo Molnar <mingo@elte.hu>
  15. 12 Jun, 2009 1 commit
  16. 26 Apr, 2009 1 commit
  17. 26 Mar, 2009 1 commit
    • Christian Borntraeger's avatar
      [S390] Fix hypervisor detection for KVM · 92e6ecf3
      Christian Borntraeger authored
      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: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
  18. 27 Nov, 2008 1 commit
  19. 25 Aug, 2008 1 commit
  20. 25 May, 2008 1 commit
  21. 05 Feb, 2008 1 commit
  22. 28 Jan, 2008 1 commit
  23. 26 Jan, 2008 1 commit
  24. 12 Oct, 2007 2 commits
    • Sam Ravnborg's avatar
      [S390] s390: use PAGE_SIZE in vmlinux.lds · 52480ee5
      Sam Ravnborg authored
      Replace the hardcoded 4096 value with the PAGE_SIZE macro.
      Converted a few decimal numbers to readable hex numbers.
      Use of PAGE_SIZE required a small change to page.h
      to allow PAGE_SIZE to be used from assembler/linker scripts.
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    • Sam Ravnborg's avatar
      [S390] s390: beautify vmlinux.lds · e16af09d
      Sam Ravnborg authored
      Introduce a consistent style in vmlinux.lds.
      This style is gradually being introduced for all archs.
      A few lables were moved inside the section definition so
      they are assigned the correct value of gcc decide to align
      the content to another address than the one . has.
      In the past this has fixed several bugs but for s390 it
      will not impact due to all the alignmnet already introduced.
      Stabs definitions are consolidated in asm-generic/vmlinux.lds.h
      This patch also introduce support for DWARF - without knowing
      if this makes sense for s390.
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
  25. 27 Jul, 2007 1 commit
  26. 19 Jul, 2007 2 commits
    • Roland McGrath's avatar
      s390: Put allocated ELF notes in read-only data segment · 86ead9ca
      Roland McGrath authored
      This changes the s390 linker script to use the asm-generic NOTES macro so that
      ELF note sections with SHF_ALLOC set are linked into the kernel image along
      with other read-only data.  The PT_NOTE also points to their location.
      This paves the way for putting useful build-time information into ELF notes
      that can be found easily later in a kernel memory dump.
      Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    • Fenghua Yu's avatar
      define new percpu interface for shared data · 5fb7dc37
      Fenghua Yu authored
      per cpu data section contains two types of data.  One set which is
      exclusively accessed by the local cpu and the other set which is per cpu,
      but also shared by remote cpus.  In the current kernel, these two sets are
      not clearely separated out.  This can potentially cause the same data
      cacheline shared between the two sets of data, which will result in
      unnecessary bouncing of the cacheline between cpus.
      One way to fix the problem is to cacheline align the remotely accessed per
      cpu data, both at the beginning and at the end.  Because of the padding at
      both ends, this will likely cause some memory wastage and also the
      interface to achieve this is not clean.
      This patch:
      Moves the remotely accessed per cpu data (which is currently marked
      as ____cacheline_aligned_in_smp) into a different section, where all the data
      elements are cacheline aligned. And as such, this differentiates the local
      only data and remotely accessed data cleanly.
      Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
      Acked-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Christoph Lameter <clameter@sgi.com>
      Cc: <linux-arch@vger.kernel.org>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  27. 19 May, 2007 2 commits
  28. 02 May, 2007 1 commit
  29. 27 Apr, 2007 1 commit
  30. 11 Feb, 2007 1 commit
  31. 05 Feb, 2007 2 commits
  32. 27 Oct, 2006 1 commit
  33. 20 Sep, 2006 2 commits