1. 07 6月, 2014 1 次提交
  2. 05 6月, 2014 2 次提交
    • F
      sys_sgetmask/sys_ssetmask: add CONFIG_SGETMASK_SYSCALL · f6187769
      Fabian Frederick 提交于
      sys_sgetmask and sys_ssetmask are obsolete system calls no longer
      supported in libc.
      
      This patch replaces architecture related __ARCH_WANT_SYS_SGETMAX by expert
      mode configuration.That option is enabled by default for those
      architectures.
      Signed-off-by: NFabian Frederick <fabf@skynet.be>
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Greg Ungerer <gerg@uclinux.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f6187769
    • N
      hugetlb: restrict hugepage_migration_support() to x86_64 · c177c81e
      Naoya Horiguchi 提交于
      Currently hugepage migration is available for all archs which support
      pmd-level hugepage, but testing is done only for x86_64 and there're
      bugs for other archs.  So to avoid breaking such archs, this patch
      limits the availability strictly to x86_64 until developers of other
      archs get interested in enabling this feature.
      
      Simply disabling hugepage migration on non-x86_64 archs is not enough to
      fix the reported problem where sys_move_pages() hits the BUG_ON() in
      follow_page(FOLL_GET), so let's fix this by checking if hugepage
      migration is supported in vma_migratable().
      Signed-off-by: NNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Reported-by: NMichael Ellerman <mpe@ellerman.id.au>
      Tested-by: NMichael Ellerman <mpe@ellerman.id.au>
      Acked-by: NHugh Dickins <hughd@google.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: <stable@vger.kernel.org>	[3.12+]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c177c81e
  3. 30 5月, 2014 24 次提交
    • J
      MIPS: KVM: Remove redundant semicolon · ee1a725f
      James Hogan 提交于
      Remove extra semicolon in kvm_arch_vcpu_dump_regs().
      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>
      ee1a725f
    • J
      MIPS: KVM: Remove redundant NULL checks before kfree() · c6c0a663
      James Hogan 提交于
      The kfree() function already NULL checks the parameter so remove the
      redundant NULL checks before kfree() calls in arch/mips/kvm/.
      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>
      c6c0a663
    • J
      MIPS: KVM: Quieten kvm_info() logging · 6e95bfd2
      James Hogan 提交于
      The logging from MIPS KVM is fairly noisy with kvm_info() in places
      where it shouldn't be, such as on VM creation and migration to a
      different CPU. Replace these kvm_info() calls with kvm_debug().
      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>
      6e95bfd2
    • 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: Whitespace fixes in kvm_mips_callbacks · 2dca3725
      James Hogan 提交于
      Fix whitespace in struct kvm_mips_callbacks function pointers.
      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>
      2dca3725
    • 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: Override guest kernel timer frequency directly · eda3d33c
      James Hogan 提交于
      The KVM_HOST_FREQ Kconfig symbol was used by KVM guest kernels to
      override the timer frequency calculation to a value based on the host
      frequency. Now that the KVM timer emulation is implemented independent
      of the host timer frequency and defaults to 100MHz, adjust the working
      of CONFIG_KVM_HOST_FREQ to match.
      
      The Kconfig symbol now specifies the guest timer frequency directly, and
      has been renamed accordingly to KVM_GUEST_TIMER_FREQ. It now defaults to
      100MHz too and the help text is updated to make it clear that a zero
      value will allow the normal timer frequency calculation to take place
      (based on the emulated RTC).
      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: linux-mips@linux-mips.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      eda3d33c
    • 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: Fix timer race modifying guest CP0_Cause · c73c99b0
      James Hogan 提交于
      The hrtimer callback for guest timer timeouts sets the guest's
      CP0_Cause.TI bit to indicate to the guest that a timer interrupt is
      pending, however there is no mutual exclusion implemented to prevent
      this occurring while the guest's CP0_Cause register is being
      read-modify-written elsewhere.
      
      When this occurs the setting of the CP0_Cause.TI bit is undone and the
      guest misses the timer interrupt and doesn't reprogram the CP0_Compare
      register for the next timeout. Currently another timer interrupt will be
      triggered again in another 10ms anyway due to the way timers are
      emulated, but after the MIPS timer emulation is fixed this would result
      in Linux guest time standing still and the guest scheduler not being
      invoked until the guest CP0_Count has looped around again, which at
      100MHz takes just under 43 seconds.
      
      Currently this is the only asynchronous modification of guest registers,
      therefore it is fixed by adjusting the implementations of the
      kvm_set_c0_guest_cause(), kvm_clear_c0_guest_cause(), and
      kvm_change_c0_guest_cause() macros which are used for modifying the
      guest CP0_Cause register to use ll/sc to ensure atomic modification.
      This should work in both UP and SMP cases without requiring interrupts
      to be disabled.
      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>
      c73c99b0
    • 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: Export local_flush_icache_range for KVM · 90f91356
      James Hogan 提交于
      Export the local_flush_icache_range function pointer for GPL modules so
      that it can be used by KVM for syncing the icache after binary
      translation of trapping instructions.
      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: linux-mips@linux-mips.org
      Cc: Sanjay Lal <sanjayl@kymasys.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      90f91356
    • 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
  4. 28 5月, 2014 6 次提交
  5. 26 5月, 2014 1 次提交
  6. 25 5月, 2014 3 次提交
  7. 23 5月, 2014 1 次提交
  8. 21 5月, 2014 1 次提交
  9. 16 5月, 2014 1 次提交