summaryrefslogtreecommitdiffstats
path: root/hw/ppc.c
Commit message (Collapse)AuthorAgeFilesLines
* PPC: KVM: Add support for EPR with KVMAlexander Graf2013-01-181-0/+6
| | | | | | This patch links KVM EPR support to the existing TCG support we have now. Signed-off-by: Alexander Graf <agraf@suse.de>
* openpic: export e500 epr enable into a ppc.c functionAlexander Graf2013-01-181-0/+11
| | | | | | | | Enabling and disabling the EPR capability (mpic_proxy) is a system wide operation. As such, it belongs into the ppc.c file, since that's where PPC specific machine wide logic happens. Signed-off-by: Alexander Graf <agraf@suse.de>
* Merge branch 'master' of git://git.qemu.org/qemu into qom-cpuAndreas Färber2012-12-231-4/+4
|\ | | | | | | | | | | Adapt header include paths. Signed-off-by: Andreas Färber <afaerber@suse.de>
| * softmmu: move include files to include/sysemu/Paolo Bonzini2012-12-191-2/+2
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * misc: move include files to include/qemu/Paolo Bonzini2012-12-191-2/+2
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | ppc: Pass PowerPCCPU to [h]decr timer callbacksAndreas Färber2012-12-191-8/+10
| | | | | | | | | | | | Cleans up after passing PowerPCCPU to [h]decr exception callbacks. Signed-off-by: Andreas Färber <afaerber@suse.de>
* | ppc: Pass PowerPCCPU to [h]decr callbacksAndreas Färber2012-12-191-27/+33
| | | | | | | | | | | | Cleans up after passing PowerPCCPU to ppc_set_irq(). Signed-off-by: Andreas Färber <afaerber@suse.de>
* | ppc: Pass PowerPCCPU to ppc_set_irq()Andreas Färber2012-12-191-26/+40
| | | | | | | | | | | | | | | | Adapt static caller functions. This cleans up after passing PowerPCCPU to kvmppc_set_interrupt(). Signed-off-by: Andreas Färber <afaerber@suse.de>
* | kvm: Pass CPUState to kvm_vcpu_ioctl()Andreas Färber2012-12-191-1/+1
|/ | | | | | Adapt helper functions to pass X86CPU / PowerPCCPU / S390CPU. Signed-off-by: Andreas Färber <afaerber@suse.de>
* Merge branch 'trivial-patches' of git://github.com/stefanha/qemuBlue Swirl2012-11-031-8/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'trivial-patches' of git://github.com/stefanha/qemu: pc: Drop redundant test for ROM memory region exec: make some functions static target-ppc: make some functions static ppc: add missing static vnc: add missing static vl.c: add missing static target-sparc: make do_unaligned_access static m68k: Return semihosting errno values correctly cadence_uart: More debug information Conflicts: target-m68k/m68k-semi.c
| * ppc: add missing staticBlue Swirl2012-11-011-8/+8
| | | | | | | | | | | | | | | | Add missing 'static' qualifiers. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | cpus: Pass CPUState to qemu_cpu_kick()Andreas Färber2012-10-311-2/+2
| | | | | | | | | | | | CPUArchState is no longer needed there. Signed-off-by: Andreas Färber <afaerber@suse.de>
* | ppc: Pass PowerPCCPU to {ppc6xx,ppc970,power7,ppc40x,ppce500}_set_irq()Andreas Färber2012-10-311-20/+35
|/ | | | | | | Needed for changing qemu_cpu_kick() argument type to CPUState and for moving halted field into CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
* ppc hw/: Don't use CPUStateAndreas Färber2012-03-141-55/+55
| | | | | | | | | | Scripted conversion: for file in hw/ppc*.[hc] hw/mpc8544_guts.c hw/spapr*.[hc] hw/virtex_ml507.c hw/xics.c; do sed -i "s/CPUState/CPUPPCState/g" $file done Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Anthony Liguori <aliguori@us.ibm.com>
* PPC: 405: Use proper CPU resetAlexander Graf2012-03-141-11/+2
| | | | | | | | | | | | On ppc405ep there is a register that allows for software to reset the core, but not the whole system. Implement this reset using a reset interrupt. This gets rid of a bunch of #if 0'ed code. Reported-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de>
* fix typo: delete redundant semicolonDong Xu Wang2011-12-061-1/+1
| | | | | | | Double semicolons should be single. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* ppc: Avoid decrementer related kvm exitsDavid Gibson2011-10-301-0/+6
| | | | | | | | | | | | | | | | In __cpu_ppc_store_decr(), we set up a regular timer used to trigger decrementer interrupts. This is necessary to implement the decrementer properly under TCG, but is unnecessary under KVM (true for both Book3S-PR and Book3S-HV KVM variants), because the kernel handles generating and delivering decrementer exceptions. Under kvm, in fact, the timer causes expensive and unnecessary exits from kvm to qemu. This patch, therefore, disables setting the timer when kvm is in use. Signed-off-by: Anton Blanchard <anton@au1.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
* PPC: booke timersFabien Chouteau2011-10-061-84/+54
| | | | | | | | | | While working on the emulation of the freescale p2010 (e500v2) I realized that there's no implementation of booke's timers features. Currently mpc8544 uses ppc_emb (ppc_emb_timers_init) which is close but not exactly like booke (for example booke uses different SPR). Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-201-4/+4
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* monitor: add PPC BookE SPRsScott Wood2011-05-091-0/+12
| | | | | | | | | | Read them via KVM_GET_SREGS in kvm_arch_get_registers(), and display them in "info registers". Also get CR and PID from the existing KVM_GET_REGS. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* ppc: remove a write-only variableBlue Swirl2011-04-111-2/+0
| | | | | | | | | Remove a write-only variable, spotted by GCC 4.6.0: /src/qemu/hw/ppc.c: In function 'power7_set_irq': /src/qemu/hw/ppc.c:255:9: error: variable 'cur_level' set but not used [-Werror=unused-but-set-variable] Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Add POWER7 support for ppcDavid Gibson2011-04-011-0/+35
| | | | | | | | | | This adds emulation support for the recent POWER7 cpu to qemu. It's far from perfect - it's missing a number of POWER7 features so far, including any support for VSX or decimal floating point instructions. However, it's close enough to boot a kernel with the POWER7 PVR. Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* change all other clock references to use nanosecond resolution accessorsPaolo Bonzini2011-03-211-26/+26
| | | | | | | | | | | | | | | | | | | | | | This was done with: sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' ) after checking that get_clock and new_timer never occur twice on the same line. There were no missed occurrences; however, even if there had been, they would have been caught by the compiler. There was exactly one false positive in qemu_run_timers: - current_time = qemu_get_clock (clock); + current_time = qemu_get_clock_ns (clock); which is of course not in this patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* always qemu_cpu_kick after unhalting a cpuPaolo Bonzini2011-03-131-0/+2
| | | | | | | | | This ensures env->halt_cond is broadcast, and the loop in qemu_tcg_wait_io_event and qemu_kvm_wait_io_event is exited naturally rather than through a timeout. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* powerpc: Make the decr interrupt type overridableEdgar E. Iglesias2010-09-241-3/+13
| | | | | | | | Make it possible for boards to override the kind of interrupt to be signaled when the decr timer hits. The 405's signal PIT interrupts while the 440's signal DECR. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* KVM: PPC: Add level based interrupt logicAlexander Graf2010-09-051-0/+11
| | | | | | | | | | | | | | | | | | | | | | KVM on PowerPC used to have completely broken interrupt logic. Usually, interrupts work by having a PIC that pulls a line up/down, so the CPU knows that an interrupt is active. This line stays active until some action is done to the PIC to release the line. On KVM for PPC, we just checked if there was an interrupt pending and pulled a line in the kernel module. We never released it though, hoping that kernel space would just declare an interrupt as released when injected - which is wrong. To fix this, we need to completely redesign the interrupt injection logic. Whenever an interrupt line gets triggered, we need to notify kernel space that the line is up. Whenever it gets released, we do the same. This way we can assure that the interrupt state is always known to kernel space. This fixes random stalls in KVM guests on PowerPC that were waiting for an interrupt while everyone else thought they received it already. Signed-off-by: Alexander Graf <agraf@suse.de>
* target-ppc: remove dead codeThomas Monjalon2010-05-181-10/+0
| | | | | | | | | | | This function had been disabled from the beginning: see 9fddaa0c0cabb610947146a79b4a9a38b0a216e5 cpu_reset() function is in target-ppc/helper.c Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC: Make DCR uint32_tAlexander Graf2009-12-211-2/+2
| | | | | | | | | | | For what I know DCR is always 32 bits wide, so we should also use uint32_t to pass it along the stacks. This fixes a warning when compiling qemu-system-ppc64 with KVM enabled, making it compile without --disable-werror Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC64: Fix alternate timebaseAurelien Jarno2009-12-211-2/+2
| | | | | | | Fix the alternate time base the same way as the default timebase. SPR_ATBL should return a 64-bit value on 64 bit implementations. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC64: Fix timebaseAlexander Graf2009-12-211-2/+2
| | | | | | | | | | | | | | | On PPC we have a 64-bit time base. Usually (PPC32) this is accessed using two separate 32 bit SPR accesses to SPR_TBU and SPR_TBL. On PPC64 the SPR_TBL register acts as 64 bit though, so we get the full 64 bits as return value. If we only take the lower ones, fine. But Linux wants to see all 64 bits or it breaks. This patch makes PPC64 Linux work even after TB crossed the 32-bit boundary, which usually happened a few seconds after bootup. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* PPC: rename cpu_ppc_reset to cpu_reset for consistencyBlue Swirl2009-11-071-2/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* rom loader: fix sparc -kernel boot.Gerd Hoffmann2009-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Changes: (1) register pstrcpy_targphys() in rom list, it is used for kernel command lines by a number of architectures. (2) add rom_ptr() function to get a pointer for applying changes to loaded images. Needed for example to tell the linux kernel where it finds the initrd image by updating the header. (3) make sparc use rom_ptr for initrd setup. booting sparc-test works now, and 'info roms' shows this: (qemu) info roms addr=0000000000000000 size=0x2a3828 mem=ram name="phdr #0: vmlinux-2.6.11+tcx" addr=00000000007ff000 size=0x00000e mem=ram name="cmdline" addr=0000000000800000 size=0x400000 mem=ram name="/root/qemu-test/sparc-test/linux.img" addr=0000000070000000 size=0x0e4000 mem=rom name="phdr #0: /home/kraxel/projects/qemu/build-zfull/pc-bios/openbios-sparc32" reboot via 'system_reset' works too. Patchworks-ID: 35262 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-011-66/+66
| | | | | | | | | | | | In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Get rid of _t suffixmalc2009-10-011-66/+66
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* Compile loader only onceBlue Swirl2009-09-201-0/+1
| | | | | | | | | | | | | Callers must pass ELF machine, byte swapping and symbol LSB clearing information to ELF loader. A.out loader needs page size information, pass that too as a parameter. Extract prototypes to a separate file. Move loader.[ch] and elf_ops.h under hw. Adjust callers. Also use target_phys_addr_t instead of target_ulong for addresses: loader addresses aren't virtual. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Unexport ticks_per_sec variable. Create get_ticks_per_sec() functionJuan Quintela2009-09-111-9/+9
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Replace local ADDRX/PADDRX macros with TARGET_FMT_lx/plxBlue Swirl2009-08-161-14/+14
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Replace always_inline with inlineBlue Swirl2009-08-161-15/+13
| | | | | | We define inline as always_inline. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* target-ppc: fix typo in _cpu_ppc_load_decrTristan Gingold2009-07-121-4/+4
| | | | | | | | | Use parameter 'next' to fix the hdecr case. Also pass 'next' by value instead of pointer (more easy to read and no performance issue for an always_inline function). Signed-off-by: Tristan Gingold <gingold@adacore.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Yet more phys_ram_base elimination.pbrook2009-04-101-1/+1
| | | | | | | Signed-off-by: Paul Brook <paul@cofdesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7067 c046a42c-6fe2-441c-8c8c-71466251a162
* kvm/powerpc: Add irq support for E500 coreaurel322009-03-021-0/+60
| | | | | | | Signed-off-by: Liu Yu <yu.liu@freescale.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6662 c046a42c-6fe2-441c-8c8c-71466251a162
* hw: remove error handling from qemu_malloc() callers (Avi Kivity)aliguori2009-02-051-7/+0
| | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162
* Convert references to logfile/loglevel to use qemu_log*() macrosaliguori2009-01-151-8/+2
| | | | | | | | | | | | This is a large patch that changes all occurrences of logfile/loglevel global variables to use the new qemu_log*() macros. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6338 c046a42c-6fe2-441c-8c8c-71466251a162
* Clean up debugging code #ifdefs (Eduardo Habkost)aliguori2009-01-151-245/+68
| | | | | | | | | | | | | | | Use macros to avoid #ifdefs on debugging code. This patch doesn't try to merge logging macros from different files, but just unify the debugging code #ifdefs onto a macro on each file. A further cleanup can unify the debugging macros on a common header, later Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6332 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix undeclared symbol warnings from sparseblueswir12008-10-261-2/+4
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5539 c046a42c-6fe2-441c-8c8c-71466251a162
* Use qemu-log.hblueswir12008-10-041-3/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5413 c046a42c-6fe2-441c-8c8c-71466251a162
* Suppress gcc 4.x -Wpointer-sign (included in -Wall) warningsblueswir12008-09-201-3/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5275 c046a42c-6fe2-441c-8c8c-71466251a162
* More PowerPC debug print fixes - hardware emulation pass.j_mayer2007-11-241-19/+20
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3726 c046a42c-6fe2-441c-8c8c-71466251a162
* Break up vl.h.pbrook2007-11-171-1/+5
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
* Add missing definition for number of input pins for the PowerPC 970 bus.j_mayer2007-11-171-2/+4
| | | | | | | | Use proper INPUT_NB definitions to allocate PowerPC input pins structure, fixing a buffer overflow in the 6xx bus case. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3659 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud