1. 30 5月, 2014 17 次提交
    • J
      MIPS: KVM: Remove ifdef DEBUG around kvm_debug · d5c704d5
      James Hogan 提交于
      kvm_debug() uses pr_debug() which is already compiled out in the absence
      of a DEBUG define, so remove the unnecessary ifdef DEBUG lines around
      kvm_debug() calls which are littered around arch/mips/kvm/.
      
      As well as generally cleaning up, this prevents future bit-rot due to
      DEBUG not being commonly used.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d5c704d5
    • J
      MIPS: KVM: Fix kvm_debug bit-rottage · 3d654833
      James Hogan 提交于
      Fix build errors when DEBUG is defined in arch/mips/kvm/.
       - The DEBUG code in kvm_mips_handle_tlbmod() was missing some variables.
       - The DEBUG code in kvm_mips_host_tlb_write() was conditional on an
         undefined "debug" variable.
       - The DEBUG code in kvm_mips_host_tlb_inv() accessed asid_map directly
         rather than using kvm_mips_get_user_asid(). Also fixed brace
         placement.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3d654833
    • J
      MIPS: KVM: Make kvm_mips_comparecount_{func,wakeup} static · 0fae34f4
      James Hogan 提交于
      The kvm_mips_comparecount_func() and kvm_mips_comparecount_wakeup()
      functions are only used within arch/mips/kvm/kvm_mips.c, so make them
      static.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0fae34f4
    • J
      MIPS: KVM: Add count frequency KVM register · f74a8e22
      James Hogan 提交于
      Expose the KVM guest CP0_Count frequency to userland via a new
      KVM_REG_MIPS_COUNT_HZ register accessible with the KVM_{GET,SET}_ONE_REG
      ioctls.
      
      When the frequency is altered the bias is adjusted such that the guest
      CP0_Count doesn't jump discontinuously or lose any timer interrupts.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: David Daney <david.daney@cavium.com>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f74a8e22
    • J
      MIPS: KVM: Add master disable count interface · f8239342
      James Hogan 提交于
      Expose two new virtual registers to userland via the
      KVM_{GET,SET}_ONE_REG ioctls.
      
      KVM_REG_MIPS_COUNT_CTL is for timer configuration fields and just
      contains a master disable count bit. This can be used by userland to
      freeze the timer in order to read a consistent state from the timer
      count value and timer interrupt pending bit. This cannot be done with
      the CP0_Cause.DC bit because the timer interrupt pending bit (TI) is
      also in CP0_Cause so it would be impossible to stop the timer without
      also risking a race with an hrtimer interrupt and having to explicitly
      check whether an interrupt should have occurred.
      
      When the timer is re-enabled it resumes without losing time, i.e. the
      CP0_Count value jumps to what it would have been had the timer not been
      disabled, which would also be impossible to do from userland with
      CP0_Cause.DC. The timer interrupt also cannot be lost, i.e. if a timer
      interrupt would have occurred had the timer not been disabled it is
      queued when the timer is re-enabled.
      
      This works by storing the nanosecond monotonic time when the master
      disable is set, and using it for various operations instead of the
      current monotonic time (e.g. when recalculating the bias when the
      CP0_Count is set), until the master disable is cleared again, i.e. the
      timer state is read/written as it would have been at that time. This
      state is exposed to userland via the read-only KVM_REG_MIPS_COUNT_RESUME
      virtual register so that userland can determine the exact time the
      master disable took effect.
      
      This should allow userland to atomically save the state of the timer,
      and later restore it.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: David Daney <david.daney@cavium.com>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f8239342
    • J
      MIPS: KVM: Rewrite count/compare timer emulation · e30492bb
      James Hogan 提交于
      Previously the emulation of the CPU timer was just enough to get a Linux
      guest running but some shortcuts were taken:
       - The guest timer interrupt was hard coded to always happen every 10 ms
         rather than being timed to when CP0_Count would match CP0_Compare.
       - The guest's CP0_Count register was based on the host's CP0_Count
         register. This isn't very portable and fails on cores without a
         CP_Count register implemented such as Ingenic XBurst. It also meant
         that the guest's CP0_Cause.DC bit to disable the CP0_Count register
         took no effect.
       - The guest's CP0_Count register was emulated by just dividing the
         host's CP0_Count register by 4. This resulted in continuity problems
         when used as a clock source, since when the host CP0_Count overflows
         from 0x7fffffff to 0x80000000, the guest CP0_Count transitions
         discontinuously from 0x1fffffff to 0xe0000000.
      
      Therefore rewrite & fix emulation of the guest timer based on the
      monotonic kernel time (i.e. ktime_get()). Internally a 32-bit count_bias
      value is added to the frequency scaled nanosecond monotonic time to get
      the guest's CP0_Count. The frequency of the timer is initialised to
      100MHz and cannot yet be changed, but a later patch will allow the
      frequency to be configured via the KVM_{GET,SET}_ONE_REG ioctl
      interface.
      
      The timer can now be stopped via the CP0_Cause.DC bit (by the guest or
      via the KVM_SET_ONE_REG ioctl interface), at which point the current
      CP0_Count is stored and can be read directly. When it is restarted the
      bias is recalculated such that the CP0_Count value is continuous.
      
      Due to the nature of hrtimer interrupts any read of the guest's
      CP0_Count register while it is running triggers a check for whether the
      hrtimer has expired, so that the guest/userland cannot observe the
      CP0_Count passing CP0_Compare without queuing a timer interrupt. This is
      also taken advantage of when stopping the timer to ensure that a pending
      timer interrupt is queued.
      
      This replaces the implementation of:
       - Guest read of CP0_Count
       - Guest write of CP0_Count
       - Guest write of CP0_Compare
       - Guest write of CP0_Cause
       - Guest read of HWR 2 (CC) with RDHWR
       - Host read of CP0_Count via KVM_GET_ONE_REG ioctl interface
       - Host write of CP0_Count via KVM_SET_ONE_REG ioctl interface
       - Host write of CP0_Compare via KVM_SET_ONE_REG ioctl interface
       - Host write of CP0_Cause via KVM_SET_ONE_REG ioctl interface
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      e30492bb
    • J
      MIPS: KVM: Migrate hrtimer to follow VCPU · 3a0ba774
      James Hogan 提交于
      When a VCPU is scheduled in on a different CPU, refresh the hrtimer used
      for emulating count/compare so that it gets migrated to the same CPU.
      
      This should prevent a timer interrupt occurring on a different CPU to
      where the guest it relates to is running, which would cause the guest
      timer interrupt not to be delivered until after the next guest exit.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3a0ba774
    • J
      MIPS: KVM: Deliver guest interrupts after local_irq_disable() · 044f0f03
      James Hogan 提交于
      When about to run the guest, deliver guest interrupts after disabling
      host interrupts. This should prevent an hrtimer interrupt from being
      handled after delivering guest interrupts, and therefore not delivering
      the guest timer interrupt until after the next guest exit.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      044f0f03
    • J
      MIPS: KVM: Add CP0_HWREna KVM register access · 16fd5c1d
      James Hogan 提交于
      Implement KVM_{GET,SET}_ONE_REG ioctl based access to the guest CP0
      HWREna register. This is so that userland can save and restore its
      value so that RDHWR instructions don't have to be emulated by the guest.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: David Daney <david.daney@cavium.com>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      16fd5c1d
    • J
      MIPS: KVM: Add CP0_UserLocal KVM register access · 7767b7d2
      James Hogan 提交于
      Implement KVM_{GET,SET}_ONE_REG ioctl based access to the guest CP0
      UserLocal register. This is so that userland can save and restore its
      value.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: David Daney <david.daney@cavium.com>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7767b7d2
    • J
      MIPS: KVM: Add CP0_Count/Compare KVM register access · f8be02da
      James Hogan 提交于
      Implement KVM_{GET,SET}_ONE_REG ioctl based access to the guest CP0
      Count and Compare registers. These registers are special in that writing
      to them has side effects (adjusting the time until the next timer
      interrupt) and reading of Count depends on the time. Therefore add a
      couple of callbacks so that different implementations (trap & emulate or
      VZ) can implement them differently depending on what the hardware
      provides.
      
      The trap & emulate versions mostly duplicate what happens when a T&E
      guest reads or writes these registers, so it inherits the same
      limitations which can be fixed in later patches.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: David Daney <david.daney@cavium.com>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f8be02da
    • J
      MIPS: KVM: Move KVM_{GET,SET}_ONE_REG definitions into kvm_host.h · 48a3c4e4
      James Hogan 提交于
      Move the KVM_{GET,SET}_ONE_REG MIPS register id definitions out of
      kvm_mips.c to kvm_host.h so that they can be shared between multiple
      source files. This allows register access to be indirected depending on
      the underlying implementation (trap & emulate or VZ).
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: David Daney <david.daney@cavium.com>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      48a3c4e4
    • J
      MIPS: KVM: Add CP0_EPC KVM register access · fb6df0cd
      James Hogan 提交于
      Contrary to the comment, the guest CP0_EPC register cannot be set via
      kvm_regs, since it is distinct from the guest PC. Add the EPC register
      to the KVM_{GET,SET}_ONE_REG ioctl interface.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: David Daney <david.daney@cavium.com>
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fb6df0cd
    • J
      MIPS: KVM: Use tlb_write_random · b5dfc6c1
      James Hogan 提交于
      When MIPS KVM needs to write a TLB entry for the guest it reads the
      CP0_Random register, uses it to generate the CP_Index, and writes the
      TLB entry using the TLBWI instruction (tlb_write_indexed()).
      
      However there's an instruction for that, TLBWR (tlb_write_random()) so
      use that instead.
      
      This happens to also fix an issue with Ingenic XBurst cores where the
      same TLB entry is replaced each time preventing forward progress on
      stores due to alternating between TLB load misses for the instruction
      fetch and TLB store misses.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b5dfc6c1
    • J
      MIPS: KVM: Use local_flush_icache_range to fix RI on XBurst · facaaec1
      James Hogan 提交于
      MIPS KVM uses mips32_SyncICache to synchronise the icache with the
      dcache after dynamically modifying guest instructions or writing guest
      exception vector. However this uses rdhwr to get the SYNCI step, which
      causes a reserved instruction exception on Ingenic XBurst cores.
      
      It would seem to make more sense to use local_flush_icache_range()
      instead which does the same thing but is more portable.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      facaaec1
    • J
      MIPS: KVM: Allocate at least 16KB for exception handlers · 7006e2df
      James Hogan 提交于
      Each MIPS KVM guest has its own copy of the KVM exception vector. This
      contains the TLB refill exception handler at offset 0x000, the general
      exception handler at offset 0x180, and interrupt exception handlers at
      offset 0x200 in case Cause_IV=1. A common handler is copied to offset
      0x2000 and offset 0x3000 is used for temporarily storing k1 during entry
      from guest.
      
      However the amount of memory allocated for this purpose is calculated as
      0x200 rounded up to the next page boundary, which is insufficient if 4KB
      pages are in use. This can lead to the common handler at offset 0x2000
      being overwritten and infinitely recursive exceptions on the next exit
      from the guest.
      
      Increase the minimum size from 0x200 to 0x4000 to cover the full use of
      the page.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: kvm@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7006e2df
    • D
      MIPS: KVM: remove the stale memory alias support function unalias_gfn · 356d4c20
      Deng-Cheng Zhu 提交于
      The memory alias support has been removed since a1f4d395 (KVM: Remove
      memory alias support). So remove unalias_gfn from the MIPS port.
      Reviewed-by: NJames Hogan <james.hogan@imgtec.com>
      Signed-off-by: NDeng-Cheng Zhu <dengcheng.zhu@imgtec.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      356d4c20
  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 3 次提交