1. 21 5月, 2019 1 次提交
  2. 15 5月, 2019 3 次提交
  3. 03 4月, 2019 2 次提交
    • W
      locking/rwsem: Remove rwsem-spinlock.c & use rwsem-xadd.c for all archs · 390a0c62
      Waiman Long 提交于
      Currently, we have two different implementation of rwsem:
      
       1) CONFIG_RWSEM_GENERIC_SPINLOCK (rwsem-spinlock.c)
       2) CONFIG_RWSEM_XCHGADD_ALGORITHM (rwsem-xadd.c)
      
      As we are going to use a single generic implementation for rwsem-xadd.c
      and no architecture-specific code will be needed, there is no point
      in keeping two different implementations of rwsem. In most cases, the
      performance of rwsem-spinlock.c will be worse. It also doesn't get all
      the performance tuning and optimizations that had been implemented in
      rwsem-xadd.c over the years.
      
      For simplication, we are going to remove rwsem-spinlock.c and make all
      architectures use a single implementation of rwsem - rwsem-xadd.c.
      
      All references to RWSEM_GENERIC_SPINLOCK and RWSEM_XCHGADD_ALGORITHM
      in the code are removed.
      Suggested-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NWaiman Long <longman@redhat.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-c6x-dev@linux-c6x.org
      Cc: linux-m68k@lists.linux-m68k.org
      Cc: linux-riscv@lists.infradead.org
      Cc: linux-um@lists.infradead.org
      Cc: linux-xtensa@linux-xtensa.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: nios2-dev@lists.rocketboards.org
      Cc: openrisc@lists.librecores.org
      Cc: uclinux-h8-devel@lists.sourceforge.jp
      Link: https://lkml.kernel.org/r/20190322143008.21313-3-longman@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      390a0c62
    • P
      asm-generic/tlb, arch: Invert CONFIG_HAVE_RCU_TABLE_INVALIDATE · 96bc9567
      Peter Zijlstra 提交于
      Make issuing a TLB invalidate for page-table pages the normal case.
      
      The reason is twofold:
      
       - too many invalidates is safer than too few,
       - most architectures use the linux page-tables natively
         and would thus require this.
      
      Make it an opt-out, instead of an opt-in.
      
      No change in behavior intended.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      96bc9567
  4. 19 2月, 2019 1 次提交
    • Y
      32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option · 942fa985
      Yury Norov 提交于
      All new 32-bit architectures should have 64-bit userspace off_t type, but
      existing architectures has 32-bit ones.
      
      To enforce the rule, new config option is added to arch/Kconfig that defaults
      ARCH_32BIT_OFF_T to be disabled for new 32-bit architectures. All existing
      32-bit architectures enable it explicitly.
      
      New option affects force_o_largefile() behaviour. Namely, if userspace
      off_t is 64-bits long, we have no reason to reject user to open big files.
      
      Note that even if architectures has only 64-bit off_t in the kernel
      (arc, c6x, h8300, hexagon, nios2, openrisc, and unicore32),
      a libc may use 32-bit off_t, and therefore want to limit the file size
      to 4GB unless specified differently in the open flags.
      Signed-off-by: NYury Norov <ynorov@caviumnetworks.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NYury Norov <ynorov@marvell.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      942fa985
  5. 21 12月, 2018 1 次提交
  6. 14 12月, 2018 1 次提交
  7. 06 12月, 2018 1 次提交
  8. 23 11月, 2018 4 次提交
  9. 31 10月, 2018 2 次提交
  10. 20 9月, 2018 1 次提交
  11. 22 8月, 2018 2 次提交
  12. 02 8月, 2018 3 次提交
  13. 15 6月, 2018 1 次提交
  14. 08 6月, 2018 1 次提交
    • L
      mm: introduce ARCH_HAS_PTE_SPECIAL · 3010a5ea
      Laurent Dufour 提交于
      Currently the PTE special supports is turned on in per architecture
      header files.  Most of the time, it is defined in
      arch/*/include/asm/pgtable.h depending or not on some other per
      architecture static definition.
      
      This patch introduce a new configuration variable to manage this
      directly in the Kconfig files.  It would later replace
      __HAVE_ARCH_PTE_SPECIAL.
      
      Here notes for some architecture where the definition of
      __HAVE_ARCH_PTE_SPECIAL is not obvious:
      
      arm
       __HAVE_ARCH_PTE_SPECIAL which is currently defined in
      arch/arm/include/asm/pgtable-3level.h which is included by
      arch/arm/include/asm/pgtable.h when CONFIG_ARM_LPAE is set.
      So select ARCH_HAS_PTE_SPECIAL if ARM_LPAE.
      
      powerpc
      __HAVE_ARCH_PTE_SPECIAL is defined in 2 files:
       - arch/powerpc/include/asm/book3s/64/pgtable.h
       - arch/powerpc/include/asm/pte-common.h
      The first one is included if (PPC_BOOK3S & PPC64) while the second is
      included in all the other cases.
      So select ARCH_HAS_PTE_SPECIAL all the time.
      
      sparc:
      __HAVE_ARCH_PTE_SPECIAL is defined if defined(__sparc__) &&
      defined(__arch64__) which are defined through the compiler in
      sparc/Makefile if !SPARC32 which I assume to be if SPARC64.
      So select ARCH_HAS_PTE_SPECIAL if SPARC64
      
      There is no functional change introduced by this patch.
      
      Link: http://lkml.kernel.org/r/1523433816-14460-2-git-send-email-ldufour@linux.vnet.ibm.comSigned-off-by: NLaurent Dufour <ldufour@linux.vnet.ibm.com>
      Suggested-by: NJerome Glisse <jglisse@redhat.com>
      Reviewed-by: NJerome Glisse <jglisse@redhat.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: "Aneesh Kumar K . V" <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Rich Felker <dalias@libc.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Albert Ou <albert@sifive.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Christophe LEROY <christophe.leroy@c-s.fr>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3010a5ea
  15. 29 5月, 2018 1 次提交
    • M
      kconfig: reference environment variables directly and remove 'option env=' · 104daea1
      Masahiro Yamada 提交于
      To get access to environment variables, Kconfig needs to define a
      symbol using "option env=" syntax.  It is tedious to add a symbol entry
      for each environment variable given that we need to define much more
      such as 'CC', 'AS', 'srctree' etc. to evaluate the compiler capability
      in Kconfig.
      
      Adding '$' for symbol references is grammatically inconsistent.
      Looking at the code, the symbols prefixed with 'S' are expanded by:
       - conf_expand_value()
         This is used to expand 'arch/$ARCH/defconfig' and 'defconfig_list'
       - sym_expand_string_value()
         This is used to expand strings in 'source' and 'mainmenu'
      
      All of them are fixed values independent of user configuration.  So,
      they can be changed into the direct expansion instead of symbols.
      
      This change makes the code much cleaner.  The bounce symbols 'SRCARCH',
      'ARCH', 'SUBARCH', 'KERNELVERSION' are gone.
      
      sym_init() hard-coding 'UNAME_RELEASE' is also gone.  'UNAME_RELEASE'
      should be replaced with an environment variable.
      
      ARCH_DEFCONFIG is a normal symbol, so it should be simply referenced
      without '$' prefix.
      
      The new syntax is addicted by Make.  The variable reference needs
      parentheses, like $(FOO), but you can omit them for single-letter
      variables, like $F.  Yet, in Makefiles, people tend to use the
      parenthetical form for consistency / clarification.
      
      At this moment, only the environment variable is supported, but I will
      extend the concept of 'variable' later on.
      
      The variables are expanded in the lexer so we can simplify the token
      handling on the parser side.
      
      For example, the following code works.
      
      [Example code]
      
        config MY_TOOLCHAIN_LIST
                string
                default "My tools: CC=$(CC), AS=$(AS), CPP=$(CPP)"
      
      [Result]
      
        $ make -s alldefconfig && tail -n 1 .config
        CONFIG_MY_TOOLCHAIN_LIST="My tools: CC=gcc, AS=as, CPP=gcc -E"
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      104daea1
  16. 09 5月, 2018 4 次提交
  17. 08 5月, 2018 1 次提交
  18. 16 2月, 2018 1 次提交
  19. 17 11月, 2017 1 次提交
  20. 15 11月, 2017 1 次提交
    • N
      vDSO for sparc · 9a08862a
      Nagarathnam Muthusamy 提交于
      Following patch is based on work done by Nick Alcock on 64-bit vDSO for sparc
      in Oracle linux. I have extended it to include support for 32-bit vDSO for sparc
      on 64-bit kernel.
      
      vDSO for sparc is based on the X86 implementation. This patch
      provides vDSO support for both 64-bit and 32-bit programs on 64-bit kernel.
      vDSO will be disabled on 32-bit linux kernel on sparc.
      
      *) vclock_gettime.c contains all the vdso functions. Since data page is mapped
         before the vdso code page, the pointer to data page is got by subracting offset
         from an address in the vdso code page. The return address stored in
         %i7 is used for this purpose.
      *) During compilation, both 32-bit and 64-bit vdso images are compiled and are
         converted into raw bytes by vdso2c program to be ready for mapping into the
         process. 32-bit images are compiled only if CONFIG_COMPAT is enabled. vdso2c
         generates two files vdso-image-64.c and vdso-image-32.c which contains the
         respective vDSO image in C structure.
      *) During vdso initialization, required number of vdso pages are allocated and
         raw bytes are copied into the pages.
      *) During every exec, these pages are mapped into the process through
         arch_setup_additional_pages and the location of mapping is passed on to the
         process through aux vector AT_SYSINFO_EHDR which is used by glibc.
      *) A new update_vsyscall routine for sparc is added to keep the data page in
         vdso updated.
      *) As vDSO cannot contain dynamically relocatable references, a new version of
         cpu_relax is added for the use of vDSO.
      
      This change also requires a putback to glibc to use vDSO. For testing,
      programs planning to try vDSO can be compiled against the generated
      vdso(64/32).so in the source.
      
      Testing:
      
      ========
      [root@localhost ~]# cat vdso_test.c
      int main() {
              struct timespec tv_start, tv_end;
              struct timeval tv_tmp;
      	int i;
              int count = 1 * 1000 * 10000;
      	long long diff;
      
              clock_gettime(0, &tv_start);
              for (i = 0; i < count; i++)
                    gettimeofday(&tv_tmp, NULL);
              clock_gettime(0, &tv_end);
              diff = (long long)(tv_end.tv_sec -
      		tv_start.tv_sec)*(1*1000*1000*1000);
              diff += (tv_end.tv_nsec - tv_start.tv_nsec);
      	printf("Start sec: %d\n", tv_start.tv_sec);
      	printf("End sec  : %d\n", tv_end.tv_sec);
              printf("%d cycles in %lld ns = %f ns/cycle\n", count, diff,
      		(double)diff / (double)count);
              return 0;
      }
      
      [root@localhost ~]# cc vdso_test.c -o t32_without_fix -m32 -lrt
      [root@localhost ~]# ./t32_without_fix
      Start sec: 1502396130
      End sec  : 1502396140
      10000000 cycles in 9565148528 ns = 956.514853 ns/cycle
      [root@localhost ~]# cc vdso_test.c -o t32_with_fix -m32 ./vdso32.so.dbg
      [root@localhost ~]# ./t32_with_fix
      Start sec: 1502396168
      End sec  : 1502396169
      10000000 cycles in 798141262 ns = 79.814126 ns/cycle
      [root@localhost ~]# cc vdso_test.c -o t64_without_fix -m64 -lrt
      [root@localhost ~]# ./t64_without_fix
      Start sec: 1502396208
      End sec  : 1502396218
      10000000 cycles in 9846091800 ns = 984.609180 ns/cycle
      [root@localhost ~]# cc vdso_test.c -o t64_with_fix -m64 ./vdso64.so.dbg
      [root@localhost ~]# ./t64_with_fix
      Start sec: 1502396257
      End sec  : 1502396257
      10000000 cycles in 380984048 ns = 38.098405 ns/cycle
      
      V1 to V2 Changes:
      =================
      	Added hot patching code to switch the read stick instruction to read
      tick instruction based on the hardware.
      
      V2 to V3 Changes:
      =================
      	Merged latest changes from sparc-next and moved the initialization
      of clocksource_tick.archdata.vclock_mode to time_init_early. Disabled
      queued spinlock and rwlock configuration when simulating 32-bit config
      to compile 32-bit VDSO.
      
      V3 to V4 Changes:
      =================
      	Hardcoded the page size as 8192 in linker script for both 64-bit and
      32-bit binaries. Removed unused variables in vdso2c.h. Added -mv8plus flag to
      Makefile to prevent the generation of relocation entries for __lshrdi3 in 32-bit
      vdso binary.
      Signed-off-by: NNick Alcock <nick.alcock@oracle.com>
      Signed-off-by: NNagarathnam Muthusamy <nagarathnam.muthusamy@oracle.com>
      Reviewed-by: NShannon Nelson <shannon.nelson@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9a08862a
  21. 09 10月, 2017 1 次提交
  22. 09 9月, 2017 1 次提交
  23. 09 6月, 2017 1 次提交
  24. 07 6月, 2017 1 次提交
  25. 27 5月, 2017 1 次提交
  26. 26 5月, 2017 2 次提交