aboutsummaryrefslogtreecommitdiff
path: root/hw/xive.c
AgeCommit message (Collapse)AuthorFilesLines
2016-11-15xive: Indirect table entries must have top bits "type" setBenjamin Herrenschmidt1-0/+3
The HW check that the 2 tops bits aren't both clear to differenciate an unallocated entry from a valid one. So we need to put some value there. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-15xive: Remove unused field and clarify commentBenjamin Herrenschmidt1-4/+1
This will be reworked when we support EQ and VP allocation, for now remove the unused field 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-16/+44
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/+19
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-11-15xive: Fix IPI EOI logic in opal_xive_eoi()Benjamin Herrenschmidt1-9/+9
We only want to directly EOI the interrupt used to emulate the MFRR, for all the other "IPI" (aka XIVE produced interrupts), we want to go via the normal source mechanism. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-15xive: Don't try to EOI a masked sourceBenjamin Herrenschmidt1-0/+12
It will just generate spurious powerbus traffic and ESB state changes. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-15xive: Fix comments in xive_source_set_xive()Benjamin Herrenschmidt1-6/+16
Properly documenting assumptions and behaviour related to interrupts occurring while masked. This reflects the documentation update. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-15xive: Fix comments in xive_get_ive()Benjamin Herrenschmidt1-6/+3
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-15xive: Configure forwarding portsBenjamin Herrenschmidt1-2/+40
In multi-chip environments, the XIVEs need to communicate to each other via these ports, so they need to be configured properly Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-15xive: Fix mangling of interrupt server# in opal_get/set_xive()Benjamin Herrenschmidt1-7/+5
The OPAL API uses mangled server numbers with the link in the bottom 2 bits like a real XICS does, we need to account for it. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-15xive: Fix interrupt number manglingBenjamin Herrenschmidt1-3/+3
The comment and implementation didn't match, we were putting the block_id in the part of the field reserved for the CPPR. 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-169/+345
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/+2003
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>