1. 05 6月, 2020 1 次提交
  2. 04 6月, 2020 1 次提交
    • M
      mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option · 3f08a302
      Mike Rapoport 提交于
      CONFIG_HAVE_MEMBLOCK_NODE_MAP is used to differentiate initialization of
      nodes and zones structures between the systems that have region to node
      mapping in memblock and those that don't.
      
      Currently all the NUMA architectures enable this option and for the
      non-NUMA systems we can presume that all the memory belongs to node 0 and
      therefore the compile time configuration option is not required.
      
      The remaining few architectures that use DISCONTIGMEM without NUMA are
      easily updated to use memblock_add_node() instead of memblock_add() and
      thus have proper correspondence of memblock regions to NUMA nodes.
      
      Still, free_area_init_node() must have a backward compatible version
      because its semantics with and without CONFIG_HAVE_MEMBLOCK_NODE_MAP is
      different.  Once all the architectures will use the new semantics, the
      entire compatibility layer can be dropped.
      
      To avoid addition of extra run time memory to store node id for
      architectures that keep memblock but have only a single node, the node id
      field of the memblock_region is guarded by CONFIG_NEED_MULTIPLE_NODES and
      the corresponding accessors presume that in those cases it is always 0.
      Signed-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Tested-by: Hoan Tran <hoan@os.amperecomputing.com>	[arm64]
      Acked-by: Catalin Marinas <catalin.marinas@arm.com>	[arm64]
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: http://lkml.kernel.org/r/20200412194859.12663-4-rppt@kernel.orgSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3f08a302
  3. 27 5月, 2020 2 次提交
  4. 24 5月, 2020 1 次提交
    • W
      MIPS: emulate CPUCFG instruction on older Loongson64 cores · ec7a9318
      WANG Xuerui 提交于
      CPUCFG is the instruction for querying processor characteristics on
      newer Loongson processors, much like CPUID of x86. Since the instruction
      is supposedly designed to provide a unified way to do feature detection
      (without having to, for example, parse /proc/cpuinfo which is too
      heavyweight), it is important to provide compatibility for older cores
      without native support. Fortunately, most of the fields can be
      synthesized without changes to semantics. Performance is not really big
      a concern, because feature detection logic is not expected to be
      invoked very often in typical userland applications.
      
      The instruction can't be emulated on LOONGSON_2EF cores, according to
      FlyGoat's experiments. Because the LWC2 opcode is assigned to other
      valid instructions on 2E and 2F, no RI exception is raised for us to
      intercept. So compatibility is only extended back furthest to
      Loongson-3A1000. Loongson-2K is covered too, as it is basically a remix
      of various blocks from the 3A/3B models from a kernel perspective.
      
      This is lightly based on Loongson's work on their Linux 3.10 fork, for
      being the authority on the right feature flags to fill in, where things
      aren't otherwise discoverable.
      Signed-off-by: NWANG Xuerui <git@xen0n.name>
      Reviewed-by: NJiaxun Yang <jiaxun.yang@flygoat.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
      Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
      Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
      ec7a9318
  5. 22 5月, 2020 3 次提交
    • S
      mips: csrc-r4k: Mark R4K timer as unstable if CPU freq changes · 38586428
      Serge Semin 提交于
      Commit 07d69579 ("MIPS: Don't register r4k sched clock when CPUFREQ
      enabled") disabled the r4k-clock usage for scheduler ticks counting due
      to the scheduler being non-tolerant for unstable clocks sources. For the
      same reason the clock should be used in the system clocksource framework
      with care. As soon as CPU frequency changes the clocksource framework
      should be notified about this by marking the R4K timer being unstable
      (which it really is, since the ticks rate has been changed synchronously
      with the CPU frequency).
      Signed-off-by: NSerge Semin <Sergey.Semin@baikalelectronics.ru>
      Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Paul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: devicetree@vger.kernel.org
      Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
      38586428
    • S
      mips: Add MIPS Warrior P5600 support · 281e3aea
      Serge Semin 提交于
      This is a MIPS32 Release 5 based IP core with XPA, EVA, dual/quad issue
      exec pipes, MMU with two-levels TLB, UCA, MSA, MDU core level features
      and system level features like up to six P5600 calculation cores, CM2
      with L2 cache, IOCU/IOMMU (though might be unused depending on the
      system-specific IP core configuration), GIC, CPC, virtualisation module,
      eJTAG and PDtrace.
      
      As being MIPS32 Release 5 based core it provides all the features
      available by the CPU_MIPS32_R5 config, while adding a few more like
      UCA attribute support, availability of CPU-freq (by means of L2/CM
      clock ratio setting), EI/VI GIC modes detection at runtime.
      
      In addition to this if P5600 architecture is enabled modern GNU GCC
      provides a specific tuning for P5600 processors with respect to the
      classic MIPS32 Release 5. First of all branch-likely avoidance is
      activated only when the code is compiled with the speed optimization
      (avoidance is always enabled for the pure MIPS32 Release 5
      architecture). Secondly the madd/msub avoidance is enabled since
      madd/msub utilization isn't profitable due to overhead of getting the
      result out of the HI/LO registers. Multiply-accumulate instructions are
      activated and utilized together with the necessary code reorder when
      multiply-add/multiply-subtract statements are met. Finally load/store
      bonding is activated by default. All of these optimizations may make
      the code relatively faster than if just MIP32 release 5 architecture
      was requested.
      Co-developed-by: NAlexey Malahov <Alexey.Malahov@baikalelectronics.ru>
      Signed-off-by: NAlexey Malahov <Alexey.Malahov@baikalelectronics.ru>
      Signed-off-by: NSerge Semin <Sergey.Semin@baikalelectronics.ru>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Paul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: devicetree@vger.kernel.org
      Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
      281e3aea
    • S
      mips: Add MIPS Release 5 support · ab7c01fd
      Serge Semin 提交于
      There are five MIPS32/64 architecture releases currently available:
      from 1 to 6 except fourth one, which was intentionally skipped.
      Three of them can be called as major: 1st, 2nd and 6th, that not only
      have some system level alterations, but also introduced significant
      core/ISA level updates. The rest of the MIPS architecture releases are
      minor.
      
      Even though they don't have as much ISA/system/core level changes
      as the major ones with respect to the previous releases, they still
      provide a set of updates (I'd say they were intended to be the
      intermediate releases before a major one) that might be useful for the
      kernel and user-level code, when activated by the kernel or compiler.
      In particular the following features were introduced or ended up being
      available at/after MIPS32/64 Release 5 architecture:
      + the last release of the misaligned memory access instructions,
      + virtualisation - VZ ASE - is optional component of the arch,
      + SIMD - MSA ASE - is optional component of the arch,
      + DSP ASE is optional component of the arch,
      + CP0.Status.FR=1 for CP1.FIR.F64=1 (pure 64-bit FPU general registers)
        must be available if FPU is implemented,
      + CP1.FIR.Has2008 support is required so CP1.FCSR.{ABS2008,NAN2008} bits
        are available.
      + UFR/UNFR aliases to access CP0.Status.FR from user-space by means of
        ctc1/cfc1 instructions (enabled by CP0.Config5.UFR),
      + CP0.COnfig5.LLB=1 and eretnc instruction are implemented to without
        accidentally clearing LL-bit when returning from an interrupt,
        exception, or error trap,
      + XPA feature together with extended versions of CPx registers is
        introduced, which needs to have mfhc0/mthc0 instructions available.
      
      So due to these changes GNU GCC provides an extended instructions set
      support for MIPS32/64 Release 5 by default like eretnc/mfhc0/mthc0. Even
      though the architecture alteration isn't that big, it still worth to be
      taken into account by the kernel software. Finally we can't deny that
      some optimization/limitations might be found in future and implemented
      on some level in kernel or compiler. In this case having even
      intermediate MIPS architecture releases support would be more than
      useful.
      
      So the most of the changes provided by this commit can be split into
      either compile- or runtime configs related. The compile-time related
      changes are caused by adding the new CONFIG_CPU_MIPS32_R5/CONFIG_CPU_MIPSR5
      configs and concern the code activating MIPSR2 or MIPSR6 already
      implemented features (like eretnc/LLbit, mthc0/mfhc0). In addition
      CPU_HAS_MSA can be now freely enabled for MIPS32/64 release 5 based
      platforms as this is done for CPU_MIPS32_R6 CPUs. The runtime changes
      concerns the features which are handled with respect to the MIPS ISA
      revision detected at run-time by means of CP0.Config.{AT,AR} bits. Alas
      these fields can be used to detect either r1 or r2 or r6 releases.
      But since we know which CPUs in fact support the R5 arch, we can manually
      set MIPS_CPU_ISA_M32R5/MIPS_CPU_ISA_M64R5 bit of c->isa_level and then
      use cpu_has_mips32r5/cpu_has_mips64r5 where it's appropriate.
      
      Since XPA/EVA provide too complex alterationss and to have them used with
      MIPS32 Release 2 charged kernels (for compatibility with current platform
      configs) they are left to be setup as a separate kernel configs.
      Co-developed-by: NAlexey Malahov <Alexey.Malahov@baikalelectronics.ru>
      Signed-off-by: NAlexey Malahov <Alexey.Malahov@baikalelectronics.ru>
      Signed-off-by: NSerge Semin <Sergey.Semin@baikalelectronics.ru>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Paul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: devicetree@vger.kernel.org
      Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
      ab7c01fd
  6. 17 5月, 2020 1 次提交
  7. 12 5月, 2020 1 次提交
  8. 10 5月, 2020 3 次提交
  9. 19 4月, 2020 1 次提交
  10. 14 4月, 2020 1 次提交
  11. 25 3月, 2020 2 次提交
  12. 23 3月, 2020 1 次提交
    • T
      MIPS: Add support for Desktop Management Interface (DMI) · be8fa1cb
      Tiezhu Yang 提交于
      Enable DMI scanning on the MIPS architecture, this setups DMI identifiers
      (dmi_system_id) for printing it out on task dumps and prepares DIMM entry
      information (dmi_memdev_info) from the SMBIOS table. With this patch, the
      driver can easily match various of mainboards.
      
      In the SMBIOS reference specification, the table anchor string "_SM_" is
      present in the address range 0xF0000 to 0xFFFFF on a 16-byte boundary,
      but there exists a special case for Loongson platform, when call function
      dmi_early_remap, it should specify the start address to 0xFFFE000 due to
      it is reserved for SMBIOS and can be normally access in the BIOS.
      
      This patch works fine on the Loongson 3A3000 platform which belongs to
      MIPS architecture and has no influence on the other architectures such
      as x86 and ARM.
      
      Additionally, in order to avoid the unknown risks on the mips platform
      which is not MACH_LOONGSON64, the DMI config is better to depend on
      MACH_LOONGSON64. If other mips platform also needs this DMI feature in
      the future, the "depends on" condition can be modified.
      Co-developed-by: NYinglu Yang <yangyinglu@loongson.cn>
      Signed-off-by: NYinglu Yang <yangyinglu@loongson.cn>
      [jiaxun.yang@flygoat.com: Refine definitions and Kconfig]
      Signed-off-by: NJiaxun Yang <jiaxun.yang@flygoat.com>
      Signed-off-by: NTiezhu Yang <yangtiezhu@loongson.cn>
      Reviewed-by: NHuacai Chen <chenhc@lemote.com>
      Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
      be8fa1cb
  13. 16 3月, 2020 1 次提交
  14. 05 3月, 2020 1 次提交
  15. 18 2月, 2020 2 次提交
  16. 14 2月, 2020 1 次提交
    • F
      context-tracking: Introduce CONFIG_HAVE_TIF_NOHZ · 490f561b
      Frederic Weisbecker 提交于
      A few archs (x86, arm, arm64) don't rely anymore on TIF_NOHZ to call
      into context tracking on user entry/exit but instead use static keys
      (or not) to optimize those calls. Ideally every arch should migrate to
      that behaviour in the long run.
      
      Settle a config option to let those archs remove their TIF_NOHZ
      definitions.
      Signed-off-by: NFrederic Weisbecker <frederic@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paulburton@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: David S. Miller <davem@davemloft.net>
      490f561b
  17. 24 1月, 2020 2 次提交
  18. 23 1月, 2020 4 次提交
    • A
      MIPS: sort MIPS and MIPS_GENERIC Kconfig selects alphabetically (again) · 34c01e41
      Alexander Lobakin 提交于
      Cycles "sort selects alphabetically -> add new options at the end or at
      random place -> repeat" go on and on.
      Please double-check when adding new options and make sure that they
      don't break the existing order to prevent dumb commits like this one
      from appearing.
      Signed-off-by: NAlexander Lobakin <alobakin@dlink.ru>
      Signed-off-by: NPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Allison Randal <allison@lohutok.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      34c01e41
    • A
      MIPS: make CPU_HAS_LOAD_STORE_LR opt-out · 18d84e2e
      Alexander Lobakin 提交于
      CPU_HAS_LOAD_STORE_LR was introduced in 932afdee ("MIPS: Add Kconfig
      variable for CPUs with unaligned load/store instructions") to make code
      in kernel/unaligned.c and lib/mem{cpy,set}.S more intuitive and give a
      possibility to easily add new CPUs without these instruction sets in
      future.
      
      Hovewer, this variant is not optimal for mainly two reasons:
      * For now, we have 20+ CPUs with such instructions and only two (MIPS R6)
        without. It will obviously be more effective and straightforward to
        have an option for these two rather than for the rest.
      * You can easily miss the fact that you need to select this option when
        adding a new CPU, while all processors lacking these sets are
        well-known, so the probability of missing something is way much lower.
      
      We can address both points by turning CPU_HAS_LOAD_STORE_LR into opt-out
      CPU_NO_LOAD_STORE_LR. This also makes MIPS root Kconfig more clear and
      understandable.
      Signed-off-by: NAlexander Lobakin <alobakin@dlink.ru>
      Signed-off-by: NPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Allison Randal <allison@lohutok.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      18d84e2e
    • A
      MIPS: generic: don't unconditionally select PINCTRL · 7de86604
      Alexander Lobakin 提交于
      CONFIG_PINCTRL was converted from hidden selectable to a visible option
      with commit d219b924 ("pinctrl: change Kconfig PINCTRL variable to
      a menuconfig"). Remove unconditional select and enable this symbol in
      Ocelot config, which currently is the only user among generic boards.
      Signed-off-by: NAlexander Lobakin <alobakin@dlink.ru>
      Signed-off-by: NPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Allison Randal <allison@lohutok.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      7de86604
    • A
      MIPS: don't explicitly select LIBFDT in Kconfig · 7c8f1379
      Alexander Lobakin 提交于
      It gets selected anyway through USE_OF -> OF_EARLY_FLATTREE ->
      OF_FLATTREE -> LIBFDT, no need to double-check.
      Signed-off-by: NAlexander Lobakin <alobakin@dlink.ru>
      Signed-off-by: NPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Allison Randal <allison@lohutok.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      7c8f1379
  19. 10 1月, 2020 2 次提交
    • P
      MIPS: BPF: Restore MIPS32 cBPF JIT · 36366e36
      Paul Burton 提交于
      Commit 716850ab ("MIPS: eBPF: Initial eBPF support for MIPS32
      architecture.") enabled our eBPF JIT for MIPS32 kernels, whereas it has
      previously only been availailable for MIPS64. It was my understanding at
      the time that the BPF test suite was passing & JITing a comparable
      number of tests to our cBPF JIT [1], but it turns out that was not the
      case.
      
      The eBPF JIT has a number of problems on MIPS32:
      
      - Most notably various code paths still result in emission of MIPS64
        instructions which will cause reserved instruction exceptions & kernel
        panics when run on MIPS32 CPUs.
      
      - The eBPF JIT doesn't account for differences between the O32 ABI used
        by MIPS32 kernels versus the N64 ABI used by MIPS64 kernels. Notably
        arguments beyond the first 4 are passed on the stack in O32, and this
        is entirely unhandled when JITing a BPF_CALL instruction. Stack space
        must be reserved for arguments even if they all fit in registers, and
        the callee is free to assume that stack space has been reserved for
        its use - with the eBPF JIT this is not the case, so calling any
        function can result in clobbering values on the stack & unpredictable
        behaviour. Function arguments in eBPF are always 64-bit values which
        is also entirely unhandled - the JIT still uses a single (32-bit)
        register per argument. As a result all function arguments are always
        passed incorrectly when JITing a BPF_CALL instruction, leading to
        kernel crashes or strange behavior.
      
      - The JIT attempts to bail our on use of ALU64 instructions or 64-bit
        memory access instructions. The code doing this at the start of
        build_one_insn() incorrectly checks whether BPF_OP() equals BPF_DW,
        when it should really be checking BPF_SIZE() & only doing so when
        BPF_CLASS() is one of BPF_{LD,LDX,ST,STX}. This results in false
        positives that cause more bailouts than intended, and that in turns
        hides some of the problems described above.
      
      - The kernel's cBPF->eBPF translation makes heavy use of 64-bit eBPF
        instructions that the MIPS32 eBPF JIT bails out on, leading to most
        cBPF programs not being JITed at all.
      
      Until these problems are resolved, revert the removal of the cBPF JIT
      performed by commit 716850ab ("MIPS: eBPF: Initial eBPF support for
      MIPS32 architecture."). Together with commit f8fffebd ("MIPS: BPF:
      Disable MIPS32 eBPF JIT") this restores MIPS32 BPF JIT behavior back to
      the same state it was prior to the introduction of the broken eBPF JIT
      support.
      
      [1] https://lore.kernel.org/linux-mips/MWHPR2201MB13583388481F01A422CE7D66D4410@MWHPR2201MB1358.namprd22.prod.outlook.com/Signed-off-by: NPaul Burton <paulburton@kernel.org>
      Fixes: 716850ab ("MIPS: eBPF: Initial eBPF support for MIPS32 architecture.")
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Hassan Naveed <hnaveed@wavecomp.com>
      Cc: Tony Ambardar <itugrok@yahoo.com>
      Cc: bpf@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      36366e36
    • T
      MIPS: mm: Place per_cpu on different nodes, if NUMA is enabled · f3c560a6
      Thomas Bogendoerfer 提交于
      Implement placing of per_cpu into memory, which is local to the CPU.
      Signed-off-by: NThomas Bogendoerfer <tbogendoerfer@suse.de>
      Signed-off-by: NPaul Burton <paulburton@kernel.org>
      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
      f3c560a6
  20. 19 12月, 2019 2 次提交
    • A
      MIPS: BPF: eBPF JIT: check for MIPS ISA compliance in Kconfig · f596cf0d
      Alexander Lobakin 提交于
      It is completely wrong to check for compile-time MIPS ISA revision in
      the body of bpf_int_jit_compile() as it may lead to get MIPS JIT fully
      omitted by the CC while the rest system will think that the JIT is
      actually present and works [1].
      We can check if the selected CPU really supports MIPS eBPF JIT at
      configure time and avoid such situations when kernel can be built
      without both JIT and interpreter, but with CONFIG_BPF_SYSCALL=y.
      
      [1] https://lore.kernel.org/linux-mips/09d713a59665d745e21d021deeaebe0a@dlink.ru/
      
      Fixes: 716850ab ("MIPS: eBPF: Initial eBPF support for MIPS32 architecture.")
      Cc: <stable@vger.kernel.org> # v5.2+
      Signed-off-by: NAlexander Lobakin <alobakin@dlink.ru>
      Signed-off-by: NPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Hassan Naveed <hnaveed@wavecomp.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Martin KaFai Lau <kafai@fb.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: Andrii Nakryiko <andriin@fb.com>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: bpf@vger.kernel.org
      f596cf0d
    • P
      MIPS: BPF: Disable MIPS32 eBPF JIT · f8fffebd
      Paul Burton 提交于
      Commit 716850ab ("MIPS: eBPF: Initial eBPF support for MIPS32
      architecture.") enabled our eBPF JIT for MIPS32 kernels, whereas it has
      previously only been availailable for MIPS64. It was my understanding at
      the time that the BPF test suite was passing & JITing a comparable
      number of tests to our cBPF JIT [1], but it turns out that was not the
      case.
      
      The eBPF JIT has a number of problems on MIPS32:
      
      - Most notably various code paths still result in emission of MIPS64
        instructions which will cause reserved instruction exceptions & kernel
        panics when run on MIPS32 CPUs.
      
      - The eBPF JIT doesn't account for differences between the O32 ABI used
        by MIPS32 kernels versus the N64 ABI used by MIPS64 kernels. Notably
        arguments beyond the first 4 are passed on the stack in O32, and this
        is entirely unhandled when JITing a BPF_CALL instruction. Stack space
        must be reserved for arguments even if they all fit in registers, and
        the callee is free to assume that stack space has been reserved for
        its use - with the eBPF JIT this is not the case, so calling any
        function can result in clobbering values on the stack & unpredictable
        behaviour. Function arguments in eBPF are always 64-bit values which
        is also entirely unhandled - the JIT still uses a single (32-bit)
        register per argument. As a result all function arguments are always
        passed incorrectly when JITing a BPF_CALL instruction, leading to
        kernel crashes or strange behavior.
      
      - The JIT attempts to bail our on use of ALU64 instructions or 64-bit
        memory access instructions. The code doing this at the start of
        build_one_insn() incorrectly checks whether BPF_OP() equals BPF_DW,
        when it should really be checking BPF_SIZE() & only doing so when
        BPF_CLASS() is one of BPF_{LD,LDX,ST,STX}. This results in false
        positives that cause more bailouts than intended, and that in turns
        hides some of the problems described above.
      
      - The kernel's cBPF->eBPF translation makes heavy use of 64-bit eBPF
        instructions that the MIPS32 eBPF JIT bails out on, leading to most
        cBPF programs not being JITed at all.
      
      Until these problems are resolved, revert the enabling of the eBPF JIT
      on MIPS32 done by commit 716850ab ("MIPS: eBPF: Initial eBPF support
      for MIPS32 architecture.").
      
      Note that this does not undo the changes made to the eBPF JIT by that
      commit, since they are a useful starting point to providing MIPS32
      support - they're just not nearly complete.
      
      [1] https://lore.kernel.org/linux-mips/MWHPR2201MB13583388481F01A422CE7D66D4410@MWHPR2201MB1358.namprd22.prod.outlook.com/Signed-off-by: NPaul Burton <paulburton@kernel.org>
      Fixes: 716850ab ("MIPS: eBPF: Initial eBPF support for MIPS32 architecture.")
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Hassan Naveed <hnaveed@wavecomp.com>
      Cc: Tony Ambardar <itugrok@yahoo.com>
      Cc: bpf@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: <stable@vger.kernel.org> # v5.2+
      Cc: linux-mips@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      f8fffebd
  21. 13 12月, 2019 1 次提交
  22. 23 11月, 2019 1 次提交
  23. 12 11月, 2019 4 次提交
    • A
      MIPS: allow building with kcov coverage · dcf78ee6
      Alexey Khoroshilov 提交于
      Add ARCH_HAS_KCOV and HAVE_GCC_PLUGINS to MIPS config.
      Disable instrumentation of vdso to avoid build failure.
      Signed-off-by: NAlexey Khoroshilov <khoroshilov@ispras.ru>
      Signed-off-by: NPaul Burton <paulburton@kernel.org>
      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
      dcf78ee6
    • J
      MIPS: Drop CPU_SUPPORTS_UNCACHED_ACCELERATED · 2a598436
      Jiaxun Yang 提交于
      CPU_SUPPORTS_UNCACHED_ACCELERATED was introduced when kernel can't handle
      writecombine remap well. Nowadays drivers can try writecombine remap by
      themselves so this function is nolonger needed.
      Signed-off-by: NJiaxun Yang <jiaxun.yang@flygoat.com>
      Signed-off-by: NPaul Burton <paulburton@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: chenhe@lemote.com
      2a598436
    • H
      MIPS: Loongson: Unify LOONGSON3/LOONGSON64 Kconfig usage · caed1d1b
      Huacai Chen 提交于
      There are mixed LOONGSON3/LOONGSON64 usages in recently changes, let's
      establish some rules:
      
      1, In Kconfig symbols, we only use CPU_LOONGSON64, MACH_LOONGSON64 and
      SYS_HAS_CPU_LOONGSON64, all other derived symbols use "LOONGSON3" since
      they all not widely-used symbols and sometimes not suitable for all
      64-bit Loongson processors. E.g., we use symbols LOONGSON3_ENHANCEMENT,
      CPU_LOONGSON3_WORKAROUNDS, etc.
      
      2, Hide GSx64/GSx64E in Kconfig title since it is not useful for
      general users. However, in the full description we use a more detailed
      manner. E.g., GS264/GS464/GS464E/GS464V.
      
      All Kconfig titles and descriptions of Loongson processors and machines
      have also been updated in this patch for consistency.
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Signed-off-by: NPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-mips@vger.kernel.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Cc: Huacai Chen <chenhuacai@gmail.com>
      caed1d1b
    • H
      MIPS: Loongson: Rename LOONGSON1 to LOONGSON32 · b2afb64c
      Huacai Chen 提交于
      Now old Loongson-2E/2F use LOONGSON2EF and will be removed in future,
      newer Loongson-2/3 use LOONGSON64. So rename LOONGSON1 to LOONGSON32
      will make the naming style more unified.
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      [paulburton@kernel.org: Fix checkpatch whitespace warning in irqflags.h]
      Signed-off-by: NPaul Burton <paulburton@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-mips@vger.kernel.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Cc: Huacai Chen <chenhuacai@gmail.com>
      b2afb64c
  24. 11 11月, 2019 1 次提交
    • C
      dma-direct: provide mmap and get_sgtable method overrides · 34dc0ea6
      Christoph Hellwig 提交于
      For dma-direct we know that the DMA address is an encoding of the
      physical address that we can trivially decode.  Use that fact to
      provide implementations that do not need the arch_dma_coherent_to_pfn
      architecture hook.  Note that we still can only support mmap of
      non-coherent memory only if the architecture provides a way to set an
      uncached bit in the page tables.  This must be true for architectures
      that use the generic remap helpers, but other architectures can also
      manually select it.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NMax Filippov <jcmvbkbc@gmail.com>
      34dc0ea6