An error occurred fetching the project authors.
  1. 02 Jan, 2018 1 commit
    • Christoffer Dall's avatar
      KVM: arm/arm64: vgic: Support level-triggered mapped interrupts · e40cc57b
      Christoffer Dall authored
      Level-triggered mapped IRQs are special because we only observe rising
      edges as input to the VGIC, and we don't set the EOI flag and therefore
      are not told when the level goes down, so that we can re-queue a new
      interrupt when the level goes up.
      
      One way to solve this problem is to side-step the logic of the VGIC and
      special case the validation in the injection path, but it has the
      unfortunate drawback of having to peak into the physical GIC state
      whenever we want to know if the interrupt is pending on the virtual
      distributor.
      
      Instead, we can maintain the current semantics of a level triggered
      interrupt by sort of treating it as an edge-triggered interrupt,
      following from the fact that we only observe an asserting edge.  This
      requires us to be a bit careful when populating the LRs and when folding
      the state back in though:
      
       * We lower the line level when populating the LR, so that when
         subsequently observing an asserting edge, the VGIC will do the right
         thing.
      
       * If the guest never acked the interrupt while running (for example if
         it had masked interrupts at the CPU level while running), we have
         to preserve the pending state of the LR and move it back to the
         line_level field of the struct irq when folding LR state.
      
         If the guest never acked the interrupt while running, but changed the
         device state and lowered the line (again with interrupts masked) then
         we need to observe this change in the line_level.
      
         Both of the above situations are solved by sampling the physical line
         and set the line level when folding the LR back.
      
       * Finally, if the guest never acked the interrupt while running and
         sampling the line reveals that the device state has changed and the
         line has been lowered, we must clear the physical active state, since
         we will otherwise never be told when the interrupt becomes asserted
         again.
      
      This has the added benefit of making the timer optimization patches
      (https://lists.cs.columbia.edu/pipermail/kvmarm/2017-July/026343.html) a
      bit simpler, because the timer code doesn't have to clear the active
      state on the sync anymore.  It also potentially improves the performance
      of the timer implementation because the GIC knows the state or the LR
      and only needs to clear the
      active state when the pending bit in the LR is still set, where the
      timer has to always clear it when returning from running the guest with
      an injected timer interrupt.
      Reviewed-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
      Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
      e40cc57b
  2. 29 Nov, 2017 1 commit
  3. 10 Nov, 2017 1 commit
  4. 06 Nov, 2017 1 commit
  5. 15 Jun, 2017 8 commits
  6. 24 May, 2017 1 commit
  7. 15 May, 2017 1 commit
  8. 09 May, 2017 4 commits
  9. 08 May, 2017 2 commits
  10. 19 Apr, 2017 1 commit
    • Marc Zyngier's avatar
      KVM: arm/arm64: vgic-v3: De-optimize VMCR save/restore when emulating a GICv2 · ff567614
      Marc Zyngier authored
      When emulating a GICv2-on-GICv3, special care must be taken to only
      save/restore VMCR_EL2 when ICC_SRE_EL1.SRE is cleared. Otherwise,
      all Group-0 interrupts end-up being delivered as FIQ, which is
      probably not what the guest expects, as demonstrated here with
      an unhappy EFI:
      
      	FIQ Exception at 0x000000013BD21CC4
      
      This means that we cannot perform the load/put trick when dealing
      with VMCR_EL2 (because the host has SRE set), and we have to deal
      with it in the world-switch.
      
      Fortunately, this is not the most common case (modern guests should
      be able to deal with GICv3 directly), and the performance is not worse
      than what it was before the VMCR optimization.
      Reviewed-by: default avatarChristoffer Dall <cdall@linaro.org>
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarChristoffer Dall <cdall@linaro.org>
      ff567614
  11. 09 Apr, 2017 3 commits
  12. 06 Mar, 2017 1 commit
  13. 30 Jan, 2017 2 commits
  14. 25 Jan, 2017 1 commit
    • Christoffer Dall's avatar
      KVM: arm/arm64: Remove struct vgic_irq pending field · 8694e4da
      Christoffer Dall authored
      One of the goals behind the VGIC redesign was to get rid of cached or
      intermediate state in the data structures, but we decided to allow
      ourselves to precompute the pending value of an IRQ based on the line
      level and pending latch state.  However, this has now become difficult
      to base proper GICv3 save/restore on, because there is a potential to
      modify the pending state without knowing if an interrupt is edge or
      level configured.
      
      See the following post and related message for more background:
      https://lists.cs.columbia.edu/pipermail/kvmarm/2017-January/023195.html
      
      This commit gets rid of the precomputed pending field in favor of a
      function that calculates the value when needed, irq_is_pending().
      
      The soft_pending field is renamed to pending_latch to represent that
      this latch is the equivalent hardware latch which gets manipulated by
      the input signal for edge-triggered interrupts and when writing to the
      SPENDR/CPENDR registers.
      
      After this commit save/restore code should be able to simply restore the
      pending_latch state, line_level state, and config state in any order and
      get the desired result.
      Reviewed-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Tested-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
      8694e4da
  15. 13 Jan, 2017 1 commit
  16. 24 Nov, 2016 1 commit
  17. 15 Aug, 2016 1 commit
  18. 18 Jul, 2016 4 commits
  19. 31 May, 2016 1 commit
  20. 20 May, 2016 4 commits