Statistics
| Branch: | Revision:

root / target-ppc @ 3bc9ccc0

# Date Author Comment
3bc9ccc0 12/20/2013 02:57 am Alexey Kardashevskiy

powerpc: add PVR mask support

IBM POWERPC processors encode PVR as a CPU family in higher 16 bits and
a CPU version in lower 16 bits. Since there is no significant change
in behavior between versions, there is no point to add every single CPU
version in QEMU's CPU list. Also, new CPU versions of already supported...

c65f9a07 12/20/2013 02:57 am Greg Kurz

target-ppc: add stubs for KVM breakpoints

The latest update to v3.13-rc3 (bf63839f) breaks the
ppc build with KVM:

kvm-all.o: In function `kvm_update_guest_debug':
kvm-all.c:1910: undefined reference to `kvm_arch_update_guest_debug'
kvm-all.o: In function `kvm_insert_breakpoint':...

4b4d4a21 10/26/2013 12:25 am Aneesh Kumar K.V

target-ppc: Update slb array with correct index values.

Without this, a value of rb=0 and rs=0 results in replacing the 0th
index. This can be observed when using gdb remote debugging support.

(gdb) x/10i do_fork
0xc000000000085330 <do_fork>: Cannot access memory at address 0xc000000000085330...

d83af167 10/26/2013 12:25 am Aneesh Kumar K.V

target-ppc: Use #define for max slb entries

Instead of opencoding 64 use MAX_SLB_ENTRIES. We don't update the kernel
header here.

Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Alexander Graf <>

e62fbc54 10/26/2013 12:25 am Aneesh Kumar K.V

target-ppc: dump-guest-memory support

This patch add support for dumping guest memory using dump-guest-memory
monitor command.

Before patch:

(qemu) dump-guest-memory testcrash
this feature or command is not currently supported
(qemu)

After patch:

(qemu) dump-guest-memory testcrash...

793826cd 10/26/2013 12:25 am Andreas Färber

target-ppc: Fill in OpenFirmware names for some PowerPCCPU families

Set the expected values for POWER7, POWER7+, POWER8 and POWER5+.
Note that POWER5+ and POWER7+ are intentionally lacking the '+', so the
lack of a POWER7P family constitutes no problem.
...

3bbf37f2 10/26/2013 12:25 am Andreas Färber

spapr: Use DeviceClass::fw_name for device tree CPU node

Instead of relying on cpu_model, obtain the device tree node label
per CPU. Use DeviceClass::fw_name as source.

Whenever DeviceClass::fw_name is unknown, default to "PowerPC,UNKNOWN".

As a consequence, spapr_fixup_cpu_dt() can operate on each CPU's fw_name,...

feaa64c4 10/26/2013 12:25 am David Gibson

target-ppc: Add helper for KVM_PPC_RTAS_DEFINE_TOKEN

Recent PowerKVM allows the kernel to intercept some RTAS calls from the
guest directly. This is used to implement the more efficient in-kernel
XICS for example. qemu is still responsible for assigning the RTAS token...

bbfb6f13 10/26/2013 12:25 am Tom Musta

target-ppc: Little Endian Correction to Load/Store Vector Element

The Load Vector Element (lve*x) and Store Vector Element (stve*x)
instructions not only byte-swap in Little Endian mode, they also
invert the element that is accessed. For example, the RTL for...

9633fcc6 10/26/2013 12:25 am Alexander Graf

PPC: Fix L2CR write accesses

Commit 2345f1c01 was supposed to render L2CR writes into noops. Instead,
it made them illegal instruction traps which apparently didn't confuse
XNU, but can easily confuse other OSs.

Fix it up by actually doing nothing when we write to L2CR....

1cb9b64d 10/18/2013 08:01 pm Anthony Liguori

Merge remote-tracking branch 'bonzini/configure' into staging

  1. By Peter Maydell (3) and Ákos Kovács (2)
  2. Via Paolo Bonzini
    • bonzini/configure:
      ui/Makefile.objs: delete unnecessary cocoa.o dependency
      default-configs/: CONFIG_GDBSTUB_XML removed
      Makefile.target: CONFIG_NO_* variables removed...
cf01ba9e 10/16/2013 07:21 pm Ákos Kovács

Makefile.target: CONFIG_NO_* variables removed

CONFIG_NO_* variables replaced with the lnot logical function

Signed-off-by: Ákos Kovács <>
[PMM: fixed a few CONFIG_NO_* uses that were missed]
Signed-off-by: Peter Maydell <>...

ab1eb72b 10/11/2013 07:36 pm Anthony Liguori

Merge remote-tracking branch 'rth/tcg-pull' into staging

  1. By Richard Henderson
  2. Via Richard Henderson
    • rth/tcg-pull:
      exec: Add both big- and little-endian memory helpers
      tcg: Add qemu_ld_st_i32/64
      tcg: Add TCGMemOp
      configure: Remove CONFIG_QEMU_LDST_OPTIMIZATION...
5cd8f621 10/10/2013 09:43 pm Richard Henderson

tcg: Move helper registration into tcg_context_init

No longer needs to be done on a per-target basis.

Signed-off-by: Richard Henderson <>

f5daeec4 10/10/2013 09:43 pm Richard Henderson

tcg: Remove stray semi-colons from target-*/helper.h

During GEN_HELPER=1, these are actually stray top-level semi-colons
which are technically invalid ISO C, but GCC accepts as an extension.
If we added enough extension markers that we could dare use...

51fb256a 10/07/2013 12:48 pm Andreas Färber

cpu: Drop cpu_model_str from CPU_COMMON

Since this is only read in cpu_copy() and linux-user has a global
cpu_model, drop the field from generic code.

Signed-off-by: Andreas Färber <>

97577fd4 09/20/2013 01:37 pm James Hogan

cpu: Move cpu state syncs up into cpu_dump_state()

The x86 and ppc targets call cpu_synchronize_state() from their
*_cpu_dump_state() callbacks to ensure that up to date state is dumped
when KVM is enabled (for example when a KVM internal error occurs).
...

bdc44640 09/03/2013 01:25 pm Andreas Färber

cpu: Use QTAILQ for CPU list

Introduce CPU_FOREACH(), CPU_FOREACH_SAFE() and CPU_NEXT() shorthand
macros.

Signed-off-by: Andreas Färber <>

545825d4 09/03/2013 02:35 am Aurelien Jarno

Merge branch 'tcg-next' of git://github.com/rth7680/qemu

  • 'tcg-next' of git://github.com/rth7680/qemu: (29 commits)
    tcg-i386: Make use of zero-extended memory helper routines
    tcg: Introduce zero and sign-extended versions of load helpers
    exec: Split softmmu_defs.h...
8cfd0495 09/02/2013 07:08 pm Richard Henderson

tcg: Change tcg_gen_exit_tb argument to uintptr_t

And update all users.

Reviewed-by: Aurelien Jarno <>
Signed-off-by: Richard Henderson <>

b1669e5e 09/02/2013 07:08 pm Richard Henderson

target: Include softmmu_exec.h where forgotten

Several targets forgot to include softmmu_exec.h, which would
break them with a header cleanup to follow.

Reviewed-by: Aurelien Jarno <>
Signed-off-by: Richard Henderson <>

779f6590 09/02/2013 11:06 am Aurelien Jarno

target-ppc: fix bit extraction for FPBF and FPL

Bit extraction for the FP BF and L field of the MTFSFI and MTFSF
instructions is wrong and doesn't match the reference manual (which
explain the bit number in big endian format). It has been broken in
commit 7d08d85645def18eac2a9d672c1868a35e0bcf79....

a3cedb54 09/02/2013 11:06 am Aneesh Kumar K.V

target-ppc: Use #define instead of opencoding SLB valid bit

Use SLB_ESID_V instead of (1 << 27) in the code

Reviewed-by: Andreas Färber <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Alexander Graf <>

7bb438b6 09/02/2013 11:06 am Alexander Graf

PPC: KVM: Compile fix for qemu_notify_event

The function qemu_notify_event is defined by a header that we don't
include in the PPC KVM code. Include it to get the code building
again.

target-ppc/kvm_ppc.c: In function 'kvmppc_timer_hack':
target-ppc/kvm_ppc.c:26:5: error: implicit declaration of function 'qemu_notify_event' [-Werror=implicit-function-declaration]...
1e0c7e55 09/02/2013 11:06 am Anton Blanchard

target-ppc: USE LPCR_ILE to control exception endian on POWER7

On POWER7, LPCR_ILE is used to control what endian guests take
their exceptions in so use it instead of MSR_ILE.

Signed-off-by: Anton Blanchard <>
Reviewed-by: Anthony Liguori <>...

bb429d22 09/02/2013 11:06 am Anton Blanchard

target-ppc: POWER7 supports the MSR_LE bit

Add MSR_LE to the msr_mask for POWER7.

Signed-off-by: Anton Blanchard <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Alexander Graf <>

f7ad538e 08/26/2013 05:19 pm Anthony Liguori

Merge remote-tracking branch 'stefanha/block' into staging

  1. By Alex Bligh (32) and others
  2. Via Stefan Hajnoczi
    • stefanha/block: (42 commits)
      win32-aio: drop win32_aio_flush_cb()
      aio-win32: replace incorrect AioHandler->opaque usage with ->e
      aio / timers: remove dummy_io_handler_flush from tests/test-aio.c...
bc72ad67 08/22/2013 08:14 pm Alex Bligh

aio / timers: Switch entire codebase to the new timer API

This is an autogenerated patch using scripts/switch-timer-api.

Switch the entire code base to using the new timer API.

Note this patch may introduce some line length issues.

Signed-off-by: Alex Bligh <>...

4a44d85e 08/20/2013 06:51 pm Seiji Aguchi

Convert stderr message calling error_get_pretty() to error_report()

Convert stderr messages calling error_get_pretty()
to error_report().

Timestamp is prepended by -msg timstamp option with it.

Per Markus's comment below, A conversion from fprintf() to...

469296f1 08/07/2013 08:47 pm Andreas Färber

target-ppc: Turn POWER5gr CPU into alias for POWER5

Signed-off-by: Andreas Färber <>
Signed-off-by: Andreas Färber <>
Message-id:
Signed-off-by: Anthony Liguori <>

35ebcb2b 08/07/2013 08:47 pm Andreas Färber

target-ppc: Prepare POWER5P CPU family

It is ISA 2.03. Modelled as 970FX minus AltiVec flag.

Cc: Benjamin Herrenschmidt <>
Cc: Alexey Kardashevskiy <>
Signed-off-by: Andreas Färber <>
Signed-off-by: Andreas Färber <>...

f71d4c46 08/07/2013 08:47 pm Andreas Färber

target-ppc: Add POWER5+ v2.1 CPU model

Let's avoid -cpu host barfing at this PVR.
Linux recognizes it as "POWER5+ (gs) v2.1".

Signed-off-by: Andreas Färber <>
Signed-off-by: Andreas Färber <>
Message-id: ...

171777a4 08/07/2013 08:47 pm Andreas Färber

target-ppc: Turn POWER5gs CPU into alias for POWER5+

Signed-off-by: Andreas Färber <>
Signed-off-by: Andreas Färber <>
Message-id:
Signed-off-by: Anthony Liguori <>

a7d6b9f0 08/07/2013 08:47 pm Andreas Färber

target-ppc: Fix POWER7+ model

Commit 03a15a5436ed7723f406f15cc3798aa9991e75b5 claimed to add a POWER7+
model but instead added a "POWER7P" model, with an unhelpful "POWER7P"
description on top. Fix this to "POWER7+" as we already have "POWER3+",
"POWER4+" and "POWER5+" and there being no reason to deviate with the...

03a15a54 08/05/2013 07:46 pm Alexey Kardashevskiy

target-ppc: Add POWER7+ CPU model

This patch adds CPU PVR definition for POWER7+.

Signed-off-by: Alexey Kardashevskiy <>
Message-id:
Signed-off-by: Anthony Liguori <>

96b3bfa0 07/31/2013 02:48 am Andreas Färber

target-ppc: Suppress TCG instruction emulation warnings for qtest

Signed-off-by: Andreas Färber <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Andreas Färber <>
Message-id: ...

da56ff91 07/30/2013 03:33 am Peter Maydell

target-ppc/kvm.c: Rename 'dprintf' to 'DPRINTF'

'dprintf' is the name of a POSIX standard function so we should not be
stealing it for our debug macro. Rename to 'DPRINTF' (in line with
a number of other source files.)

Signed-off-by: Peter Maydell <>...

4ff1fac4 07/29/2013 07:33 pm Anthony Liguori

Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging

QOM CPUState refactorings

  • Fix x86 cpu-add
  • Change KVM PMU behavior for 1.6
  1. gpg: Signature made Mon 29 Jul 2013 10:28:18 AM CDT using RSA key ID 3E7E013F
  2. gpg: Can't check signature: public key not found...
e68cb8b4 07/29/2013 06:37 pm Alexey Kardashevskiy

pseries: savevm support with KVM

At present, the savevm / migration support for the pseries machine will not
work when KVM is enabled. That's because KVM manages the guest's hash page
table in the host kernel, so qemu has no visibility of it. This patch...

a83000f5 07/29/2013 06:37 pm Anthony Liguori

spapr-tce: make sPAPRTCETable a proper device

Model TCE tables as a device that's hooked up as a child object to
the owner. Besides the code cleanup, we get a few nice benefits:

1) free actually works now (it was dead code before)

2) the TCE information is visible in the device tree...

a90db158 07/29/2013 06:37 pm Alexey Kardashevskiy

target-ppc: Convert ppc cpu savevm to VMStateDescription

The savevm code for the powerpc cpu emulation is currently based around
the old register_savevm() rather than register_vmstate() method. It's also
rather broken, missing some important state on some CPU models....

14a10fc3 07/29/2013 04:29 pm Andreas Färber

cpu: Partially revert "cpu: Change qemu_init_vcpu() argument to CPUState"

Commit c643bed99 moved qemu_init_vcpu() calls to common CPUState code.
This causes x86 cpu-add to fail with "KVM: setting VAPIC address failed".

The reason for the failure is that CPUClass::kvm_fd is not yet...

986a2998 07/27/2013 01:04 am Andreas Färber

gdbstub: Replace GET_REG*() macros with gdb_get_reg*() functions

This avoids polluting the global namespace with a non-prefixed macro and
makes it obvious in the call sites that we return.

Semi-automatic conversion using, e.g.,
sed i 's/GET_REGL(/return gdb_get_regl(mem_buf, /g' target*/gdbstub.c...

5b50e790 07/27/2013 01:04 am Andreas Färber

cpu: Introduce CPUClass::gdb_{read,write}_register()

Completes migration of target-specific code to new target-*/gdbstub.c.

Acked-by: Michael Walle <> (for lm32)
Acked-by: Max Filippov <> (for xtensa)
Signed-off-by: Andreas Färber <>

5b24c641 07/27/2013 01:04 am Andreas Färber

cpu: Introduce CPUClass::gdb_core_xml_file for GDB_CORE_XML

Replace the GDB_CORE_XML define in gdbstub.c with a CPUClass field.
Use first_cpu for qSupported and qXfer:features:read: for now.
Add a stub for xml_builtin.

Signed-off-by: Andreas Färber <>

0980bfab 07/27/2013 12:24 am Andreas Färber

target-ppc: Move cpu_gdb_{read,write}_register()

Signed-off-by: Andreas Färber <>

a0e372f0 07/27/2013 12:23 am Andreas Färber

cpu: Introduce CPUState::gdb_num_regs and CPUClass::gdb_num_core_regs

CPUState::gdb_num_regs replaces num_g_regs.
CPUClass::gdb_num_core_regs replaces NUM_CORE_REGS.

Allows building gdb_register_coprocessor() for xtensa, too.

As a side effect this should fix coprocessor register numbering for SMP....

00b941e5 07/23/2013 03:41 am Andreas Färber

cpu: Turn cpu_get_phys_page_debug() into a CPUClass hook

Change breakpoint_invalidate() argument to CPUState alongside.

Since all targets now assign a softmmu-only field, we can drop helpers
cpu_class_set_{do_unassigned_access,vmsd}() and device_class_set_vmsd()....

22169d41 07/23/2013 03:41 am Andreas Färber

gdbstub: Change gdb_register_coprocessor() argument to CPUState

Signed-off-by: Andreas Färber <>

bdf7ae5b 07/23/2013 03:41 am Andreas Färber

cpu: Introduce CPUClass::synchronize_from_tb() for cpu_pc_from_tb()

Where no extra implementation is needed, fall back to CPUClass::set_pc().

Acked-by: Michael Walle <> (for lm32)
Signed-off-by: Andreas Färber <>

ed2803da 07/23/2013 03:41 am Andreas Färber

cpu: Move singlestep_enabled field from CPU_COMMON to CPUState

Prepares for changing cpu_single_step() argument to CPUState.

Acked-by: Michael Walle <> (for lm32)
Signed-off-by: Andreas Färber <>

f45748f1 07/23/2013 03:41 am Andreas Färber

cpu: Introduce CPUClass::set_pc() for gdb_set_cpu_pc()

This moves setting the Program Counter from gdbstub into target code.
Use vaddr type as upper-bound replacement for target_ulong.

Signed-off-by: Andreas Färber <>

7162bdea 07/11/2013 07:51 pm Julio Guerra

e600 core for MPC86xx processors

MPC86xx processors are based on the e600 core, which is not the case
in qemu where it is based on the 7400 processor.

This patch creates the e600 core and instantiates the MPC86xx
processors based on it. Therefore, adding the high BATs, the SPRG...

8d43ea1c 07/11/2013 07:51 pm Prerna Saxena

target-ppc: Add POWER8 v1.0 CPU model

This patch adds CPU PVR definition for POWER8,
and enables QEMU to launch guests on POWER8 hardware.

Signed-off-by: Prerna Saxena

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Paul Mackerras <paulus@samba.org>...

a0762859 07/09/2013 10:33 pm Andreas Färber

log: Change log_cpu_state[_mask]() argument to CPUState

Since commit 878096eeb278a8ac1ccd6667af73e026f29b4cf5 (cpu: Turn
cpu_dump_{state,statistics}() into CPUState hooks) CPUArchState is no
longer needed.

Add documentation and make the functions available through qemu/log.h...

77710e7a 07/09/2013 10:33 pm Andreas Färber

target-ppc: Change LOG_MMU_STATE() argument to CPUState

Choose CPUState rather than PowerPCCPU since doing a CPU cast on the
macro argument would hide type mismatches.

Signed-off-by: Andreas Färber <>

91b1df8c 07/09/2013 10:33 pm Andreas Färber

cpu: Move reset logging to CPUState

x86 was using additional CPU_DUMP_* flags, so make that configurable in
CPUClass::reset_dump_flags.

This adds reset logging for alpha, unicore32 and xtensa.

Acked-by: Michael Walle <> (for lm32)
Reviewed-by: Richard Henderson <>...

213fe1f5 07/09/2013 10:33 pm Andreas Färber

target-ppc: Change gen_intermediate_code_internal() argument to PowerPCCPU

Also use bool type while at it.

Prepares for moving singlestep_enabled field to CPUState.

Reviewed-by: Richard Henderson <>
Signed-off-by: Andreas Färber <>

09c6a63a 07/09/2013 10:33 pm Andreas Färber

target-ppc: Don't overuse ENV_GET_CPU()

Commit b632a148b677b773ff155f9de840b37a653567b9 (target-ppc: QOM method
dispatch for MMU fault handling) introduced a use of ENV_GET_CPU()
inside target-ppc/ code. Use ppc_env_get_cpu() instead.

Purely cosmetic, non-functional change to aid in locating and removing...

182735ef 07/09/2013 10:32 pm Andreas Färber

cpu: Make first_cpu and next_cpu CPUState

Move next_cpu from CPU_COMMON to CPUState.
Move first_cpu variable to qom/cpu.h.

gdbstub needs to use CPUState::env_ptr for now.
cpu_copy() no longer needs to save and restore cpu_next.

Acked-by: Paolo Bonzini <>...

6291ad77 07/09/2013 10:20 pm Peter Maydell

linux-user: Move cpu_clone_regs() and cpu_set_tls() into linux-user

The functions cpu_clone_regs() and cpu_set_tls() are not purely CPU
related -- they are specific to the TLS ABI for a a particular OS.
Move them into the linux-user/ tree where they belong....

6e42be7c 07/09/2013 10:20 pm Andreas Färber

cpu: Drop unnecessary dynamic casts in *_env_get_cpu()

A transition from CPUFooState to FooCPU can be considered safe,
just like FooCPU::env access in the opposite direction.
The only benefit of the FOO_CPU() casts would be protection against
bogus CPUFooState pointers, but then surrounding code would likely...

2c9b15ca 07/04/2013 06:42 pm Paolo Bonzini

memory: add owner argument to initialization functions

Signed-off-by: Paolo Bonzini <>

886b7577 07/01/2013 02:11 am Fabien Chouteau

PPC: Add dump_mmu() for 6xx

"(qemu) info tlb" is a very useful tool for debugging, so I implemented
the missing 6xx version.

Signed-off-by: Fabien Chouteau <>
[agraf: fix printfs on hwaddr to PRI]
Signed-off-by: Alexander Graf <>

b177d8b7 07/01/2013 02:11 am Fabien Chouteau

PPC: Fix GDB read on code area for PPC6xx

On PPC 6xx, data and code have separated TLBs. Until now QEMU was only
looking at data TLBs, which is not good when GDB wants to read code.

This patch adds a second call to get_physical_address() with an
ACCESS_CODE type of access when the first call with ACCESS_INT fails....

9761ad75 07/01/2013 02:11 am Alexander Graf

PPC: Introduce an alias cache for faster lookups

When running QEMU with "-cpu ?" we walk through every alias for every
target CPU we know about. This takes several seconds on my very fast
host system.

Let's introduce a class object cache in the alias table. Using that we...

2345f1c0 07/01/2013 02:11 am Alexander Graf

PPC: Ignore writes to L2CR

The L2CR register contains a number of bits that either impose configuration
which we can't deal with or mean "something is in progress until the bit is
0 again".

Since we don't model the former and we do want to accomodate guests using the...

4bddaf55 07/01/2013 02:11 am Alexey Kardashevskiy

target-ppc kvm: save cr register

This adds a missing code to save CR (condition register) via
kvm_arch_put_registers(). kvm_arch_get_registers() already has it.

Signed-off-by: Alexey Kardashevskiy <>
Signed-off-by: David Gibson <>...

b048960f 07/01/2013 02:11 am Andreas Färber

target-ppc: Introduce unrealizefn for PowerPCCPU

Use it to clean up the opcode table, resolving a former TODO from Jocelyn.
Also switch from malloc() to g_malloc().

Signed-off-by: Andreas Färber <>
Signed-off-by: Alexander Graf <>

1e3438df 07/01/2013 02:11 am Andreas Färber

target-ppc: Drop redundant flags assignments from CPU families

Previous code has #define POWERPC_INSNS2_<family> PPC_NONE in some
places for macrofied assignment to insns_flags2 field.

PPC_NONE is defined as zero though and QOM classes are zero-initialized,...

9fea2ae2 07/01/2013 02:11 am Hervé Poussineau

ppc: do not register IABR SPR twice for 603e

IABR SPR is already registered in gen_spr_603(), called from init_proc_603E().

Signed-off-by: Hervé Poussineau <>
Reviewed-by: Andreas Färber <>
Signed-off-by: Alexander Graf <>

4be1db86 07/01/2013 02:11 am Alexander Graf

PPC: Add non-kvm stub file

There are cases where a kvm provided function is called from generic
hw code that doesn't know whether kvm is available or not. Provide
a stub file which can provide simple replacement functions for those
cases.

Signed-off-by: Alexander Graf <>...

d85937e6 07/01/2013 02:11 am Scott Wood

kvm/openpic: in-kernel mpic support

Enables support for the in-kernel MPIC that thas been merged into the
KVM next branch. This includes irqfd/KVM_IRQ_LINE support from Alex
Graf (along with some other improvements).

Note from Alex regarding kvm_irqchip_create():...

c643bed9 06/28/2013 02:25 pm Andreas Färber

cpu: Change qemu_init_vcpu() argument to CPUState

This allows to move the call into CPUState's realizefn.
Therefore move the stub into libqemustub.a.

Reviewed-by: Richard Henderson <>
Signed-off-by: Andreas Färber <>

cb446eca 06/28/2013 02:25 pm Andreas Färber

kvm: Change cpu_synchronize_state() argument to CPUState

Change Monitor::mon_cpu to CPUState as well.

Reviewed-by: liguang <>
Acked-by: Paolo Bonzini <>
Signed-off-by: Andreas Färber <>

878096ee 06/28/2013 02:25 pm Andreas Färber

cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks

Make cpustats monitor command available unconditionally.

Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec()
arguments to CPUState.

Signed-off-by: Andreas Färber <>

82169660 06/12/2013 12:19 pm Scott Wood

KVM: PPC: Add dummy kvm_arch_init_irq_routing()

The common KVM code insists on calling kvm_arch_init_irq_routing()
as soon as it sees kernel header support for it (regardless of whether
QEMU supports it). Provide a dummy function to satisfy this.

Unlike x86, PPC does not have one default irqchip, so there's no common...

997aba8e 05/18/2013 03:35 pm Michael Tokarev

remove some double-includes

Some source files #include the same header more than
once for no good reason. Remove second #includes in
such cases.

Signed-off-by: Michael Tokarev <>

36f48d9c 05/08/2013 09:23 pm Alexander Graf

PPC: Depend behavior of cmp instructions only on instruction encoding

When running an L=1 cmp instruction on a 64bit PPC CPU with SF off, it
still behaves identical to what it does when SF is on. Remove the implicit
difference in the code.

Also, on most 32bit CPUs we should always treat the compare as 32bit...

554ecc57 05/08/2013 09:23 pm Alexander Graf

PPC: Fix rldcl

The implementation for rldcl tried to always fetch its
parameters from the opcode, even though the opcode was
already passed in in decoded and different forms.

Use the parameters instead, fixing rldcl.

Reported-by: Torbjorn Granlund <>...

126a7930 05/06/2013 06:22 pm Alexander Graf

PPC: Add MMU type for 2.06 with AMR but no TB pages

When running -cpu on a POWER7 system with PR KVM, we mask out the 1TB
MMU capability from the MMU type mask, but not the AMR bit.

This leads to us having a new MMU type that we don't check for in our
MMU management functions....

c05541ee 05/06/2013 06:22 pm Anton Blanchard

target-ppc: Fix invalid SPR read/write warnings

Invalid and privileged SPR warnings currently print the wrong
address. While fixing that, also make it clear that we are
printing both the decimal and hexadecimal SPR number.

Before:

Trying to read invalid spr 896 380 at 0000000000000714...
04559d52 05/06/2013 06:22 pm Anton Blanchard

target-ppc: Add read and write of PPR SPR

Recent Linux kernels save and restore the PPR across exceptions
so we need to handle it.

Signed-off-by: Anton Blanchard <>
Signed-off-by: Alexander Graf <>

909eedb7 04/27/2013 01:37 am Aurelien Jarno

target-ppc: slightly optimize lfiwax

Signed-off-by: Aurelien Jarno <>

199f830d 04/27/2013 12:02 am Aurelien Jarno

target-ppc: emulate lfiwax instruction

Needed for Power ISA version 2.05 compliance.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>
[agraf: fix tcg debug error]
Signed-off-by: Alexander Graf <>

05050ee8 04/27/2013 12:02 am Aurelien Jarno

target-ppc: emulate load doubleword pair instructions

Needed for Power ISA version 2.05 compliance. The check for odd register
pairs is done using the invalid bits.

Signed-off-by: Aurelien Jarno <>
Signed-off-by: Alexander Graf <>

44bc0c4d 04/27/2013 12:02 am Aurelien Jarno

target-ppc: emulate store doubleword pair instructions

Needed for Power ISA version 2.05 compliance. The check for odd register
pairs is done using the invalid bits.

Signed-off-by: Aurelien Jarno <>
Signed-off-by: Alexander Graf <>

7d08d856 04/27/2013 12:02 am Aurelien Jarno

target-ppc: add support for extended mtfsf/mtfsfi forms

Power ISA 2.05 adds support for extended mtfsf/mtfsfi form, with a new
W field to select the upper part of the FPCSR register.

For that the helper is changed to handle 64-bit input values and mask with...

db72c9f2 04/27/2013 12:02 am Tristan Gingold

powerpc: correctly handle fpu exceptions.

Raise the exception on the first occurence, do not wait for the next
floating point operation.

Signed-off-by: Fabien Chouteau <>
Signed-off-by: Alexander Graf <>

414f5d14 04/27/2013 12:02 am Alexander Graf

PPC: Fix dcbz for linux-user on 970

The default with linux-user for dcbz on 970 is to emulate 32 byte clears.
However, redoing the dcbzl support we added a check to not honor the bit
in HID5 that sets this.

Remove the #ifdef check on linux user, so that we get 32 byte clears again....

bf45a2e6 04/27/2013 12:02 am Aurelien Jarno

target-ppc: optimize fabs, fnabs, fneg

fabs, fnabs and fneg are just flipping the bit sign of an FP register,
this can be implemented in TCG instead of using softfloat.

Signed-off-by: Aurelien Jarno <>
Signed-off-by: Alexander Graf <>

9c2627b0 04/27/2013 12:02 am Aurelien Jarno

target-ppc: add instruction flags for Book I 2.05

.. and enable it on POWER7 CPU.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>
Signed-off-by: Alexander Graf <>

fcfda20f 04/27/2013 12:02 am Aurelien Jarno

target-ppc: emulate cmpb instruction

Needed for Power ISA version 2.05 compliance.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>
Signed-off-by: Alexander Graf <>

725bcec2 04/27/2013 12:02 am Aurelien Jarno

target-ppc: emulate prtyw and prtyd instructions

Needed for Power ISA version 2.05 compliance.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>
[agraf: fix 32-bit host compile, simplify code]
Signed-off-by: Alexander Graf <>

f0332888 04/27/2013 12:02 am Aurelien Jarno

target-ppc: emulate fcpsgn instruction

Needed for Power ISA version 2.05 compliance.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>
Signed-off-by: Alexander Graf <>

f36951c1 04/27/2013 12:02 am David Gibson

pseries: Fix incorrect calculation of RMA size in certain configurations

For the pseries machine, we need to advertise to the guest the size of its
RMA - that is the amount of memory it can access with the MMU off. For HV
KVM, this is constrained by the hardware limitations on the virtual RMA of...

0cbad81f 04/27/2013 12:02 am David Gibson

pseries: Fixes and enhancements to L1 cache properties

PAPR requires that the device tree's CPU nodes have several properties
with information about the L1 cache. We already create two of these
properties, but with incorrect names - "[id]cache-block-size" instead...

702763fa 04/27/2013 12:02 am David Gibson

target-ppc: Add more stubs for POWER7 PMU registers

In addition to the performance monitor registers found on nearly all
6xx chips, the POWER7 has two additional counters (PMC5 & PMC6) and an
extra control register (MMCRA). This patch adds stub support for them to...

9b00ea49 04/27/2013 12:02 am David Gibson

target-ppc: Synchronize VPA state with KVM

For PAPR guests, KVM tracks the various areas registered with the
H_REGISTER_VPA hypercall. For full emulation, of course, these are tracked
within qemu. At present these values are not synchronized. This is a...

31f2cb8f 04/27/2013 12:02 am Bharat Bhushan

Enable kvm emulated watchdog

Enable the KVM emulated watchdog if KVM supports (use the
capability enablement in watchdog handler). Also watchdog exit
(KVM_EXIT_WATCHDOG) handling is added.
Watchdog state machine is cleared whenever VM state changes to running....