Skip to content
Snippets Groups Projects
  1. May 05, 2019
  2. May 03, 2019
  3. Apr 15, 2019
  4. Apr 06, 2019
    • Helge Deller's avatar
      parisc: Detect QEMU earlier in boot process · d006e95b
      Helge Deller authored
      
      While adding LASI support to QEMU, I noticed that the QEMU detection in
      the kernel happens much too late. For example, when a LASI chip is found
      by the kernel, it registers the LASI LED driver as well.  But when we
      run on QEMU it makes sense to avoid spending unnecessary CPU cycles, so
      we need to access the running_on_QEMU flag earlier than before.
      
      This patch now makes the QEMU detection the fist task of the Linux
      kernel by moving it to where the kernel enters the C-coding.
      
      Fixes: 310d8278 ("parisc: qemu idle sleep support")
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Cc: stable@vger.kernel.org # v4.14+
      d006e95b
  5. Feb 21, 2019
  6. Feb 06, 2019
    • Arnd Bergmann's avatar
      y2038: add 64-bit time_t syscalls to all 32-bit architectures · 48166e6e
      Arnd Bergmann authored
      
      This adds 21 new system calls on each ABI that has 32-bit time_t
      today. All of these have the exact same semantics as their existing
      counterparts, and the new ones all have macro names that end in 'time64'
      for clarification.
      
      This gets us to the point of being able to safely use a C library
      that has 64-bit time_t in user space. There are still a couple of
      loose ends to tie up in various areas of the code, but this is the
      big one, and should be entirely uncontroversial at this point.
      
      In particular, there are four system calls (getitimer, setitimer,
      waitid, and getrusage) that don't have a 64-bit counterpart yet,
      but these can all be safely implemented in the C library by wrapping
      around the existing system calls because the 32-bit time_t they
      pass only counts elapsed time, not time since the epoch. They
      will be dealt with later.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      48166e6e
    • Arnd Bergmann's avatar
      y2038: rename old time and utime syscalls · d33c577c
      Arnd Bergmann authored
      
      The time, stime, utime, utimes, and futimesat system calls are only
      used on older architectures, and we do not provide y2038 safe variants
      of them, as they are replaced by clock_gettime64, clock_settime64,
      and utimensat_time64.
      
      However, for consistency it seems better to have the 32-bit architectures
      that still use them call the "time32" entry points (leaving the
      traditional handlers for the 64-bit architectures), like we do for system
      calls that now require two versions.
      
      Note: We used to always define __ARCH_WANT_SYS_TIME and
      __ARCH_WANT_SYS_UTIME and only set __ARCH_WANT_COMPAT_SYS_TIME and
      __ARCH_WANT_SYS_UTIME32 for compat mode on 64-bit kernels. Now this is
      reversed: only 64-bit architectures set __ARCH_WANT_SYS_TIME/UTIME, while
      we need __ARCH_WANT_SYS_TIME32/UTIME32 for 32-bit architectures and compat
      mode. The resulting asm/unistd.h changes look a bit counterintuitive.
      
      This is only a cleanup patch and it should not change any behavior.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      d33c577c
    • Arnd Bergmann's avatar
      y2038: use time32 syscall names on 32-bit · 00bf25d6
      Arnd Bergmann authored
      
      This is the big flip, where all 32-bit architectures set COMPAT_32BIT_TIME
      and use the _time32 system calls from the former compat layer instead
      of the system calls that take __kernel_timespec and similar arguments.
      
      The temporary redirects for __kernel_timespec, __kernel_itimerspec
      and __kernel_timex can get removed with this.
      
      It would be easy to split this commit by architecture, but with the new
      generated system call tables, it's easy enough to do it all at once,
      which makes it a little easier to check that the changes are the same
      in each table.
      
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      00bf25d6
    • Arnd Bergmann's avatar
      y2038: syscalls: rename y2038 compat syscalls · 8dabe724
      Arnd Bergmann authored
      
      A lot of system calls that pass a time_t somewhere have an implementation
      using a COMPAT_SYSCALL_DEFINEx() on 64-bit architectures, and have
      been reworked so that this implementation can now be used on 32-bit
      architectures as well.
      
      The missing step is to redefine them using the regular SYSCALL_DEFINEx()
      to get them out of the compat namespace and make it possible to build them
      on 32-bit architectures.
      
      Any system call that ends in 'time' gets a '32' suffix on its name for
      that version, while the others get a '_time32' suffix, to distinguish
      them from the normal version, which takes a 64-bit time argument in the
      future.
      
      In this step, only 64-bit architectures are changed, doing this rename
      first lets us avoid touching the 32-bit architectures twice.
      
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      8dabe724
  7. Jan 25, 2019
  8. Dec 20, 2018
    • Christoph Hellwig's avatar
      dma-mapping: zero memory returned from dma_alloc_* · 518a2f19
      Christoph Hellwig authored
      
      If we want to map memory from the DMA allocator to userspace it must be
      zeroed at allocation time to prevent stale data leaks.   We already do
      this on most common architectures, but some architectures don't do this
      yet, fix them up, either by passing GFP_ZERO when we use the normal page
      allocator or doing a manual memset otherwise.
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
      Acked-by: Sam Ravnborg <sam@ravnborg.org> [sparc]
      518a2f19
  9. Dec 13, 2018
  10. Dec 10, 2018
    • Firoz Khan's avatar
      parisc: generate uapi header and system call table files · 575afc4d
      Firoz Khan authored
      
      System call table generation script must be run to gener-
      ate unistd_32/64.h and syscall_table_32/64/c32.h files.
      This patch will have changes which will invokes the script.
      
      This patch will generate unistd_32/64.h and syscall_table-
      _32/64/c32.h files by the syscall table generation script
      invoked by parisc/Makefile and the generated files against
      the removed files must be identical.
      
      The generated uapi header file will be included in uapi/-
      asm/unistd.h and generated system call table header file
      will be included by kernel/syscall.S file.
      
      Signed-off-by: default avatarFiroz Khan <firoz.khan@linaro.org>
      Acked-by: default avatarHelge Deller <deller@gmx.de>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      575afc4d
    • Firoz Khan's avatar
      parisc: add system call table generation support · 85e69701
      Firoz Khan authored
      
      The system call tables are in different format in all
      architecture and it will be difficult to manually add,
      modify or delete the syscall table entries in the res-
      pective files. To make it easy by keeping a script and
      which will generate the uapi header and syscall table
      file. This change will also help to unify the implemen-
      tation across all architectures.
      
      The system call table generation script is added in
      kernel/syscalls directory which contain the scripts to
      generate both uapi header file and system call table
      files. The syscall.tbl will be input for the scripts.
      
      syscall.tbl contains the list of available system calls
      along with system call number and corresponding entry
      point. Add a new system call in this architecture will
      be possible by adding new entry in the syscall.tbl file.
      
      Adding a new table entry consisting of:
        	- System call number.
      	- ABI.
      	- System call name.
      	- Entry point name.
      	- Compat entry name, if required.
      
      syscallhdr.sh and syscalltbl.sh will generate uapi header
      unistd_32/64.h and syscall_table_32/64/c32.h files respect-
      ively. Both .sh files will parse the content syscall.tbl
      to generate the header and table files. unistd_32/64.h will
      be included by uapi/asm/unistd.h and syscall_table_32/64/-
      c32.h is included by kernel/syscall.S - the real system
      call table.
      
      ARM, s390 and x86 architecuture does have similar support.
      I leverage their implementation to come up with a generic
      solution.
      
      Signed-off-by: default avatarFiroz Khan <firoz.khan@linaro.org>
      Acked-by: default avatarHelge Deller <deller@gmx.de>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      85e69701
    • Helge Deller's avatar
      parisc: Split out alternative live patching code · 8cc28269
      Helge Deller authored
      
      Move the alternative implemenation coding to alternative.c and add code to
      patch modules while loading.
      
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      8cc28269
  11. Nov 28, 2018
    • Steven Rostedt (VMware)'s avatar
      parisc: function_graph: Simplify with function_graph_enter() · a87532c7
      Steven Rostedt (VMware) authored
      
      The function_graph_enter() function does the work of calling the function
      graph hook function and the management of the shadow stack, simplifying the
      work done in the architecture dependent prepare_ftrace_return().
      
      Have parisc use the new code, and remove the shadow stack management as well as
      having to set up the trace structure.
      
      This is needed to prepare for a fix of a design bug on how the curr_ret_stack
      is used.
      
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: linux-parisc@vger.kernel.org
      Cc: stable@kernel.org
      Fixes: 03274a3f ("tracing/fgraph: Adjust fgraph depth before calling trace return callback")
      Reviewed-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      a87532c7
  12. Nov 06, 2018
    • John David Anglin's avatar
      parisc: Revert "Release spinlocks using ordered store" · 86d4d068
      John David Anglin authored
      
      This reverts commit d27dfa13.
      
      Unfortunately, this patch needs to be reverted.  We need the full sync
      barrier and not the limited barrier provided by using an ordered store.
      The sync ensures that all accesses and cache purge instructions that
      follow the sync are performed after all such instructions prior the sync
      instruction have completed executing.
      
      The patch breaks the rwlock implementation in glibc.  This caused the
      test-lock application in the libprelude testsuite to hang.  With the
      change reverted, the test runs correctly and the libprelude package
      builds successfully.
      
      Signed-off-by: default avatarJohn David Anglin <dave.anglin@bell.net>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      86d4d068
  13. Oct 26, 2018
  14. Oct 20, 2018
    • Helge Deller's avatar
      e543b3a6
    • John David Anglin's avatar
      parisc: Optimze cache flush algorithms · 4c5fe5db
      John David Anglin authored
      
      The attached patch implements three optimizations:
      
      1) Loops in flush_user_dcache_range_asm, flush_kernel_dcache_range_asm,
      purge_kernel_dcache_range_asm, flush_user_icache_range_asm, and
      flush_kernel_icache_range_asm are unrolled to reduce branch overhead.
      
      2) The static branch prediction for cmpb instructions in pacache.S have
      been reviewed and the operand order adjusted where necessary.
      
      3) For flush routines in cache.c, we purge rather flush when we have no
      context.  The pdc instruction at level 0 is not required to write back
      dirty lines to memory. This provides a performance improvement over the
      fdc instruction if the feature is implemented.
      
      Version 2 adds alternative patching.
      
      The patch provides an average improvement of about 2%.
      
      Signed-off-by: default avatarJohn David Anglin <dave.anglin@bell.net>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      4c5fe5db
Loading