1. 07 4月, 2017 15 次提交
  2. 06 4月, 2017 1 次提交
    • R
      Merge tag 'kvm_mips_4.12_1' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/kvm-mips · 715958f9
      Radim Krčmář 提交于
      From: James Hogan <james.hogan@imgtec.com>
      
      KVM: MIPS: VZ support, Octeon III, and TLBR
      
      Add basic support for the MIPS Virtualization Module (generally known as
      MIPS VZ) in KVM. We primarily support the ImgTec P5600, P6600, I6400,
      and Cavium Octeon III cores so far. Support is included for the
      following VZ / guest hardware features:
      - MIPS32 and MIPS64, r5 (VZ requires r5 or later) and r6
      - TLBs with GuestID (IMG cores) or Root ASID Dealias (Octeon III)
      - Shared physical root/guest TLB (IMG cores)
      - FPU / MSA
      - Cop0 timer (up to 1GHz for now due to soft timer limit)
      - Segmentation control (EVA)
      - Hardware page table walker (HTW) both for root and guest TLB
      
      Also included is a proper implementation of the TLBR instruction for the
      trap & emulate MIPS KVM implementation.
      
      Preliminary MIPS architecture changes are applied directly with Ralf's
      ack.
      715958f9
  3. 29 3月, 2017 17 次提交
  4. 28 3月, 2017 7 次提交
    • J
      KVM: MIPS/Emulate: Properly implement TLBR for T&E · dc44abd6
      James Hogan 提交于
      Properly implement emulation of the TLBR instruction for Trap & Emulate.
      This instruction reads the TLB entry pointed at by the CP0_Index
      register into the other TLB registers, which may have the side effect of
      changing the current ASID. Therefore abstract the CP0_EntryHi and ASID
      changing code into a common function in the process.
      
      A comment indicated that Linux doesn't use TLBR, which is true during
      normal use, however dumping of the TLB does use it (for example with the
      relatively recent 'x' magic sysrq key), as does a wired TLB entries test
      case in my KVM tests.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NRalf 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
      dc44abd6
    • J
      MIPS: Allow KVM to be enabled on Octeon CPUs · 0ae3abcd
      James Hogan 提交于
      Octeon III has VZ ASE support, so allow KVM to be enabled on Octeon
      CPUs as it should now be functional.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Daney <david.daney@cavium.com>
      Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      0ae3abcd
    • J
      KVM: MIPS/VZ: Handle Octeon III guest.PRid register · 1f48f9be
      James Hogan 提交于
      Octeon III implements a read-only guest CP0_PRid register, so add cases
      to the KVM register access API for Octeon to ensure the correct value is
      read and writes are ignored.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Daney <david.daney@cavium.com>
      Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      1f48f9be
    • J
      KVM: MIPS/VZ: Emulate hit CACHE ops for Octeon III · 3ba731da
      James Hogan 提交于
      Octeon III doesn't implement the optional GuestCtl0.CG bit to allow
      guest mode to execute virtual address based CACHE instructions, so
      implement emulation of a few important ones specifically for Octeon III
      in response to a GPSI exception.
      
      Currently the main reason to perform these operations is for icache
      synchronisation, so they are implemented as a simple icache flush with
      local_flush_icache_range().
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Daney <david.daney@cavium.com>
      Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      3ba731da
    • J
      KVM: MIPS/VZ: VZ hardware setup for Octeon III · 824533ad
      James Hogan 提交于
      Set up hardware virtualisation on Octeon III cores, configuring guest
      interrupt routing and carving out half of the root TLB for guest use,
      restoring it back again afterwards.
      
      We need to be careful to inhibit TLB shutdown machine check exceptions
      while invalidating guest TLB entries, since TLB invalidation is not
      available so guest entries must be invalidated by setting them to unique
      unmapped addresses, which could conflict with mappings set by the guest
      or root if recently repartitioned.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Daney <david.daney@cavium.com>
      Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      824533ad
    • J
      KVM: MIPS/T&E: Report correct dcache line size · 867f4da7
      James Hogan 提交于
      Octeon CPUs don't report the correct dcache line size in CP0_Config1.DL,
      so encode the correct value for the guest CP0_Config1.DL based on
      cpu_dcache_line_size().
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Daney <david.daney@cavium.com>
      Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      867f4da7
    • J
      KVM: MIPS/TLB: Handle virtually tagged icaches · 1c506c9c
      James Hogan 提交于
      When TLB entries are invalidated in the presence of a virtually tagged
      icache, such as that found on Octeon CPUs, flush the icache so that we
      don't get a reserved instruction exception even though the TLB mapping
      is removed.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Daney <david.daney@cavium.com>
      Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      1c506c9c