1. 25 1月, 2017 2 次提交
  2. 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
  3. 08 9月, 2016 2 次提交
  4. 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
  5. 19 7月, 2016 9 次提交
  6. 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
  7. 20 5月, 2016 8 次提交
  8. 03 5月, 2016 1 次提交
  9. 09 3月, 2016 2 次提交
  10. 14 12月, 2015 1 次提交
  11. 25 11月, 2015 1 次提交
    • C
      KVM: arm/arm64: arch_timer: Preserve physical dist. active state on LR.active · 0e3dfda9
      Christoffer Dall 提交于
      We were incorrectly removing the active state from the physical
      distributor on the timer interrupt when the timer output level was
      deasserted.  We shouldn't be doing this without considering the virtual
      interrupt's active state, because the architecture requires that when an
      LR has the HW bit set and the pending or active bits set, then the
      physical interrupt must also have the corresponding bits set.
      
      This addresses an issue where we have been observing an inconsistency
      between the LR state and the physical distributor state where the LR
      state was active and the physical distributor was not active, which
      shouldn't happen.
      Reviewed-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      0e3dfda9
  12. 04 11月, 2015 2 次提交
  13. 23 10月, 2015 2 次提交
    • M
      KVM: arm: Do not indent the arguments of DECLARE_BITMAP · 5fdf876d
      Michal Marek 提交于
      Besides being a coding style issue, it confuses make tags:
      
      ctags: Warning: include/kvm/arm_vgic.h:307: null expansion of name pattern "\1"
      ctags: Warning: include/kvm/arm_vgic.h:308: null expansion of name pattern "\1"
      ctags: Warning: include/kvm/arm_vgic.h:309: null expansion of name pattern "\1"
      ctags: Warning: include/kvm/arm_vgic.h:317: null expansion of name pattern "\1"
      
      Cc: kvmarm@lists.cs.columbia.edu
      Signed-off-by: NMichal Marek <mmarek@suse.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      5fdf876d
    • C
      arm/arm64: KVM: Rework the arch timer to use level-triggered semantics · 4b4b4512
      Christoffer Dall 提交于
      The arch timer currently uses edge-triggered semantics in the sense that
      the line is never sampled by the vgic and lowering the line from the
      timer to the vgic doesn't have any effect on the pending state of
      virtual interrupts in the vgic.  This means that we do not support a
      guest with the otherwise valid behavior of (1) disable interrupts (2)
      enable the timer (3) disable the timer (4) enable interrupts.  Such a
      guest would validly not expect to see any interrupts on real hardware,
      but will see interrupts on KVM.
      
      This patch fixes this shortcoming through the following series of
      changes.
      
      First, we change the flow of the timer/vgic sync/flush operations.  Now
      the timer is always flushed/synced before the vgic, because the vgic
      samples the state of the timer output.  This has the implication that we
      move the timer operations in to non-preempible sections, but that is
      fine after the previous commit getting rid of hrtimer schedules on every
      entry/exit.
      
      Second, we change the internal behavior of the timer, letting the timer
      keep track of its previous output state, and only lower/raise the line
      to the vgic when the state changes.  Note that in theory this could have
      been accomplished more simply by signalling the vgic every time the
      state *potentially* changed, but we don't want to be hitting the vgic
      more often than necessary.
      
      Third, we get rid of the use of the map->active field in the vgic and
      instead simply set the interrupt as active on the physical distributor
      whenever the input to the GIC is asserted and conversely clear the
      physical active state when the input to the GIC is deasserted.
      
      Fourth, and finally, we now initialize the timer PPIs (and all the other
      unused PPIs for now), to be level-triggered, and modify the sync code to
      sample the line state on HW sync and re-inject a new interrupt if it is
      still pending at that time.
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      4b4b4512
  14. 10 10月, 2015 1 次提交
  15. 17 9月, 2015 1 次提交
    • M
      arm/arm64: KVM: Remove 'config KVM_ARM_MAX_VCPUS' · ef748917
      Ming Lei 提交于
      This patch removes config option of KVM_ARM_MAX_VCPUS,
      and like other ARCHs, just choose the maximum allowed
      value from hardware, and follows the reasons:
      
      1) from distribution view, the option has to be
      defined as the max allowed value because it need to
      meet all kinds of virtulization applications and
      need to support most of SoCs;
      
      2) using a bigger value doesn't introduce extra memory
      consumption, and the help text in Kconfig isn't accurate
      because kvm_vpu structure isn't allocated until request
      of creating VCPU is sent from QEMU;
      
      3) the main effect is that the field of vcpus[] in 'struct kvm'
      becomes a bit bigger(sizeof(void *) per vcpu) and need more cache
      lines to hold the structure, but 'struct kvm' is one generic struct,
      and it has worked well on other ARCHs already in this way. Also,
      the world switch frequecy is often low, for example, it is ~2000
      when running kernel building load in VM from APM xgene KVM host,
      so the effect is very small, and the difference can't be observed
      in my test at all.
      
      Cc: Dann Frazier <dann.frazier@canonical.com>
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      ef748917
  16. 12 8月, 2015 4 次提交