aboutsummaryrefslogtreecommitdiff
path: root/include/xive.h
AgeCommit message (Collapse)AuthorFilesLines
2017-06-26xive: DD2.0 updatesBenjamin Herrenschmidt1-0/+7
Add support for StoreEOI, fix StoreEOI MMIO offset in ESB page, and other cleanups Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-04-28xive+phb4: Fix exposing trigger page to LinuxBenjamin Herrenschmidt1-5/+9
We currently don't expose the trigger page of MSIs to Linux which breaks re-sending of a queued one. To fix that properly we need to understand out a subtle API complication: - The "internal" XIVE_SRC_TRIGGER_PAGE indicates that a trigger page is supported, whether it's the same page as the EOI page or not. - The "external" OPAL_XIVE_IRQ_TRIGGER_PAGE indicates that a *separate* trigger page exists. To know if triggers are supported the caller should simply check if a valid (non-0) value is returned in "out_trig_page" of opal_xive_get_irq_info(). So PHB4 must set XIVE_SRC_TRIGGER_PAGE for MSIs and the xive code needs to do the "right" thing for setting whether OPAL_XIVE_IRQ_TRIGGER_PAGE should be set or not. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-03-09xive: Sync HW when moving interrupts aroundBenjamin Herrenschmidt1-0/+7
For now sync all queues, ensure any interrupt routed at the old queue has reached memory. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-07xive/psi/lpc: Handle proper clearing of LPC SerIRQ latch on DD1Benjamin Herrenschmidt1-0/+4
On DD1, the LPC SerIRQ are latched to 1 in HW but never back to 0, we need an explicit clear after running the handler. (Not before as they are level interrupts, they will be latched again if they are still pending). For now we do that in lpc_dispatch_ser_irqs() but that only works for interrupts routed to OPAL. In order to support routing LPC interrutps to Linux, we need a custom EOI handler that does the clearing of the latch before we do the EOI in the ESB. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-02xive: Set the FORCE_TM_LOCAL bit in CQ_PBI_CTLBenjamin Herrenschmidt1-0/+5
This bits saves the day if the special EX BARs happens to be misconfigured. There is no drawback to having it always set so let's do so. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-02xive: Fix definition of VC_SCRUB_OFFSETBenjamin Herrenschmidt1-1/+1
Off by one on one bit Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-05xive: Split the OPAL irq flags from the internal onesBenjamin Herrenschmidt1-5/+6
Some per-IRQ flags only have meaning inside OPAL, let's separate the two number spaces Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-05xive: Cleanup escalation PQ on queue changeBenjamin Herrenschmidt1-0/+4
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-05xive: Implement xive_resetBenjamin Herrenschmidt1-2/+4
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: fix build failure on older GCC - e.g. 4.8] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-05xive: Mark XIVE owned EQs with a specific flagBenjamin Herrenschmidt1-0/+2
This will allow us to recognize them later when doing a reset and avoid freeing them Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-05xive: Use an allocator for EQDsBenjamin Herrenschmidt1-0/+4
This adds a bitmap allocator for EQDs. They are allocated in groups of 8 naturally aligned. The VP structures associated with physical CPUs now have all 8 EQDs available though only one is provisioned and enabled. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-05xive: Break assumption that block ID == chip IDBenjamin Herrenschmidt1-0/+12
Add proper translation between the two. We still initialize them to the same thing but we will be able to change that easily if necessary (if the chip IDs become larger than 16 or if we decide to start using more than one block per chip). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-05xive/phb4: Handle bad ESB offsets in PHB4 DD1Benjamin Herrenschmidt1-0/+1
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-05xive: Implement cache watch and use it for EQsBenjamin Herrenschmidt1-0/+36
We need to do cache coherent updates of the EQs when modifying escalation interrupts. Use the cache watch facility for that. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-05xive: Add opal_xive_get_irq_info()Benjamin Herrenschmidt1-3/+4
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-05xive: Add support for escalation interruptsBenjamin Herrenschmidt1-0/+3
Escalation interrupts have their "IVE" entry buried inside of the EQ that shoots them which complicates matters. We want to expose them to the OS as normal interrupts, so we dedicate a bit in the interrupt number (outside the range supported by the OPAL emulation API) to differenciate them. The BlockID and Index in the interrupt number now refer to the source EQ. This is still missing proper cache management for them, which will come in a separate patch. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-15xive: Provide a way to override some IPI sourcesBenjamin Herrenschmidt1-3/+5
Some devices such as NX or the NPU will use some of the XIVE provided IPIs for their own interrupts. Thus we need a way for those to provide a custom irq_source_ops for portions of the IPI space in order for them to provide their own attributes() and if needed, interrutps() callbacks. We achieve that by creating a second list of sources which can overlap the primary. The global stock of IPIs is registered by XIVE in the secondary list which is searched when no match is found in the primary. A new API xive_register_ipi_source() is provided for those devices to create an overlapping source structure in the primary list for a subset of the IPIs. Those IPIs must have been previously allocated using xive_alloc_ipi_irqs() Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-15xive: Add helper to retrieve an IPI trigger portBenjamin Herrenschmidt1-0/+5
To be used by such things as VAS Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-08-11xive: Wrap irq_sources to provide standard set_xive/get_xiveBenjamin Herrenschmidt1-2/+9
All the source controllers use the standard XIVE mechanism for masking/unmasking and EOI, so there is no point having that logic duplicated. There are a few variations on how they are implemented but that can be handled using a few flags. So let's create a wrapper around irq_sources for a xive source and provide a new API for things like PHB4 to instanciate them This patch while at it also fixes the calculation of the source offset when setting up targetting information in the PHB4. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-07-08XIVE: Base XIVE support for OPAL XICS emulation callsBenjamin Herrenschmidt1-0/+378
This provides basic initialization of the XIVE along with some OPAL calls to emulate an old-style XICS which will initially be used by Linux for backward compatibility. The current implementation is limited to one priority and doesn't expose much to Linux for future exploitation mode yet. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: add (C) header, fix whitespace, missing breaks] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>