1. 21 7月, 2018 1 次提交
  2. 16 7月, 2018 2 次提交
  3. 13 5月, 2018 1 次提交
  4. 23 3月, 2018 1 次提交
    • S
      irqchip/gic-v3: Ensure GICR_CTLR.EnableLPI=0 is observed before enabling · 6eb486b6
      Shanker Donthineni 提交于
      Booting with GICR_CTLR.EnableLPI=1 is usually a bad idea, and may
      result in subtle memory corruption. Detecting this is thus pretty
      important.
      
      On detecting that LPIs are still enabled, we taint the kernel (because
      we're not sure of anything anymore), and try to disable LPIs. This can
      fail, as implementations are allowed to implement GICR_CTLR.EnableLPI
      as a one-way enable, meaning the redistributors cannot be reprogrammed
      with new tables.
      
      Should this happen, we fail probing the redistributor and warn the user
      that things are pretty dire.
      Signed-off-by: NShanker Donthineni <shankerd@codeaurora.org>
      [maz: reworded changelog, minor comment and message changes]
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      6eb486b6
  5. 15 3月, 2018 1 次提交
    • M
      KVM: arm/arm64: vgic: Don't populate multiple LRs with the same vintid · 16ca6a60
      Marc Zyngier 提交于
      The vgic code is trying to be clever when injecting GICv2 SGIs,
      and will happily populate LRs with the same interrupt number if
      they come from multiple vcpus (after all, they are distinct
      interrupt sources).
      
      Unfortunately, this is against the letter of the architecture,
      and the GICv2 architecture spec says "Each valid interrupt stored
      in the List registers must have a unique VirtualID for that
      virtual CPU interface.". GICv3 has similar (although slightly
      ambiguous) restrictions.
      
      This results in guests locking up when using GICv2-on-GICv3, for
      example. The obvious fix is to stop trying so hard, and inject
      a single vcpu per SGI per guest entry. After all, pending SGIs
      with multiple source vcpus are pretty rare, and are mostly seen
      in scenario where the physical CPUs are severely overcomitted.
      
      But as we now only inject a single instance of a multi-source SGI per
      vcpu entry, we may delay those interrupts for longer than strictly
      necessary, and run the risk of injecting lower priority interrupts
      in the meantime.
      
      In order to address this, we adopt a three stage strategy:
      - If we encounter a multi-source SGI in the AP list while computing
        its depth, we force the list to be sorted
      - When populating the LRs, we prevent the injection of any interrupt
        of lower priority than that of the first multi-source SGI we've
        injected.
      - Finally, the injection of a multi-source SGI triggers the request
        of a maintenance interrupt when there will be no pending interrupt
        in the LRs (HCR_NPIE).
      
      At the point where the last pending interrupt in the LRs switches
      from Pending to Active, the maintenance interrupt will be delivered,
      allowing us to add the remaining SGIs using the same process.
      
      Cc: stable@vger.kernel.org
      Fixes: 0919e84c ("KVM: arm/arm64: vgic-new: Add IRQ sync/flush framework")
      Acked-by: NChristoffer Dall <cdall@kernel.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      16ca6a60
  6. 14 3月, 2018 1 次提交
    • D
      irqchip/gic-v3-its: Add ability to save/restore ITS state · dba0bc7b
      Derek Basehore 提交于
      Some platforms power off GIC logic in suspend, so we need to
      save/restore state. The distributor and redistributor registers need
      to be handled in firmware code due to access permissions on those
      registers, but the ITS registers can be restored in the kernel.
      
      We limit this to systems where the ITS collections are implemented
      in HW (as opposed to being backed by memory tables), as they are
      the only ones that cannot be dealt with by the firmware.
      Signed-off-by: NDerek Basehore <dbasehore@chromium.org>
      [maz: fixed changelog, dropped DT property, limited to HCC being >0]
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      dba0bc7b
  7. 19 10月, 2017 1 次提交
    • S
      irqchip/gic-v3: Add support for Range Selector (RS) feature · eda0d04a
      Shanker Donthineni 提交于
      A new feature Range Selector (RS) has been added to GIC specification
      in order to support more than 16 CPUs at affinity level 0. New fields
      are introduced in SGI system registers (ICC_SGI0R_EL1, ICC_SGI1R_EL1
      and ICC_ASGI1R_EL1) to relax an artificial limit of 16 at level 0.
      
      - A new RSS field in ICC_CTLR_EL3, ICC_CTLR_EL1 and ICV_CTLR_EL1:
        [18] - Range Selector Support (RSS)
        0b0 = Targeted SGIs with affinity level 0 values of 0-15 are supported.
        0b1 = Targeted SGIs with affinity level 0 values of 0-255 are supported.
      
      - A new RS field in ICC_SGI0R_EL1, ICC_SGI1R_EL1 and ICC_ASGI1R_EL1:
        [47:44] - RangeSelector (RS) which group of 16 TargetList[n] field
                  TargetList[n] represents aff0 value ((RS*16)+n)
                  When ICC_CTLR_EL3.RSS==0 or ICC_CTLR_EL1.RSS==0, RS is RES0.
      
      - A new RSS field in GICD_TYPER:
        [26] - Range Selector Support (RSS)
        0b0 = Targeted SGIs with affinity level 0 values of 0-15 are supported.
        0b1 = Targeted SGIs with affinity level 0 values of 0-255 are supported.
      Signed-off-by: NShanker Donthineni <shankerd@codeaurora.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      eda0d04a
  8. 13 10月, 2017 1 次提交
    • S
      irqchip/gic-v3-its: Add missing changes to support 52bit physical address · 30ae9610
      Shanker Donthineni 提交于
      The current ITS driver works fine as long as normal memory and GICR
      regions are located within the lower 48bit (>=0 && <2^48) physical
      address space. Some of the registers GICR_PEND/PROP, GICR_VPEND/VPROP
      and GITS_CBASER are handled properly but not all when configuring
      the hardware with 52bit physical address.
      
      This patch does the following changes to support 52bit PA.
        -Handle 52bit PA in GITS_BASERn.
        -Fix ITT_addr width to 52bits, bits[51:8].
        -Fix RDbase width to 52bits, bits[51:16].
        -Fix VPT_addr width to 52bits, bits[51:16].
      
      Definition of the GITS_BASERn register when ITS PageSize is 64KB:
        -Bits[47:16] of the register provide bits[47:16] of the table PA.
        -Bits[15:12] of the register provide bits[51:48] of the table PA.
        -Bits[15:00] of the base physical address are 0.
      Signed-off-by: NShanker Donthineni <shankerd@codeaurora.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      30ae9610
  9. 31 8月, 2017 4 次提交
  10. 23 8月, 2017 2 次提交
  11. 15 6月, 2017 5 次提交
  12. 24 5月, 2017 1 次提交
  13. 08 5月, 2017 4 次提交
  14. 06 3月, 2017 1 次提交
  15. 08 2月, 2017 3 次提交
  16. 30 1月, 2017 2 次提交
  17. 29 11月, 2016 1 次提交
  18. 14 11月, 2016 1 次提交
  19. 17 10月, 2016 1 次提交
  20. 13 9月, 2016 1 次提交
    • T
      irqchip/gicv3-its: Refactor ITS DT init code to prepare for ACPI · db40f0a7
      Tomasz Nowicki 提交于
      In order to add ACPI support we need to isolate ACPI&DT common code and
      move DT logic to corresponding functions. To achieve this we are using
      firmware agnostic handle which can be unpacked to either DT or ACPI node.
      
      No functional changes other than a very minor one:
      1. Terminate its_init call with -ENODEV for non-DT case which allows
      to remove hack from its-gic-v3.c.
      2. Fix ITS base register address type (from 'unsigned long' to 'phys_addr_t'),
      as a bonus we get nice string formatting.
      3. Since there is only one of ITS parent domain convert it to static global
      variable and drop the parameter from its_probe_one. Users can refer to it
      in more convenient way then.
      Signed-off-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NTomasz Nowicki <tn@semihalf.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      db40f0a7
  21. 09 8月, 2016 1 次提交
  22. 19 7月, 2016 2 次提交
  23. 13 6月, 2016 2 次提交
    • S
      irqchip/gicv3-its: Implement two-level(indirect) device table support · 3faf24ea
      Shanker Donthineni 提交于
      Since device IDs are extremely sparse, the single, a.k.a flat table is
      not sufficient for the following two reasons.
      
      1) According to ARM-GIC spec, ITS hw can access maximum of 256(pages)*
         64K(pageszie) bytes. In the best case, it supports upto DEVid=21
         sparse with minimum device table entry size 8bytes.
      
      2) The maximum memory size that is possible without memblock depends on
         MAX_ORDER. 4MB on 4K page size kernel with default MAX_ORDER, so it
         supports DEVid range 19bits.
      
      The two-level device table feature brings us two advantages, the first
      is a very high possibility of supporting upto 32bit sparse, and the
      second one is the best utilization of memory allocation.
      
      The feature is enabled automatically during driver probe if the memory
      requirement is more than 2*ITS-pages and the hardware is capable of
      two-level table walk.
      Signed-off-by: NShanker Donthineni <shankerd@codeaurora.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      3faf24ea
    • S
      irqchip/gicv3-its: Split its_alloc_tables() into two functions · 9347359a
      Shanker Donthineni 提交于
      The function is getting out of control, it has too many goto
      statements and would be too complicated for adding a feature
      two-level device table. So, it is time for us to cleanup and
      move some of the logic to a separate function without affecting
      the existing functionality.
      Signed-off-by: NShanker Donthineni <shankerd@codeaurora.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      9347359a