aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-08-31irqchip/ls-scfg-msi: Add LS1046a MSI supportMinghuan Lian1-35/+130
LS1046a includes 4 MSIRs, each MSIR is assigned a dedicate GIC SPI interrupt and provides 32 MSI interrupts. Compared to previous MSI, LS1046a's IBS(interrupt bit select) shift is changed to 2 and total MSI interrupt number is changed to 128. The patch adds structure 'ls_scfg_msir' to describe MSIR setting and 'ibs_shift' to store the different value between the SoCs. Signed-off-by: Minghuan Lian <[email protected]> Signed-off-by: Hou Zhiqiang <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31arm64: dts: ls1046a: Add MSI dts nodeMinghuan Lian2-0/+32
LS1046a includes 3 MSI controllers. Each controller supports 128 interrupts. Acked-by: Rob Herring <[email protected]> Signed-off-by: Minghuan Lian <[email protected]> Signed-off-by: Hou Zhiqiang <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31arm64: dts: ls1043a: Share all MSIsMinghuan Lian1-3/+3
In order to maximize the use of MSI, a PCIe controller will share all MSI controllers. The patch changes "msi-parent" to refer to all MSI controller dts nodes. Signed-off-by: Minghuan Lian <[email protected]> Signed-off-by: Hou Zhiqiang <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31arm: dts: ls1021a: Share all MSIsMinghuan Lian1-2/+2
In order to maximize the use of MSI, a PCIe controller will share all MSI controllers. The patch changes msi-parent to refer to all MSI controller dts nodes. Signed-off-by: Minghuan Lian <[email protected]> Signed-off-by: Hou Zhiqiang <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31arm64: dts: ls1043a: Fix typo of MSI compatible stringMinghuan Lian1-3/+3
"1" should be replaced by "l". This is a typo. The patch is to fix it. Signed-off-by: Minghuan Lian <[email protected]> Signed-off-by: Hou Zhiqiang <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31arm: dts: ls1021a: Fix typo of MSI compatible stringMinghuan Lian1-2/+2
"1" should be replaced by "l". This is a typo. The patch is to fix it. Signed-off-by: Minghuan Lian <[email protected]> Signed-off-by: Hou Zhiqiang <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/ls-scfg-msi: Fix typo of MSI compatible stringsMinghuan Lian2-5/+7
The patch is to fix typo of the Layerscape SCFG MSI dts compatible strings. "1" is replaced by "l". Acked-by: Rob Herring <[email protected]> Signed-off-by: Minghuan Lian <[email protected]> Signed-off-by: Hou Zhiqiang <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/irq-bcm7120-l2: Use correct I/O accessors for irq_fwd_maskFlorian Fainelli1-6/+4
Initialization of irq_fwd_mask was done using __raw_writel() which happens to work for all cases except when using ARM BE8 which requires writel() (with the proper swapping). Move the initialization of the irq_fwd_mask till later when we have correctly defined our I/O accessors. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/mmp: Make mmp_intc_conf constBhumika Goyal1-2/+2
Make these const as they are only used during a copy operation. Done using Coccinelle. @match disable optional_qualifier@ identifier s; @@ static struct mmp_intc_conf s = {...}; @ref@ position p; identifier match.s; @@ s@p @good1@ position ref.p; identifier match.s,f,c; expression e; @@ ( e = s@p | e = [email protected] | c(...,[email protected],...) | c(...,s@p,...) ) @bad depends on !good1@ position ref.p; identifier match.s; @@ s@p @depends on forall !bad disable optional_qualifier@ identifier match.s; @@ static + const struct mmp_intc_conf s; Signed-off-by: Bhumika Goyal <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic: Make irq_chip constBhumika Goyal1-1/+1
Make this const as it is only used in a copy operation. Done using Coccinelle. Signed-off-by: Bhumika Goyal <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3: Advertise GICv4 support to KVMMarc Zyngier2-0/+4
As KVM needs to know about the availability of GICv4 to enable direct injection of interrupts, let's advertise the feature in the gic_kvm_info structure. Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v4: Enable low-level GICv4 operationsMarc Zyngier4-2/+18
Get the show on the road... Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v4: Add some basic documentationMarc Zyngier1-0/+71
Do a braindump of the way things are supposed to work. Reviewed-by: Thomas Gleixner <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v4: Add VLPI configuration interfaceMarc Zyngier2-0/+46
Add the required interfaces to map, unmap and update a VLPI. Reviewed-by: Eric Auger <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v4: Add VPE command interfaceMarc Zyngier2-0/+27
Add the required interfaces to schedule a VPE and perform a VINVALL command. Reviewed-by: Thomas Gleixner <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v4: Add per-VM VPE domain creationMarc Zyngier2-0/+77
When creating a VM, it is very convenient to have an irq domain containing all the doorbell interrupts associated with that VM (each interrupt representing a VPE). Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Set implementation defined bit to enable VLPIsMarc Zyngier2-2/+6
A long time ago, GITS_CTLR[1] used to be called GITC_CTLR.EnableVLPI. It has been subsequently deprecated and is now an "Implementation Defined" bit that may ot may not be set for GICv4. Brilliant. And the current crop of the FastModel requires that bit for VLPIs to be enabled. Oh well... Let's set it and find out what breaks. Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Allow doorbell interrupts to be injected/clearedMarc Zyngier1-0/+31
While the doorbell interrupts are usually driven by the HW itself, having a way to trigger them independently has proved to be a really useful debug feature. As it is actually very little code, let's add it to the VPE irqchip operations. Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Move pending doorbell after VMOVPMarc Zyngier1-2/+32
After moving a VPE from a redistributor to another, we're still left with a potential pending doorbell interrupt on the old redistributor. That interrupt should be moved to the new one to be either cleared or take, depending on what the hypervisor wishes to do. So let's move it right after having execited VMOVP. This doesn't add much cost in the !DirectLPI case (we trade a DISCARD for a MOVI), and the cost of the DIRECTLPI case should be minimal (two extra MMIO accesses). Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add device proxy for VPE management if !DirectLpiMarc Zyngier2-6/+147
When we don't have the DirectLPI feature, we must work around the architecture shortcomings to be able to perform the required maintenance (interrupt masking, clearing and injection). For this, we create a fake device whose sole purpose is to provide a way to issue commands as if we were dealing with LPIs coming from that device (while they actually originate from the ITS). This fake device doesn't have LPIs allocated to it, but instead uses the VPE LPIs. Of course, this could be a real bottleneck, and a naive implementation would require 6 commands to issue an invalidation. Instead, let's allocate at least one event per physical CPU (rounded up to the next power of 2), and opportunistically map the VPE doorbell to an event. This doorbell will be mapped until we roll over and need to reallocate this slot. This ensures that most of the time, we only need 2 commands to issue an INV, INT or CLEAR, making the performance a lot better, given that we always issue a CLEAR on entry, and an INV on each side of a trapped WFI. Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Make LPI allocation optional on device creationMarc Zyngier1-7/+14
The normal course of action when allocating the ITS' view of a device is to allocate the corresponding LPIs. But we're about to introduce devices that borrow their interrupts from some other entities. So let's make the allocation optional. Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add VPE interrupt maskingMarc Zyngier3-0/+41
When masking/unmasking a doorbell interrupt, it is necessary to issue an invalidation to the corresponding redistributor. We use the DirectLPI feature by writting directly to the corresponding redistributor. Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add VPE affinity changesMarc Zyngier1-0/+96
When we're about to run a vcpu, it is crucial that the redistributor associated with the physical CPU is being told about the new residency. This is abstracted by hijacking the irq_set_affinity method for the doorbell interrupt associated with the VPE. It is expected that the hypervisor will call this method before scheduling the VPE. Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add VPE invalidation hookMarc Zyngier1-0/+4
When a guest issues a INVALL command targetting a collection, it must be translated into a VINVALL for the VPE that has this collection. This patch implements a hook that offers this functionallity to the hypervisor. Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add VPE schedulingMarc Zyngier2-0/+143
When a VPE is scheduled to run, the corresponding redistributor must be told so, by setting VPROPBASER to the VM's property table, and VPENDBASER to the vcpu's pending table. When scheduled out, we preserve the IDAI and PendingLast bits. The latter is specially important, as it tells the hypervisor that there are pending interrupts for this vcpu. Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add VPENDBASER/VPROPBASER accessorsMarc Zyngier3-0/+38
V{PEND,PROP}BASER being 64bit registers, they need some ad-hoc accessors on 32bit, specially given that VPENDBASER contains a Valid bit, making the access a bit convoluted. Reviewed-by: Thomas Gleixner <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add VPE irq domain [de]activationMarc Zyngier1-0/+102
On activation, a VPE is mapped using the VMAPP command, followed by a VINVALL for a good measure. On deactivation, the VPE is simply unmapped. Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add VPE irq domain allocation/teardownMarc Zyngier1-0/+169
When creating a VM, the low level GICv4 code is responsible for: - allocating each VPE a unique VPEID - allocating a doorbell interrupt for each VPE - allocating the pending tables for each VPE - allocating the property table for the VM This of course has to be reversed when the VM is brought down. All of this is wired into the irq domain alloc/free methods. Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add VPE domain infrastructureMarc Zyngier1-1/+30
Add the basic GICv4 VPE (vcpu in GICv4 parlance) infrastructure (irqchip, irq domain) that is going to be populated in the following patches. Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add VLPI configuration handlingMarc Zyngier1-5/+70
When a VLPI is reconfigured (enabled, disabled, change in priority), the full configuration byte must be written, and the caches invalidated. Also, when using the irq_mask/irq_unmask methods, it is necessary to disable the doorbell for that particular interrupt (by mapping it to 1023) on top of clearing the Enable bit. Reviewed-by: Thomas Gleixner <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add VLPI map/unmap operationsMarc Zyngier1-3/+247
In order to let a VLPI being injected into a guest, the VLPI must be mapped using the VMAPTI command. When moved to a different vcpu, it must be moved with the VMOVI command. These commands are issued via the irq_set_vcpu_affinity method, making sure we unmap the corresponding host LPI first. The reverse is also done when the VLPI is unmapped from the guest. Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add VLPI configuration hookMarc Zyngier1-0/+24
Add the skeleton irq_set_vcpu_affinity method that will be used to configure VLPIs. Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v3-its: Add GICv4 ITS command definitionsMarc Zyngier2-1/+13
Add the new GICv4 ITS command definitions, most of them, being defined in terms of their physical counterparts. Reviewed-by: Eric Auger <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-31irqchip/gic-v4: Add management structure definitionsMarc Zyngier1-0/+92
Add a bunch of GICv4-specific data structures that will get used in subsequent patches. Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip/gic-v3-its: Generalize LPI configurationMarc Zyngier1-10/+11
We're are going to need to change a bit more than just the enable bit in the LPI property table in the future. So let's change the LPI configuration funtion to take a set of bits to be cleared, and a set of bits to be set. This way, we'll be able to use it when a guest updates an LPI property (priority, for example). Reviewed-by: Eric Auger <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip/gic-v3-its: Generalize device table allocationMarc Zyngier1-10/+16
As we want to use 2-level tables for VCPUs, let's hack the device table allocator in order to make it slightly more generic. It will get reused in subsequent patches. Reviewed-by: Thomas Gleixner <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip/gic-v3-its: Rework LPI freeingMarc Zyngier1-6/+7
Rework LPI deallocation so that it can be reused by the v4 support code. Reviewed-by: Eric Auger <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip/gic-v3-its: Split out pending table allocationMarc Zyngier1-9/+20
Just as for the property table, let's move the pending table allocation to a separate function. Reviewed-by: Thomas Gleixner <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip/gic-v3-its: Allow use of indirect VCPU tablesMarc Zyngier1-8/+17
The VCPU tables can be quite sparse as well, and it makes sense to use indirect tables as well if possible. Reviewed-by: Thomas Gleixner <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip/gic-v3-its: Split out property table allocationMarc Zyngier1-10/+21
Move the LPI property table allocation into its own function, as this is going to be required for those associated with VMs in the future. Reviewed-by: Eric Auger <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip/gic-v3-its: Implement irq_set_irqchip_state for pending stateMarc Zyngier1-0/+78
Allow the pending state of an LPI to be set or cleared via irq_set_irqchip_state. Reviewed-by: Thomas Gleixner <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip/gic-v3-its: Macro-ize its_send_single_commandMarc Zyngier1-37/+47
Most ITS commands do operate on a collection object, and require a SYNC command to be performed on that collection in order to guarantee the execution of the first command. With GICv4 ITS, another set of commands perform similar operations on a VPE object, and a VSYNC operations must be executed to guarantee their execution. Given the similarities (post a command, perform a synchronization operation on a sync object), it makes sense to reuse the same mechanism for both class of commands. Let's start with turning its_send_single_command into a huge macro that performs the bulk of the work, and a set of helpers that make this macro usable for the GICv3 ITS commands. Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip/gic-v3-its: Add probing for VLPI propertiesMarc Zyngier2-4/+72
Add the probing code for the ITS VLPI support. This includes configuring the ITS number if not supporting the single VMOVP command feature. Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip/gic-v3-its: Move LPI definitions aroundMarc Zyngier1-12/+13
The various LPI definitions are in the middle of the code, and would be better placed at the beginning, given that we're going to use some of them much earlier. Reviewed-by: Thomas Gleixner <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip/gic-v3: Add VLPI/DirectLPI discoveryMarc Zyngier2-1/+26
Add helper functions that probe for VLPI and DirectLPI properties. Reviewed-by: Eric Auger <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip/gic-v3: Add redistributor iteratorMarc Zyngier1-22/+47
In order to discover the VLPI properties, we need to iterate over the redistributor regions. As we already have code that does this, let's factor it out and make it slightly more generic. Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23genirq: Let irq_set_vcpu_affinity() iterate over hierarchyMarc Zyngier1-2/+12
When assigning an interrupt to a vcpu, it is not unlikely that the level of the hierarchy implementing irq_set_vcpu_affinity is not the top level (think a generic MSI domain on top of a virtualization aware interrupt controller). In such a case, let's iterate over the hierarchy until we find an irqchip implementing it. Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip: Convert to using %pOF instead of full_nameRob Herring16-56/+50
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Cc: Thomas Gleixner <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Lee Jones <[email protected]> Cc: Stefan Wahren <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Ray Jui <[email protected]> Cc: Scott Branden <[email protected]> Cc: [email protected] Cc: Sylvain Lemieux <[email protected]> Cc: Maxime Coquelin <[email protected]> Cc: Chen-Yu Tsai <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Jonathan Hunter <[email protected]> Cc: Michal Simek <[email protected]> Cc: "Sören Brinkmann" <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Acked-by: Eric Anholt <[email protected]> Acked-by: Baruch Siach <[email protected]> Acked-by: Vladimir Zapolskiy <[email protected]> Acked-by: Matthias Brugger <[email protected]> Acked-by: Alexandre Torgue <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-23irqchip: Add UniPhier AIDET irqchip driverMasahiro Yamada5-0/+303
UniPhier SoCs contain AIDET (ARM Interrupt Detector). This is intended to provide additional features that are not covered by GIC. The main purpose is to provide logic inverter to support low level and falling edge trigger types for interrupt lines from on-board devices. Acked-by: Rob Herring <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
2017-08-19irqchip/gic-v3-its: Properly handle command queue wrappingMarc Zyngier1-1/+7
wait_for_range_completion() is nicely busted when handling wrapping of the command queue, leading to an early exit instead of waiting for the command to have been executed. Fortunately, the impact is pretty minor, as it only impair the detection of an ITS that doesn't make any forward progress for a whole second. And an ITS should *never* lock up. Reported-by: Yang Yingliang <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>