summaryrefslogtreecommitdiffstats
path: root/hw/intc/openpic.c
Commit message (Collapse)AuthorAgeFilesLines
* ppc: convert g_new(qemu_irq usages to g_new0Peter Crosthwaite2014-08-151-1/+1
| | | | | | | To indicate the IRQs are initially disconnected. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* openpic: Reset IRQ source private membersPaul Janzen2014-06-161-2/+2
| | | | | | | | | | | | | | | | | | | The openpic emulation code maintains an allowable-CPU's bitmap ("destmask") for each IRQ source which is calculated from the IDR register value whenever the guest OS writes to it. However, if the guest OS relies on the system to set the IDR register to a default value at reset, and does not write IDR, then destmask does not get updated, and interrupts do not get propagated to the guest. Additionally, if an IRQ source is marked as critical, the source's internal "output" and "nomask" fields are not correctly reset when the PIC is reset. Fix both these issues by calling write_IRQreg_idr from within openpic_reset, instead of simply setting the IDR register to the specified idr_reset value. Signed-off-by: Paul Janzen <pcj@pauljanzen.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* openpic: Move definition of openpic_resetPaul Janzen2014-06-161-49/+50
| | | | | | | | | | This patch moves the definition of openpic_reset after the various register read/write functions. No functional change. It is in preparation for using the register read/write functions in openpic_reset. Signed-off-by: Paul Janzen <pcj@pauljanzen.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* hw/intc/openpic: Remove unused function IRQ_testbit()Peter Maydell2014-06-101-5/+0Star
| | | | | | | The IRQ_testbit() function is never used; remove it. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* openpic: avoid buffer overrun on incoming migrationMichael Roth2014-05-051-2/+14
| | | | | | | | | | | | | | | | | CVE-2013-4534 opp->nb_cpus is read from the wire and used to determine how many IRQDest elements to read into opp->dst[]. If the value exceeds the length of opp->dst[], MAX_CPU, opp->dst[] can be overrun with arbitrary data from the wire. Fix this by failing migration if the value read from the wire exceeds MAX_CPU. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
* hw/intc/openpic: Avoid shifting left into sign bitPeter Maydell2014-03-271-7/+7
| | | | | | | | | Add U suffix to avoid undefined behaviour. This is only strictly necessary for the 1 << 31 cases; for consistency we extend it to other constants in the same group. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* intc/openpic: Build openpic only onceAndreas Färber2013-07-091-1/+1
| | | | | | | | | Since current_cpu is CPUState it no longer depends on CPUPPCState. Move ppce500_set_mpic_proxy() to a new hw/ppc/ppc_e500.h because hw/ppc/ppc.h is too heavily using CPUPPCState and PowerPCCPU. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Replace cpu_single_env with CPUState current_cpuAndreas Färber2013-07-091-5/+2Star
| | | | | | Move it to qom/cpu.h. Signed-off-by: Andreas Färber <afaerber@suse.de>
* hw/i*: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-041-3/+3
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* memory: add owner argument to initialization functionsPaolo Bonzini2013-07-041-2/+2
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* intc/openpic: Convert to QOM realizeAndreas Färber2013-07-011-15/+19
| | | | | | | | | Split qdev initfn into instance_init and realize functions. Change one occurrence of "klass" while at it. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* intc/openpic: QOM'ifyAndreas Färber2013-07-011-6/+11
| | | | | | | | Introduce type constant and cast macro. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* openpic: factor out some common defines into openpic.hScott Wood2013-07-011-22/+18Star
| | | | | | | ...for use by the KVM in-kernel irqchip stub. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* hw: move interrupt controllers to hw/intc/, configure with default-configs/Paolo Bonzini2013-04-081-0/+1661
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>