1. 13 Feb, 2017 5 commits
    • Matt Redfearn's avatar
      MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch · c25f8064
      Matt Redfearn authored
      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: default avatarMatt 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: default avatarJames Hogan <james.hogan@imgtec.com>
      c25f8064
    • Matt Redfearn's avatar
      MIPS: Fix distclean with Makefile.postlink · 6e5b95cd
      Matt Redfearn authored
      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: default avatarMatt 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: default avatarJames Hogan <james.hogan@imgtec.com>
      6e5b95cd
    • James Hogan's avatar
      MIPS: Fix cacheinfo overflow · 4828b5f5
      James Hogan authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Tested-by: default avatarGuenter 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
    • Paul Burton's avatar
      MIPS: Fix protected_cache(e)_op() for microMIPS · f229454d
      Paul Burton authored
      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: default avatarPaul Burton <paul.burton@imgtec.com>
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Reviewed-by: default avatarMaciej 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: default avatarJames Hogan <james.hogan@imgtec.com>
      f229454d
    • James Hogan's avatar
      Merge tag 'mips_kvm_4.11_1' into mips-for-linux-next · f700a420
      James Hogan authored
      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 Feb, 2017 4 commits
    • James Hogan's avatar
      MIPS: Add return errors to protected cache ops · 7170bdc7
      James Hogan authored
      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: default avatarJames Hogan <james.hogan@imgtec.com>
      Acked-by: default avatarRalf 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
    • James Hogan's avatar
      MIPS: Export some tlbex internals for KVM to use · 722b4544
      James Hogan authored
      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: default avatarJames Hogan <james.hogan@imgtec.com>
      Acked-by: default avatarRalf 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
    • James Hogan's avatar
      MIPS: uasm: Add include guards in asm/uasm.h · 93a93c24
      James Hogan authored
      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: default avatarJames Hogan <james.hogan@imgtec.com>
      Acked-by: default avatarRalf 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
    • James Hogan's avatar
      MIPS: Export pgd/pmd symbols for KVM · ccf01516
      James Hogan authored
      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: default avatarJames Hogan <james.hogan@imgtec.com>
      Acked-by: default avatarRalf 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 Feb, 2017 1 commit
    • James Hogan's avatar
      MIPS: Move pgd_alloc() out of header · 814f91bf
      James Hogan authored
      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: default avatarJames Hogan <james.hogan@imgtec.com>
      Acked-by: default avatarRalf 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 Jan, 2017 18 commits
  5. 24 Jan, 2017 6 commits
  6. 03 Jan, 2017 6 commits