1. 12 8月, 2018 1 次提交
  2. 21 7月, 2018 3 次提交
  3. 25 5月, 2018 3 次提交
  4. 27 4月, 2018 1 次提交
    • M
      KVM: arm/arm64: vgic: Fix source vcpu issues for GICv2 SGI · 53692908
      Marc Zyngier 提交于
      Now that we make sure we don't inject multiple instances of the
      same GICv2 SGI at the same time, we've made another bug more
      obvious:
      
      If we exit with an active SGI, we completely lose track of which
      vcpu it came from. On the next entry, we restore it with 0 as a
      source, and if that wasn't the right one, too bad. While this
      doesn't seem to trouble GIC-400, the architectural model gets
      offended and doesn't deactivate the interrupt on EOI.
      
      Another connected issue is that we will happilly make pending
      an interrupt from another vcpu, overriding the above zero with
      something that is just as inconsistent. Don't do that.
      
      The final issue is that we signal a maintenance interrupt when
      no pending interrupts are present in the LR. Assuming we've fixed
      the two issues above, we end-up in a situation where we keep
      exiting as soon as we've reached the active state, and not be
      able to inject the following pending.
      
      The fix comes in 3 parts:
      - GICv2 SGIs have their source vcpu saved if they are active on
        exit, and restored on entry
      - Multi-SGIs cannot go via the Pending+Active state, as this would
        corrupt the source field
      - Multi-SGIs are converted to using MI on EOI instead of NPIE
      
      Fixes: 16ca6a60 ("KVM: arm/arm64: vgic: Don't populate multiple LRs with the same vintid")
      Reported-by: NMark Rutland <mark.rutland@arm.com>
      Tested-by: NMark Rutland <mark.rutland@arm.com>
      Reviewed-by: NChristoffer Dall <christoffer.dall@arm.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      53692908
  5. 19 3月, 2018 2 次提交
  6. 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
  7. 02 1月, 2018 1 次提交
  8. 10 11月, 2017 4 次提交
  9. 07 11月, 2017 1 次提交
  10. 15 6月, 2017 1 次提交
  11. 08 6月, 2017 4 次提交
  12. 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
  13. 09 5月, 2017 2 次提交
  14. 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
  15. 09 4月, 2017 3 次提交
  16. 04 4月, 2017 1 次提交
  17. 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
  18. 25 1月, 2017 2 次提交
  19. 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
  20. 08 9月, 2016 2 次提交
  21. 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
  22. 19 7月, 2016 2 次提交