1. 30 11月, 2019 1 次提交
  2. 20 11月, 2019 1 次提交
    • V
      s390/kasan: support memcpy_real with TRACE_IRQFLAGS · 13f9bae5
      Vasily Gorbik 提交于
      Currently if the kernel is built with CONFIG_TRACE_IRQFLAGS and KASAN
      and used as crash kernel it crashes itself due to
      trace_hardirqs_off/trace_hardirqs_on being called with DAT off. This
      happens because trace_hardirqs_off/trace_hardirqs_on are instrumented and
      kasan code tries to perform access to shadow memory to validate memory
      accesses. Kasan shadow memory is populated with vmemmap, so all accesses
      require DAT on.
      
      memcpy_real could be called with DAT on or off (with kasan enabled DAT
      is set even before early code is executed).
      
      Make sure that trace_hardirqs_off/trace_hardirqs_on are called with DAT
      on and only actual __memcpy_real is called with DAT off.
      
      Also annotate __memcpy_real and _memcpy_real with __no_sanitize_address
      to avoid further problems due to switching DAT off.
      Reviewed-by: NPhilipp Rudo <prudo@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      13f9bae5
  3. 04 6月, 2019 1 次提交
  4. 02 5月, 2019 1 次提交
    • M
      s390/unwind: introduce stack unwind API · 78c98f90
      Martin Schwidefsky 提交于
      Rework the dump_trace() stack unwinder interface to support different
      unwinding algorithms. The new interface looks like this:
      
      	struct unwind_state state;
      	unwind_for_each_frame(&state, task, regs, start_stack)
      		do_something(state.sp, state.ip, state.reliable);
      
      The unwind_bc.c file contains the implementation for the classic
      back-chain unwinder.
      
      One positive side effect of the new code is it now handles ftraced
      functions gracefully. It prints the real name of the return function
      instead of 'return_to_handler'.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      78c98f90
  5. 09 10月, 2018 1 次提交
    • M
      s390: add support for virtually mapped kernel stacks · ce3dc447
      Martin Schwidefsky 提交于
      With virtually mapped kernel stacks the kernel stack overflow detection
      is now fault based, every stack has a guard page in the vmalloc space.
      The panic_stack is renamed to nodat_stack and is used for all function
      that need to run without DAT, e.g. memcpy_real or do_start_kdump.
      
      The main effect is a reduction in the kernel image size as with vmap
      stacks the old style overflow checking that adds two instructions per
      function is not needed anymore. Result from bloat-o-meter:
      
      add/remove: 20/1 grow/shrink: 13/26854 up/down: 2198/-216240 (-214042)
      
      In regard to performance the micro-benchmark for fork has a hit of a
      few microseconds, allocating 4 pages in vmalloc space is more expensive
      compare to an order-2 page allocation. But with real workload I could
      not find a noticeable difference.
      Acked-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      ce3dc447
  6. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  7. 17 2月, 2016 1 次提交
  8. 11 2月, 2016 1 次提交
  9. 11 1月, 2016 1 次提交
  10. 25 3月, 2015 2 次提交
    • H
      s390/maccess: improve s390_kernel_write() · 3c1a3bce
      Heiko Carstens 提交于
      Use the sturg instruction instead of the stura instruction. This allows to
      modify up to eight bytes in a row instead of only four.
      
      For function tracer enabling and disabling this reduces the time needed to
      modify the text sections by 50%, since for each mcount call site six bytes
      need to be changed.
      
      Also remove the EXTABLE entries, since calls to this function are not
      supposed to fail.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      3c1a3bce
    • H
      s390/maccess: remove potentially broken probe_kernel_write() · 8a5d8473
      Heiko Carstens 提交于
      Remove the s390 architecture implementation of probe_kernel_write() and
      instead use a new function s390_kernel_write() to modify kernel text and
      data everywhere.
      
      The s390 implementation of probe_kernel_write() was potentially broken
      since it modified memory in a read-modify-write fashion, which read four
      bytes, modified the requested bytes within those four bytes and wrote
      the result back.
      If two cpus would modify the same four byte area at different locations
      within that area, this could lead to corruption.
      Right now the only places which called probe_kernel_write() did run within
      stop_machine_run. Therefore the scenario can't happen right now, however
      that might change at any time.
      
      To fix this rename probe_kernel_write() to s390_kernel_write() which can
      have special semantics, like only call it while running within stop_machine().
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      8a5d8473
  11. 10 11月, 2014 1 次提交
    • T
      /dev/mem: Use more consistent data types · 4707a341
      Thierry Reding 提交于
      The xlate_dev_{kmem,mem}_ptr() functions take either a physical address
      or a kernel virtual address, so data types should be phys_addr_t and
      void *. They both return a kernel virtual address which is only ever
      used in calls to copy_{from,to}_user(), so make variables that store it
      void * rather than char * for consistency.
      
      Also only define a weak unxlate_dev_mem_ptr() function if architectures
      haven't overridden them in the asm/io.h header file.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      4707a341
  12. 25 2月, 2014 1 次提交
  13. 21 2月, 2014 1 次提交
  14. 07 9月, 2013 1 次提交
  15. 30 5月, 2012 1 次提交
  16. 16 5月, 2012 1 次提交
    • M
      s390: allow absolute memory access for /dev/mem · b2a68c23
      Michael Holzheu 提交于
      Currently dev/mem for s390 provides only real memory access. This means
      that the CPU prefix pages are swapped. The prefix swap for real memory
      works as follows:
      
      Each CPU owns a prefix register that points to a page aligned memory
      location "P". If this CPU accesses the address range [0,0x1fff], it is
      translated by the hardware to [P,P+0x1fff]. Accordingly if this CPU
      accesses the address range [P,P+0x1fff], it is translated by the hardware
      to [0,0x1fff].  Therefore, if [P,P+0x1fff] or [0,0x1fff] is read from
      the current /dev/mem device, the incorrectly swapped memory content is
      returned.
      
      With this patch the /dev/mem architecture code is modified to provide
      absolute memory access. This is done via the arch specific functions
      xlate_dev_mem_ptr() and unxlate_dev_mem_ptr(). For swapped pages on
      s390 the function xlate_dev_mem_ptr() now returns a new buffer with a
      copy of the requested absolute memory. In case the buffer was allocated,
      the unxlate_dev_mem_ptr() function frees it after /dev/mem code has
      called copy_to_user().
      Signed-off-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      b2a68c23
  17. 11 4月, 2012 1 次提交
  18. 29 3月, 2012 1 次提交
  19. 30 10月, 2011 1 次提交
  20. 03 8月, 2011 1 次提交
  21. 26 5月, 2011 1 次提交
  22. 07 10月, 2010 1 次提交
    • D
      Fix IRQ flag handling naming · df9ee292
      David Howells 提交于
      Fix the IRQ flag handling naming.  In linux/irqflags.h under one configuration,
      it maps:
      
      	local_irq_enable() -> raw_local_irq_enable()
      	local_irq_disable() -> raw_local_irq_disable()
      	local_irq_save() -> raw_local_irq_save()
      	...
      
      and under the other configuration, it maps:
      
      	raw_local_irq_enable() -> local_irq_enable()
      	raw_local_irq_disable() -> local_irq_disable()
      	raw_local_irq_save() -> local_irq_save()
      	...
      
      This is quite confusing.  There should be one set of names expected of the
      arch, and this should be wrapped to give another set of names that are expected
      by users of this facility.
      
      Change this to have the arch provide:
      
      	flags = arch_local_save_flags()
      	flags = arch_local_irq_save()
      	arch_local_irq_restore(flags)
      	arch_local_irq_disable()
      	arch_local_irq_enable()
      	arch_irqs_disabled_flags(flags)
      	arch_irqs_disabled()
      	arch_safe_halt()
      
      Then linux/irqflags.h wraps these to provide:
      
      	raw_local_save_flags(flags)
      	raw_local_irq_save(flags)
      	raw_local_irq_restore(flags)
      	raw_local_irq_disable()
      	raw_local_irq_enable()
      	raw_irqs_disabled_flags(flags)
      	raw_irqs_disabled()
      	raw_safe_halt()
      
      with type checking on the flags 'arguments', and then wraps those to provide:
      
      	local_save_flags(flags)
      	local_irq_save(flags)
      	local_irq_restore(flags)
      	local_irq_disable()
      	local_irq_enable()
      	irqs_disabled_flags(flags)
      	irqs_disabled()
      	safe_halt()
      
      with tracing included if enabled.
      
      The arch functions can now all be inline functions rather than some of them
      having to be macros.
      
      Signed-off-by: David Howells <dhowells@redhat.com> [X86, FRV, MN10300]
      Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> [Tile]
      Signed-off-by: Michal Simek <monstr@monstr.eu> [Microblaze]
      Tested-by: Catalin Marinas <catalin.marinas@arm.com> [ARM]
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> [AVR]
      Acked-by: Tony Luck <tony.luck@intel.com> [IA-64]
      Acked-by: Hirokazu Takata <takata@linux-m32r.org> [M32R]
      Acked-by: Greg Ungerer <gerg@uclinux.org> [M68K/M68KNOMMU]
      Acked-by: Ralf Baechle <ralf@linux-mips.org> [MIPS]
      Acked-by: Kyle McMartin <kyle@mcmartin.ca> [PA-RISC]
      Acked-by: Paul Mackerras <paulus@samba.org> [PowerPC]
      Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> [S390]
      Acked-by: Chen Liqin <liqin.chen@sunplusct.com> [Score]
      Acked-by: Matt Fleming <matt@console-pimps.org> [SH]
      Acked-by: David S. Miller <davem@davemloft.net> [Sparc]
      Acked-by: Chris Zankel <chris@zankel.net> [Xtensa]
      Reviewed-by: Richard Henderson <rth@twiddle.net> [Alpha]
      Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp> [H8300]
      Cc: starvik@axis.com [CRIS]
      Cc: jesper.nilsson@axis.com [CRIS]
      Cc: linux-cris-kernel@axis.com
      df9ee292
  23. 24 3月, 2010 1 次提交
  24. 12 6月, 2009 1 次提交
新手
引导
客服 返回
顶部