1. 14 2月, 2017 11 次提交
    • P
      MIPS: Audit and remove any unnecessary uses of module.h · 26dd3e4f
      Paul Gortmaker 提交于
      Historically a lot of these existed because we did not have
      a distinction between what was modular code and what was providing
      support to modules via EXPORT_SYMBOL and friends.  That changed
      when we forked out support for the latter into the export.h file.
      
      This means we should be able to reduce the usage of module.h
      in code that is obj-y Makefile or bool Kconfig.  In the case of
      some code where it is modular, we can extend that to also include
      files that are building basic support functionality but not related
      to loading or registering the final module; such files also have
      no need whatsoever for module.h
      
      The advantage in removing such instances is that module.h itself
      sources about 15 other headers; adding significantly to what we feed
      cpp, and it can obscure what headers we are effectively using.
      
      Since module.h might have been the implicit source for init.h
      (for __init) and for export.h (for EXPORT_SYMBOL) we consider each
      instance for the presence of either and replace/add as needed.
      
      Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
      
      Build coverage of all the mips defconfigs revealed the module.h
      header was masking a couple of implicit include instances, so
      we add the appropriate headers there.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Cc: David Daney <david.daney@cavium.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: "Steven J. Hill" <steven.hill@cavium.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15131/
      [james.hogan@imgtec.com: Preserve sort order where it already exists]
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      26dd3e4f
    • J
      MIPS: Unify perf counter register definitions · 2654294b
      James Hogan 提交于
      Unify definitions for MIPS performance counter register fields in
      mipsregs.h rather than duplicating them in perf_events and oprofile.
      This will allow future patches to use them to expose performance
      counters to KVM guests.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Robert Richter <rric@kernel.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: oprofile-list@lists.sf.net
      Patchwork: https://patchwork.linux-mips.org/patch/15212/Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      2654294b
    • J
      MIPS: Disable stack checks on MIPS kernels · 573deec0
      Joshua Kinard 提交于
      Disable stack checking on MIPS kernels.  Some distribution toolchains
      might pass the -fstack-check option to gcc.  This results in a
      store-doubleword instruction being emitted at the top of all
      functions that checks the available stack space.  E.g.,
      
        a80000000001d740 <per_cpu_init>:
        a80000000001d740:       ffa0bfc0        sd      zero,-16448(sp)
        a80000000001d744:       2405ffc9        li      a1,-55
        a80000000001d748:       67bdffc0        daddiu  sp,sp,-64
      
      Generally, this is undesirable, and especially on the SGI IP27
      platform, it will trigger a NULL pointer dereference in
      '_raw_spin_lock_irq' during early init.
      Signed-off-by: NJoshua Kinard <kumba@gentoo.org>
      Suggested-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15132/Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      573deec0
    • S
      MIPS: OCTEON: Platform support for OCTEON III USB controller · 93e502b3
      Steven J. Hill 提交于
      Add all the necessary platform code to initialize the dwc3
      USB host controller. This code initializes the clocks and
      performs a reset on the USB core and PHYs. The driver code
      in 'drivers/usb/dwc3' is where the real driver lives.
      Signed-off-by: NSteven J. Hill <steven.hill@cavium.com>
      Acked-by: NDavid Daney <david.daney@cavium.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15108/Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      93e502b3
    • F
      MIPS: Lantiq: Fix cascaded IRQ setup · 6c356eda
      Felix Fietkau 提交于
      With the IRQ stack changes integrated, the XRX200 devices started
      emitting a constant stream of kernel messages like this:
      
      [  565.415310] Spurious IRQ: CAUSE=0x1100c300
      
      This is caused by IP0 getting handled by plat_irq_dispatch() rather than
      its vectored interrupt handler, which is fixed by commit de856416e714
      ("MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch").
      
      Fix plat_irq_dispatch() to handle non-vectored IPI interrupts correctly
      by setting up IP2-6 as proper chained IRQ handlers and calling do_IRQ
      for all MIPS CPU interrupts.
      Signed-off-by: NFelix Fietkau <nbd@nbd.name>
      Acked-by: NJohn Crispin <john@phrozen.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15077/
      [james.hogan@imgtec.com: tweaked commit message]
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      6c356eda
    • M
      MIPS: sync-r4k: Fix KERN_CONT fallout · 4fb69afa
      Matt Redfearn 提交于
      Since commit 4bcc595c ("printk: reinstate KERN_CONT for printing
      continuation lines") the output of counter synchornisation has been
      split across lines:
      [ 0.665181] Synchronize counters for CPU 1:
      [ 0.678578] done.
      
      Fix this by using pr_cont, and replace printk with pr_info.
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15195/Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      4fb69afa
    • M
      MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch · c25f8064
      Matt Redfearn 提交于
      Commit dda45f70 ("MIPS: Switch to the irq_stack in interrupts")
      changed both the normal and vectored interrupt handlers. Unfortunately
      the vectored version, "except_vec_vi_handler", was incorrectly modified
      to unconditionally jal to plat_irq_dispatch, rather than doing a jalr to
      the vectored handler that has been set up. This is ok for many platforms
      which set the vectored handler to plat_irq_dispatch anyway, but will
      cause problems with platforms that use other handlers.
      
      Fixes: dda45f70 ("MIPS: Switch to the irq_stack in interrupts")
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15110/Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      c25f8064
    • M
      MIPS: Fix distclean with Makefile.postlink · 6e5b95cd
      Matt Redfearn 提交于
      The postlink Makefile must include include/config/auto.conf to get the
      kernel configuration variables. But in a clean kernel directory this
      file does not exist, causing make to bail with the error:
      
      arch/mips/Makefile.postlink:10: include/config/auto.conf: No such file or directory
      make[1]: *** No rule to make target 'include/config/auto.conf'.  Stop.
      Makefile:1290: recipe for target 'vmlinuxclean' failed
      
      Fix this by using "-include" to not cause a Make error when the file
      does not exist.
      
      Fixes: 44079d35 ("MIPS: Use Makefile.postlink to insert relocations into vmlinux")
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/15136/Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      6e5b95cd
    • J
      MIPS: Fix cacheinfo overflow · 4828b5f5
      James Hogan 提交于
      The recently added MIPS cacheinfo support used a macro populate_cache()
      to populate the cacheinfo structures depending on which caches are
      present. However the macro contains multiple statements without
      enclosing them in a do {} while (0) loop, so the L2 and L3 cache
      conditionals in populate_cache_leaves() only conditionalised the first
      statement in the macro.
      
      This overflows the buffer allocated by detect_cache_attributes(),
      resulting in boot failures under QEMU where neither the L2 or L2 caches
      are present.
      
      Enclose the macro statements in a do {} while (0) block to keep the
      whole macro inside the conditionals.
      
      Fixes: ef462f3b ("MIPS: Add cacheinfo support")
      Reported-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Tested-by: NGuenter Roeck <linux@roeck-us.net>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Justin Chen <justin.chen@broadcom.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: bcm-kernel-feedback-list@broadcom.com
      Patchwork: https://patchwork.linux-mips.org/patch/15276/
      4828b5f5
    • P
      MIPS: Fix protected_cache(e)_op() for microMIPS · f229454d
      Paul Burton 提交于
      When building for microMIPS we need to ensure that the assembler always
      knows that there is code at the target of a branch or jump. Commit
      7170bdc7 ("MIPS: Add return errors to protected cache ops")
      introduced a fixup path to protected_cache(e)_op() which does not meet
      this requirement. The fixup path jumps to the "2" label but the .section
      pseudo-op immediately following it causes the label to be marked as
      data. Linking then fails with:
      
        mips-img-linux-gnu-ld: arch/mips/mm/c-r4k.o: .fixup+0x0: Unsupported
        jump between ISA modes; consider recompiling with interlinking
        enabled.
      
      Fix this by declaring that "2" labels code using the .insn directive.
      
      Fixes: 7170bdc7 ("MIPS: Add return errors to protected cache ops")
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Reviewed-by: NMaciej W. Rozycki <macro@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Patchwork: https://patchwork.linux-mips.org/patch/15274/Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      f229454d
    • J
      Merge tag 'mips_kvm_4.11_1' into mips-for-linux-next · f700a420
      James Hogan 提交于
      MIPS dependencies for KVM
      
      Miscellaneous MIPS architecture changes depended on by the MIPS KVM
      changes in the KVM tree.
      
      - Move pgd_alloc() out of header.
      - Exports so KVM can access page table management and TLBEX functions.
      - Add return errors to protected cache ops.
      f700a420
  2. 03 2月, 2017 4 次提交
    • J
      MIPS: Add return errors to protected cache ops · 7170bdc7
      James Hogan 提交于
      The protected cache ops contain no out of line fixup code to return an
      error code in the event of a fault, with the cache op being skipped in
      that case. For KVM however we'd like to detect this case as page
      faulting will be disabled so it could happen during normal operation if
      the GVA page tables were flushed, and need to be handled by the caller.
      
      Add the out-of-line fixup code to load the error value -EFAULT into the
      return variable, and adapt the protected cache line functions to pass
      the error back to the caller.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      7170bdc7
    • J
      MIPS: Export some tlbex internals for KVM to use · 722b4544
      James Hogan 提交于
      Export to TLB exception code generating functions so that KVM can
      construct a fast TLB refill handler for guest context without
      reinventing the wheel quite so much.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      722b4544
    • J
      MIPS: uasm: Add include guards in asm/uasm.h · 93a93c24
      James Hogan 提交于
      Add include guards in asm/uasm.h to allow it to be safely used by a new
      header asm/tlbex.h in the next patch to expose TLB exception building
      functions for KVM to use.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      93a93c24
    • J
      MIPS: Export pgd/pmd symbols for KVM · ccf01516
      James Hogan 提交于
      Export pmd_init(), invalid_pmd_table and tlbmiss_handler_setup_pgd to
      GPL kernel modules so that MIPS KVM can use the inline page table
      management functions and switch between page tables:
      
      - pmd_init() will be used directly by KVM to initialise newly allocated
        pmd tables with invalid lower level table pointers.
      
      - invalid_pmd_table is used by pud_present(), pud_none(), and
        pud_clear(), which KVM will use to test and clear pud entries.
      
      - tlbmiss_handler_setup_pgd() will be called by KVM entry code to switch
        to the appropriate GVA page tables.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      ccf01516
  3. 02 2月, 2017 1 次提交
    • J
      MIPS: Move pgd_alloc() out of header · 814f91bf
      James Hogan 提交于
      pgd_alloc() references init_mm which is not exported to modules. In
      order for KVM to be able to use pgd_alloc() to allocate GVA page tables,
      move pgd_alloc() into a new pgtable.c file and export it to modules.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      814f91bf
  4. 25 1月, 2017 24 次提交