1. 30 5月, 2014 2 次提交
  2. 20 3月, 2014 3 次提交
    • J
      MIPS: KVM: Remove dead code in CP0 emulation · 36c95494
      James Hogan 提交于
      The code to check whether rd > MIPS_CP0_DESAVE is dead code, since
      MIPS_CP0_DESAVE = 31 and rd is already masked with 0x1f. Remove it.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      36c95494
    • J
      MIPS: KVM: Consult HWREna before emulating RDHWR · 26f4f3b5
      James Hogan 提交于
      The ability to read hardware registers from userland with the RDHWR
      instruction should depend upon the corresponding bit of the HWREna
      register being set, otherwise a reserved instruction exception should be
      generated.
      
      However KVM's current emulation ignores the guest's HWREna and always
      emulates RDHWR instructions even if the guest OS has disallowed them.
      
      Therefore rework the RDHWR emulation code to check for privilege or the
      corresponding bit in the guest HWREna bit. Also remove the #if 0 case
      for the UserLocal register. I presume it was there for debug purposes
      but it seems unnecessary now that the guest can control whether it
      causes a guest exception.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      26f4f3b5
    • J
      MIPS: KVM: Pass reserved instruction exceptions to guest · 15505679
      James Hogan 提交于
      Previously a reserved instruction exception while in guest code would
      cause a KVM internal error if kvm_mips_handle_ri() didn't recognise the
      instruction (including a RDHWR from an unrecognised hardware register).
      
      However the guest OS should really have the opportunity to catch the
      exception so that it can take the appropriate actions such as sending a
      SIGILL to the guest user process or emulating the instruction itself.
      
      Therefore in these cases emulate a guest RI exception and only return
      EMULATE_FAIL if that fails, being careful to revert the PC first in case
      the exception occurred in a branch delay slot in which case the PC will
      already point to the branch target.
      
      Also turn the printk messages relating to these cases into kvm_debug
      messages so that they aren't usually visible.
      
      This allows crashme to run in the guest without killing the entire VM.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      Cc: stable@vger.kernel.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      15505679
  3. 25 1月, 2014 3 次提交
    • P
      mips: delete non-required instances of include <linux/init.h> · 3b2663ca
      Paul Gortmaker 提交于
      None of these files are actually using any __init type directives
      and hence don't need to include <linux/init.h>.  Most are just a
      left over from __devinit and __cpuinit removal, or simply due to
      code getting copied from one driver to the next.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NJohn Crispin <blogic@openwrt.org>
      Patchwork: http://patchwork.linux-mips.org/patch/6320/
      3b2663ca
    • J
      MIPS: KVM: remove shadow_tlb code · 08596b0a
      James Hogan 提交于
      The kvm_mips_init_shadow_tlb() function is called from
      kvm_arch_vcpu_init() and initialises entries 0 to
      current_cpu_data.tlbsize-1 of the virtual cpu's shadow_tlb[64] array.
      
      However newer cores with FTLBs can have a tlbsize > 64, for example the
      ProAptiv I'm testing on has a total tlbsize of 576. This causes
      kvm_mips_init_shadow_tlb() to overflow the shadow_tlb[64] array and
      overwrite the comparecount_timer among other things, causing a lock up
      when starting a KVM guest.
      
      Aside from kvm_mips_init_shadow_tlb() which only initialises it, the
      shadow_tlb[64] array is only actually used by the following functions:
       - kvm_shadow_tlb_put() & kvm_shadow_tlb_load()
           These are never called. The only call sites are #if 0'd out.
       - kvm_mips_dump_shadow_tlbs()
           This is never called.
      
      It was originally added for trap & emulate, but turned out to be
      unnecessary so it was disabled.
      
      So instead of fixing the shadow_tlb initialisation code, lets just
      remove the shadow_tlb[64] array and the above functions entirely. The
      only functional change here is the removal of broken shadow_tlb
      initialisation. The rest just deletes dead code.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Gleb Natapov <gleb@redhat.com>
      Cc: kvm@vger.kernel.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NJohn Crispin <blogic@openwrt.org>
      Patchwork: http://patchwork.linux-mips.org/patch/6384/
      08596b0a
    • J
      MIPS: KVM: use common EHINV aware UNIQUE_ENTRYHI · e36059e5
      James Hogan 提交于
      When KVM is enabled and TLB invalidation is supported,
      kvm_mips_flush_host_tlb() can cause a machine check exception due to
      multiple matching TLB entries. This can occur on shutdown even when KVM
      hasn't been actively used.
      
      Commit adb78de9eae8 (MIPS: mm: Move UNIQUE_ENTRYHI macro to a header
      file) created a common UNIQUE_ENTRYHI in asm/tlb.h but it didn't update
      the copy of UNIQUE_ENTRYHI in kvm_tlb.c to use it.
      
      Commit 36b175451399 (MIPS: tlb: Set the EHINV bit for TLBINVF cores when
      invalidating the TLB) later added TLB invalidation (EHINV) support to
      the common UNIQUE_ENTRYHI.
      
      Therefore make kvm_tlb.c use the EHINV aware UNIQUE_ENTRYHI
      implementation in asm/tlb.h too.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Gleb Natapov <gleb@redhat.com>
      Cc: kvm@vger.kernel.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Reviewed-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NJohn Crispin <blogic@openwrt.org>
      Patchwork: http://patchwork.linux-mips.org/patch/6383/
      e36059e5
  4. 17 10月, 2013 1 次提交
  5. 26 8月, 2013 3 次提交
  6. 19 7月, 2013 1 次提交
  7. 18 7月, 2013 1 次提交
  8. 11 6月, 2013 1 次提交
  9. 03 6月, 2013 4 次提交
  10. 22 5月, 2013 1 次提交
  11. 17 5月, 2013 1 次提交
  12. 09 5月, 2013 1 次提交
    • S
      KVM/MIPS32: Binary patching of select privileged instructions. · 50c83085
      Sanjay Lal 提交于
      Currently, the following instructions are translated:
      - CACHE (indexed)
      - CACHE (va based): translated to a SYNCI, overkill on D-CACHE operations,
        but still much faster than a trap.
      - mfc0/mtc0: the virtual COP0 registers for the guest are implemented as
        2-D array.
        [COP#][SEL] and this is mapped into the guest kernel address space @ VA 0x0.
        mfc0/mtc0 operations are transformed to load/stores.
      Signed-off-by: NSanjay Lal <sanjayl@kymasys.com>
      Cc: kvm@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      50c83085
  13. 08 5月, 2013 9 次提交