1. 15 12月, 2018 6 次提交
    • F
      mips: generate uapi header and system call table files · 99bf73eb
      Firoz Khan 提交于
      System call table generation script must be run to gener-
      ate unistd_(nr_)n64/n32/o32.h and syscall_table_32_o32/
      64_n64/64_n32/64-o32.h files. This patch will have changes
      which will invokes the script.
      
      This patch will generate unistd_(nr_)n64/n32/o32.h and
      syscall_table_32_o32/64_n64/64-n32/64-o32.h files by the
      syscall table generation script invoked by parisc/Make-
      file 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/scall32-o32/64-n64/64-n32/-
      64-o32.Sfile.
      Signed-off-by: NFiroz Khan <firoz.khan@linaro.org>
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Cc: linux-mips@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: y2038@lists.linaro.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-arch@vger.kernel.org
      Cc: arnd@arndb.de
      Cc: deepa.kernel@gmail.com
      Cc: marcin.juszkiewicz@linaro.org
      99bf73eb
    • F
      mips: add system call table generation support · 9bcbf97c
      Firoz Khan 提交于
      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, syscallnr.sh and syscalltbl.sh will gene-
      rate uapi header unistd_n64/n32/o32.h, unistd_nr_n64/n32/-
      o32.h and syscall_table_32_o32/64_n64/64-n32/64-o32.h files
      respectively. All *.sh files will parse the content sys-
      call.tbl to generate the header and table files. unistd-
      _n64/n32/o32.h and unistd_nr_n64/n32/o32.h will be included
      by uapi/asm/unistd.h and syscall_table_32_o32/64_n64/64-n32-
      /64-o32.h is included by kernel/syscall_table32_o32/64-
      _n64/64-n32/64-o32.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: NFiroz Khan <firoz.khan@linaro.org>
      [paul.burton@mips.com:
       - Change sysnr_pfx_unistd_nr_n64 to 64.]
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Cc: linux-mips@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: y2038@lists.linaro.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-arch@vger.kernel.org
      Cc: arnd@arndb.de
      Cc: deepa.kernel@gmail.com
      Cc: marcin.juszkiewicz@linaro.org
      9bcbf97c
    • F
      mips: remove syscall table entries · 6a00cb61
      Firoz Khan 提交于
      The config flag - CONFIG_MIPS_MT_FPAFF uses to check whether which
      syscall entries need to be used in scall32-o32.S file.
      
      One of the patch in this patch series will generate syscall table
      file. But CONFIG_MIPS_MT_FPAFF flag will add more complexity in the
      script to generate the syscall table file.
      
      In order to come up with a common implementation across all archit-
      ecture, we need to remove mipsmt_sys_sched_setaffinity and mipsmt-
      _sys_sched_getaffinity from the table and define it in other way.
      Signed-off-by: NFiroz Khan <firoz.khan@linaro.org>
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Cc: linux-mips@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: y2038@lists.linaro.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-arch@vger.kernel.org
      Cc: arnd@arndb.de
      Cc: deepa.kernel@gmail.com
      Cc: marcin.juszkiewicz@linaro.org
      6a00cb61
    • F
      mips: add +1 to __NR_syscalls in uapi header · be856439
      Firoz Khan 提交于
      All other architectures are hold a value for __NR_syscalls will
      be equal to the last system call number +1.
      
      But in mips architecture, __NR_syscalls hold the value equal to
      total number of system exits in the architecture. One of the
      patch in this patch series will genarate uapi header files.
      
      In order to make the implementation common across all architect-
      ures, add +1 to __NR_syscalls, which will be equal to the last
      system call number +1.
      Signed-off-by: NFiroz Khan <firoz.khan@linaro.org>
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Cc: linux-mips@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: y2038@lists.linaro.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-arch@vger.kernel.org
      Cc: arnd@arndb.de
      Cc: deepa.kernel@gmail.com
      Cc: marcin.juszkiewicz@linaro.org
      be856439
    • F
      mips: rename scall64-64.S to scall64-n64.S · 6d92c268
      Firoz Khan 提交于
      When we get nanoMIPS support we'll be introducing the p32
      ABI, and there's a reasonable chance that the equivalent
      p64 ABI may come along in the future. Using 'n64' now would
      avoid confusion in that case where we may have 2 different
      64-bit ABIs.
      Suggested-by: NPaul Burton <paul.burton@mips.com>
      Signed-off-by: NFiroz Khan <firoz.khan@linaro.org>
      [paul.burton@mips.com:
        - Remove UAPI macro renaming, github code search shows at least the
          chromium project uses __NR_64_Linux & __NR_64_Linux_syscalls.]
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Cc: linux-mips@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: y2038@lists.linaro.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-arch@vger.kernel.org
      Cc: arnd@arndb.de
      Cc: deepa.kernel@gmail.com
      Cc: marcin.juszkiewicz@linaro.org
      6d92c268
    • F
      mips: remove unused macros · a5ee2be9
      Firoz Khan 提交于
      Remove __NR_Linux_syscalls from uapi/asm/unistd.h as
      there is no users to use NR_syscalls macro in mips
      kernel.
      
      MAX_SYSCALL_NO can also remove as there is commit
      2957c9e6 ("[MIPS] IRIX: Goodbye and thanks for
      all the fish"), eight years ago.
      Signed-off-by: NFiroz Khan <firoz.khan@linaro.org>
      [paul.burton@mips.com:
       - Drop the removal of NR_syscalls which is used by
         kernel/trace/trace.h.]
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Cc: linux-mips@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: y2038@lists.linaro.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-arch@vger.kernel.org
      Cc: arnd@arndb.de
      Cc: deepa.kernel@gmail.com
      Cc: marcin.juszkiewicz@linaro.org
      a5ee2be9
  2. 14 12月, 2018 1 次提交
    • F
      mips: add __NR_syscalls along with __NR_Linux_syscalls · ef2512c8
      Firoz Khan 提交于
      __NR_Linux_syscalls macro holds the number of system call
      exist in mips architecture. We have to change the value of
      __NR_Linux_syscalls, if we add or delete a system call.
      
      One of the patch in this patch series has a script which
      will generate a uapi header based on syscall.tbl file.
      The syscall.tbl file contains the total number of system
      calls information. So we have two option to update __NR-
      _Linux_syscalls value.
      
      1. Update __NR_Linux_syscalls in asm/unistd.h manually
         by counting the no.of system calls. No need to update
         __NR_Linux_syscalls until we either add a new system
         call or delete existing system call.
      
      2. We can keep this feature it above mentioned script,
         that will count the number of syscalls and keep it in
         a generated file. In this case we don't need to expli-
         citly update __NR_Linux_syscalls in asm/unistd.h file.
      
      The 2nd option will be the recommended one. For that, I
      added the __NR_syscalls macro in uapi/asm/unistd.h along
      with __NR_Linux_syscalls. The macro __NR_syscalls also
      added for making the name convention same across all
      architecture. While __NR_syscalls isn't strictly part of
      the uapi, having it as part of the generated header to
      simplifies the implementation. We also need to enclose
      this macro with #ifdef __KERNEL__ to avoid side effects.
      Signed-off-by: NFiroz Khan <firoz.khan@linaro.org>
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Cc: linux-mips@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: y2038@lists.linaro.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-arch@vger.kernel.org
      Cc: arnd@arndb.de
      Cc: deepa.kernel@gmail.com
      Cc: marcin.juszkiewicz@linaro.org
      ef2512c8
  3. 06 12月, 2018 1 次提交
    • P
      MIPS: Expand MIPS32 ASIDs to 64 bits · ff4dd232
      Paul Burton 提交于
      ASIDs have always been stored as unsigned longs, ie. 32 bits on MIPS32
      kernels. This is problematic because it is feasible for the ASID version
      to overflow & wrap around to zero.
      
      We currently attempt to handle this overflow by simply setting the ASID
      version to 1, using asid_first_version(), but we make no attempt to
      account for the fact that there may be mm_structs with stale ASIDs that
      have versions which we now reuse due to the overflow & wrap around.
      
      Encountering this requires that:
      
        1) A struct mm_struct X is active on CPU A using ASID (V,n).
      
        2) That mm is not used on CPU A for the length of time that it takes
           for CPU A's asid_cache to overflow & wrap around to the same
           version V that the mm had in step 1. During this time tasks using
           the mm could either be sleeping or only scheduled on other CPUs.
      
        3) Some other mm Y becomes active on CPU A and is allocated the same
           ASID (V,n).
      
        4) mm X now becomes active on CPU A again, and now incorrectly has the
           same ASID as mm Y.
      
      Where struct mm_struct ASIDs are represented above in the format
      (version, EntryHi.ASID), and on a typical MIPS32 system version will be
      24 bits wide & EntryHi.ASID will be 8 bits wide.
      
      The length of time required in step 2 is highly dependent upon the CPU &
      workload, but for a hypothetical 2GHz CPU running a workload which
      generates a new ASID every 10000 cycles this period is around 248 days.
      Due to this long period of time & the fact that tasks need to be
      scheduled in just the right (or wrong, depending upon your inclination)
      way, this is obviously a difficult bug to encounter but it's entirely
      possible as evidenced by reports.
      
      In order to fix this, simply extend ASIDs to 64 bits even on MIPS32
      builds. This will extend the period of time required for the
      hypothetical system above to encounter the problem from 28 days to
      around 3 trillion years, which feels safely outside of the realms of
      possibility.
      
      The cost of this is slightly more generated code in some commonly
      executed paths, but this is pretty minimal:
      
                               | Code Size Gain | Percentage
        -----------------------|----------------|-------------
          decstation_defconfig |           +270 | +0.00%
              32r2el_defconfig |           +652 | +0.01%
              32r6el_defconfig |          +1000 | +0.01%
      
      I have been unable to measure any change in performance of the LMbench
      lat_ctx or lat_proc tests resulting from the 64b ASIDs on either
      32r2el_defconfig+interAptiv or 32r6el_defconfig+I6500 systems.
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Suggested-by: NJames Hogan <jhogan@kernel.org>
      References: https://lore.kernel.org/linux-mips/80B78A8B8FEE6145A87579E8435D78C30205D5F3@fzex.ruijie.com.cn/
      References: https://lore.kernel.org/linux-mips/1488684260-18867-1-git-send-email-jiwei.sun@windriver.com/
      Cc: Jiwei Sun <jiwei.sun@windriver.com>
      Cc: Yu Huabing <yhb@ruijie.com.cn>
      Cc: stable@vger.kernel.org # 2.6.12+
      Cc: linux-mips@vger.kernel.org
      ff4dd232
  4. 05 12月, 2018 6 次提交
  5. 04 12月, 2018 1 次提交
    • M
      mips: annotate implicit fall throughs · 69095e39
      Mathieu Malaterre 提交于
      There is a plan to build the kernel with -Wimplicit-fallthrough and
      these places in the code produced warnings. Fix them up.
      
      This patch produces no change in behaviour, but should be reviewed in
      case these are actually bugs not intentional fallthoughs.
      Signed-off-by: NMathieu Malaterre <malat@debian.org>
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Cc: Kees Cook <keescook@google.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      69095e39
  6. 27 11月, 2018 2 次提交
  7. 22 11月, 2018 23 次提交