1. 19 3月, 2018 2 次提交
  2. 15 3月, 2018 1 次提交
    • C
      KVM: arm/arm64: Reset mapped IRQs on VM reset · 413aa807
      Christoffer Dall 提交于
      We currently don't allow resetting mapped IRQs from userspace, because
      their state is controlled by the hardware.  But we do need to reset the
      state when the VM is reset, so we provide a function for the 'owner' of
      the mapped interrupt to reset the interrupt state.
      
      Currently only the timer uses mapped interrupts, so we call this
      function from the timer reset logic.
      
      Cc: stable@vger.kernel.org
      Fixes: 4c60e360 ("KVM: arm/arm64: Provide a get_input_level for the arch timer")
      Signed-off-by: NChristoffer Dall <cdall@kernel.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      413aa807
  3. 02 1月, 2018 1 次提交
  4. 10 11月, 2017 4 次提交
  5. 07 11月, 2017 1 次提交
  6. 15 6月, 2017 1 次提交
  7. 08 6月, 2017 4 次提交
  8. 18 5月, 2017 1 次提交
    • C
      KVM: arm/arm64: Fix bug when registering redist iodevs · 552c9f47
      Christoffer Dall 提交于
      If userspace creates the VCPUs after initializing the VGIC, then we end
      up in a situation where we trigger a bug in kvm_vcpu_get_idx(), because
      it is called prior to adding the VCPU into the vcpus array on the VM.
      
      There is no tight coupling between the VCPU index and the area of the
      redistributor region used for the VCPU, so we can simply ensure that all
      creations of redistributors are serialized per VM, and increment an
      offset when we successfully add a redistributor.
      
      The vgic_register_redist_iodev() function can be called from two paths:
      vgic_redister_all_redist_iodev() which is called via the kvm_vgic_addr()
      device attribute handler.  This patch already holds the kvm->lock mutex.
      
      The other path is via kvm_vgic_vcpu_init, which is called through a
      longer chain from kvm_vm_ioctl_create_vcpu(), which releases the
      kvm->lock mutex just before calling kvm_arch_vcpu_create(), so we can
      simply take this mutex again later for our purposes.
      
      Fixes: ab6f468c10 ("KVM: arm/arm64: Register iodevs when setting redist base and creating VCPUs")
      Signed-off-by: NChristoffer Dall <cdall@linaro.org>
      Tested-by: NJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Reviewed-by: NEric Auger <eric.auger@redhat.com>
      552c9f47
  9. 09 5月, 2017 2 次提交
  10. 08 5月, 2017 1 次提交
    • E
      KVM: arm64: vgic-its: Introduce migration ABI infrastructure · 71afe470
      Eric Auger 提交于
      We plan to support different migration ABIs, ie. characterizing
      the ITS table layout format in guest RAM. For example, a new ABI
      will be needed if vLPIs get supported for nested use case.
      
      So let's introduce an array of supported ABIs (at the moment a single
      ABI is supported though). The following characteristics are foreseen
      to vary with the ABI: size of table entries, save/restore operation,
      the way abi settings are applied.
      
      By default the MAX_ABI_REV is applied on its creation. In subsequent
      patches we will introduce a way for the userspace to change the ABI
      in use.
      
      The entry sizes now are set according to the ABI version and not
      hardcoded anymore.
      Signed-off-by: NEric Auger <eric.auger@redhat.com>
      Reviewed-by: NChristoffer Dall <cdall@linaro.org>
      71afe470
  11. 09 4月, 2017 3 次提交
  12. 04 4月, 2017 1 次提交
  13. 30 1月, 2017 1 次提交
    • V
      KVM: arm/arm64: vgic: Implement VGICv3 CPU interface access · d017d7b0
      Vijaya Kumar K 提交于
      VGICv3 CPU interface registers are accessed using
      KVM_DEV_ARM_VGIC_CPU_SYSREGS ioctl. These registers are accessed
      as 64-bit. The cpu MPIDR value is passed along with register id.
      It is used to identify the cpu for registers access.
      
      The VM that supports SEIs expect it on destination machine to handle
      guest aborts and hence checked for ICC_CTLR_EL1.SEIS compatibility.
      Similarly, VM that supports Affinity Level 3 that is required for AArch64
      mode, is required to be supported on destination machine. Hence checked
      for ICC_CTLR_EL1.A3V compatibility.
      
      The arch/arm64/kvm/vgic-sys-reg-v3.c handles read and write of VGIC
      CPU registers for AArch64.
      
      For AArch32 mode, arch/arm/kvm/vgic-v3-coproc.c file is created but
      APIs are not implemented.
      
      Updated arch/arm/include/uapi/asm/kvm.h with new definitions
      required to compile for AArch32.
      
      The version of VGIC v3 specification is defined here
      Documentation/virtual/kvm/devices/arm-vgic-v3.txt
      Acked-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Reviewed-by: NEric Auger <eric.auger@redhat.com>
      Signed-off-by: NPavel Fedin <p.fedin@samsung.com>
      Signed-off-by: NVijaya Kumar K <Vijaya.Kumar@cavium.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      d017d7b0
  14. 25 1月, 2017 2 次提交
  15. 22 9月, 2016 2 次提交
    • V
      ARM: KVM: Support vgic-v3 · acda5430
      Vladimir Murzin 提交于
      This patch allows to build and use vgic-v3 in 32-bit mode.
      
      Unfortunately, it can not be split in several steps without extra
      stubs to keep patches independent and bisectable.  For instance,
      virt/kvm/arm/vgic/vgic-v3.c uses function from vgic-v3-sr.c, handling
      access to GICv3 cpu interface from the guest requires vgic_v3.vgic_sre
      to be already defined.
      
      It is how support has been done:
      
      * handle SGI requests from the guest
      
      * report configured SRE on access to GICv3 cpu interface from the guest
      
      * required vgic-v3 macros are provided via uapi.h
      
      * static keys are used to select GIC backend
      
      * to make vgic-v3 build KVM_ARM_VGIC_V3 guard is removed along with
        the static inlines
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      acda5430
    • V
      arm64: KVM: Use static keys for selecting the GIC backend · 5a7a8426
      Vladimir Murzin 提交于
      Currently GIC backend is selected via alternative framework and this
      is fine. We are going to introduce vgic-v3 to 32-bit world and there
      we don't have patching framework in hand, so we can either check
      support for GICv3 every time we need to choose which backend to use or
      try to optimise it by using static keys. The later looks quite
      promising because we can share logic involved in selecting GIC backend
      between architectures if both uses static keys.
      
      This patch moves arm64 from alternative to static keys framework for
      selecting GIC backend. For that we embed static key into vgic_global
      and enable the key during vgic initialisation based on what has
      already been exposed by the host GIC driver.
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      5a7a8426
  16. 08 9月, 2016 2 次提交
  17. 23 7月, 2016 1 次提交
    • E
      KVM: arm/arm64: Enable irqchip routing · 180ae7b1
      Eric Auger 提交于
      This patch adds compilation and link against irqchip.
      
      Main motivation behind using irqchip code is to enable MSI
      routing code. In the future irqchip routing may also be useful
      when targeting multiple irqchips.
      
      Routing standard callbacks now are implemented in vgic-irqfd:
      - kvm_set_routing_entry
      - kvm_set_irq
      - kvm_set_msi
      
      They only are supported with new_vgic code.
      
      Both HAVE_KVM_IRQCHIP and HAVE_KVM_IRQ_ROUTING are defined.
      KVM_CAP_IRQ_ROUTING is advertised and KVM_SET_GSI_ROUTING is allowed.
      
      So from now on IRQCHIP routing is enabled and a routing table entry
      must exist for irqfd injection to succeed for a given SPI. This patch
      builds a default flat irqchip routing table (gsi=irqchip.pin) covering
      all the VGIC SPI indexes. This routing table is overwritten by the
      first first user-space call to KVM_SET_GSI_ROUTING ioctl.
      
      MSI routing setup is not yet allowed.
      Signed-off-by: NEric Auger <eric.auger@redhat.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      180ae7b1
  18. 19 7月, 2016 9 次提交
  19. 04 7月, 2016 1 次提交
    • M
      KVM: arm/arm64: The GIC is dead, long live the GIC · 50926d82
      Marc Zyngier 提交于
      I don't think any single piece of the KVM/ARM code ever generated
      as much hatred as the GIC emulation.
      
      It was written by someone who had zero experience in modeling
      hardware (me), was riddled with design flaws, should have been
      scrapped and rewritten from scratch long before having a remote
      chance of reaching mainline, and yet we supported it for a good
      three years. No need to mention the names of those who suffered,
      the git log is singing their praises.
      
      Thankfully, we now have a much more maintainable implementation,
      and we can safely put the grumpy old GIC to rest.
      
      Fellow hackers, please raise your glass in memory of the GIC:
      
      	The GIC is dead, long live the GIC!
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      50926d82