Statistics
| Branch: | Revision:

root / target-ppc / cpu.h @ 5b50e790

History | View | Annotate | Download (87 kB)

# Date Author Comment
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 <>

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....

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 <>

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....

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 <>

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...

2cf3eb6d 04/27/2013 12:02 am Fabien Chouteau

PPC: Remove env->hreset_excp_prefix

This value is not needed if we use correctly the MSR[IP] bit.

excp_prefix is always 0x00000000, except when the MSR[IP] bit is
implemented and set to 1, in that case excp_prefix is 0xfff00000.

The handling of MSR[IP] was already implemented but not used at reset...

f80872e2 03/22/2013 04:28 pm David Gibson

mmu-hash64: Implement Virtual Page Class Key Protection

Version 2.06 of the Power architecture describes an additional page
protection mechanism. Each virtual page has a "class" (0-31) recorded in
the PTE. The AMR register contains bits which can prohibit reads and/or...

cc8eae8a 03/22/2013 04:28 pm David Gibson

target-ppc: Split user only code out of mmu_helper.c

mmu_helper.c is, for obvious reasons, almost entirely concerned with
softmmu builds of qemu. However, it does contain one stub function which
is used when CONFIG_USER_ONLY=y - the user only versoin of...

eb20c1c6 03/22/2013 04:28 pm David Gibson

target-ppc: Move ppc tlb_fill implementation into mmu_helper.c

For softmmu builds the interface from the generic code to the target
specific MMU implementation is through the tlb_fill() function. For ppc
this is currently in mem_helper.c, whereas it would make more sense in...

496272a7 03/22/2013 04:28 pm David Gibson

target-ppc: Disentangle hash mmu helper functions

The newly separated paths for hash mmus rely on several helper functions
which are still shared with 32-bit hash mmus: pp_check(), check_prot() and
pte_update_flags(). While these don't have ugly ifdefs on the mmu type,...

59191721 03/22/2013 04:28 pm David Gibson

target-ppc: Don't share get_pteg_offset() between 32 and 64-bit

The get_pteg_offset() helper function is currently shared between 32-bit
and 64-bit hash mmus, taking a parameter for the hash pte size. In the
64-bit paths, it's only called in one place, and it's a trivial...

98132796 03/22/2013 04:28 pm David Gibson

target-ppc: Disentangle BAT code for 32-bit hash MMUs

The functions for looking up BATs (Block Address Translation - essentially
a level 0 TLB) are shared between the classic 32-bit hash MMUs and the
6xx style software loaded TLB implementations.

This patch splits out a copy for the 32-bit hash MMUs, to facilitate...

5dc68eb0 03/22/2013 04:28 pm David Gibson

target-ppc: mmu_ctx_t should not be a global type

mmu_ctx_t is currently defined in cpu.h. However it is used for temporary
information relating to mmu translation, and is only used in mmu_helper.c
and (now) mmu-hash{32,64}.c. Furthermore it contains information which...

d5aea6f3 03/22/2013 04:28 pm David Gibson

mmu-hash*: Add header file for definitions

Currently cpu.h contains a number of definitions relating to the 64-bit
hash MMU. Some are used in the MMU emulation code, but some are only used
in the spapr MMU management hcall implementations.

This patch moves these definitions (except for a few that are needed...

9d7c3f4a 03/22/2013 04:28 pm David Gibson

target-ppc: Disentangle pte_check()

Currently support for both 32-bit and 64-bit hash MMUs share an
implementation of pte_check. But there are enough differences that this
means the shared function has several very ugly conditionals on "is_64b".

This patch cleans things up by separating out the 64-bit version...

c69b6151 03/22/2013 04:28 pm David Gibson

target-ppc: Disentangle find_pte()

32-bit and 64-bit hash MMU implementations currently share a find_pte
function. This results in a whole bunch of ugly conditionals in the shared
function, and not all that much actually shared code.

This patch separates out the 32-bit and 64-bit versions, putting then...

629bd516 03/22/2013 04:28 pm David Gibson

target-ppc: Disentangle get_physical_address() paths

Depending on the MSR state, for 64-bit hash MMUs, get_physical_address
can either call check_physical (which has further tests for mmu type)
or get_segment64. Similarly for 32-bit hash MMUs we can either call...

d6478bc7 03/22/2013 04:28 pm Fabien Chouteau

PPC/GDB: handle read and write of fpscr

Although the support of this register may be uncomplete, there are no
reason to prevent the debugger from reading or writing it.

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

9baea4a3 03/22/2013 04:28 pm David Gibson

target-ppc: Remove vestigial PowerPC 620 support

The PowerPC 620 was the very first 64-bit PowerPC implementation, but
hardly anyone ever actually used the chips. qemu notionally supports the
620, but since we don't actually have code to implement the segment table,...

213c7180 03/22/2013 04:28 pm David Gibson

target-ppc: Trivial cleanups in mmu_helper.c

This removes the never-used pte64_invalidate() function, and makes
ppcmas_tlb_check() static, since it's only used within that file.

Signed-off-by: David Gibson <>
Signed-off-by: Alexander Graf <>

10b46525 03/22/2013 04:28 pm David Gibson

target-ppc: Move SLB handling into a mmu-hash64.c

As a first step to disentangling the handling for 64-bit hash MMUs from
the rest, we move the code handling the Segment Lookaside Buffer (SLB)
(which only exists on 64-bit hash MMUs) into a new mmu-hash64.c file....

259186a7 03/12/2013 11:35 am Andreas Färber

cpu: Move halted and interrupt_request fields to CPUState

Both fields are used in VMState, thus need to be moved together.
Explicitly zero them on reset since they were located before
breakpoints.

Pass PowerPCCPU to kvmppc_handle_halt().

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

97a8ea5a 03/12/2013 11:35 am Andreas Färber

cpu: Replace do_interrupt() by CPUClass::do_interrupt method

This removes a global per-target function and thus takes us one step
closer to compiling multiple targets into one executable.

It will also allow to override the interrupt handling for certain CPU...

d67d40ea 03/08/2013 10:04 pm David Gibson

target-ppc: Add mechanism for synchronizing SPRs with KVM

Currently when runing under KVM on ppc, we synchronize a certain number of
vital SPRs to KVM through the SET_SREGS call. This leaves out quite a lot
of important SPRs which are maintained in KVM. It would be helpful to...

cfe34f44 03/08/2013 10:04 pm Andreas Färber

target-ppc: Convert CPU definitions

Turn the array of model definitions into a set of self-registering QOM
types with their own class_init. Unique identifiers are obtained from
the combination of PVR, SVR and family identifiers; this requires all
alias #defines to be removed from the list. Possibly there are some more...

da91a00f 02/23/2013 07:25 pm Richard Henderson

target-ppc: Split out SO, OV, CA fields from XER

In preparation for more efficient setting of these fields.

Cc: Alexander Graf <>
Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

8e33944f 02/01/2013 02:52 am Alexander Graf

PPC: Unify dcbzl code path

The bit that makes a dcbz instruction a dcbzl instruction was declared as
reserved in ppc32 ISAs. However, hardware simply ignores the bit, making
code valid if it simply invokes dcbzl instead of dcbz even on 750 and G4.

Thus, mark the bit as unreserved so that we properly emulate a simple dcbz...

68c2dd70 01/07/2013 06:37 pm Alexander Graf

PPC: Bring EPR support closer to reality

We already used to support the external proxy facility of FSL MPICs,
but only implemented it halfway correctly.

This patch adds support for

  • dynamic enablement of the EPR facility
  • interrupt acknowledgement only when the interrupt is delivered...
2985b86b 01/07/2013 06:37 pm Andreas Färber

target-ppc: Slim conversion of model definitions to QOM subclasses

Since the model list is highly macrofied, keep ppc_def_t for now and
save a pointer to it in PowerPCCPUClass. This results in a flat list of
subclasses including aliases, to be refined later....

6b4c305c 12/19/2012 09:32 am Paolo Bonzini

fpu: move public header file to include/fpu

Signed-off-by: Paolo Bonzini <>

022c62cb 12/19/2012 09:31 am Paolo Bonzini

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

b162d02e 12/14/2012 02:12 pm David Gibson

target-ppc: Don't use hwaddr to represent hardware state

The hwaddr type is somewhat vaguely defined as being able to contain bus
addresses on the widest possible bus in the system. For that reason it's
discouraged for representing specific pieces of persistent hardware state,...

ef84755e 11/03/2012 02:55 pm Blue Swirl

Merge branch 'trivial-patches' of git://github.com/stefanha/qemu

  • '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...
43448292 11/01/2012 08:49 pm Blue Swirl

ppc: add missing static

Add missing 'static' qualifiers.

Signed-off-by: Blue Swirl <>
Acked-by: Alexander Graf <>
Signed-off-by: Stefan Hajnoczi <>

6575c289 11/01/2012 08:49 pm Blue Swirl

target-ppc: make some functions static

Signed-off-by: Blue Swirl <>
Acked-by: Alexander Graf <>
Signed-off-by: Stefan Hajnoczi <>

98c8a73b 11/01/2012 06:12 pm Anthony Liguori

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

  • afaerber/qom-cpu: (35 commits)
    target-i386: Pass X86CPU to kvm_handle_halt()
    target-i386: Pass X86CPU to kvm_get_mp_state()
    cpu: Move thread_id to CPUState
    cpus: Pass CPUState to run_on_cpu()...
ac7d12ba 11/01/2012 02:02 pm David Gibson

target-ppc: Rework storage of VPA registration state

We change the storage of the VPA information to explicitly use fixed
size integer types which will make life easier for syncing this data with
KVM, which we will need in future.

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

30304420 11/01/2012 02:02 pm David Gibson

target-ppc: Extend FPU state for newer POWER CPUs

This patch adds some extra FPU state to CPUPPCState. Specifically,
fpscr is extended to a target_ulong bits, since some recent (64 bit)
CPUs now have more status bits than fit inside 32 bits. Also, we add...

3993c6bd 10/31/2012 05:11 am Andreas Färber

cpus: Pass CPUState to [qemu_]cpu_has_work()

For target-mips also change the return type to bool.

Make include paths for cpu-qom.h consistent for alpha and unicore32.

Signed-off-by: Andreas Färber <>
[AF: Updated new target-openrisc function accordingly]...

1b14670a 10/31/2012 02:02 am Andreas Färber

target-ppc: Pass PowerPCCPU to cpu_ppc_hypercall

Adapt emulate_spapr_hypercall() accordingly.

Needed for changing spapr_hypercall() argument type to PowerPCCPU.

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

1bfb37d1 10/29/2012 12:45 pm David Gibson

target-ppc: Rework storage of VPA registration state

With PAPR guests, hypercalls allow registration of the Virtual Processor
Area (VPA), SLB shadow and dispatch trace log (DTL), each of which allow
for certain communication between the guest and hypervisor. Currently, we...

a8170e5e 10/23/2012 04:58 pm Avi Kivity

Rename target_phys_addr_t to hwaddr

target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
reserved) and its purpose doesn't match the name (most target_phys_addr_t
addresses are not target specific). Replace it with a finger-friendly,...

011aba24 10/04/2012 04:54 pm David Gibson

target-ppc: Remove unused power_mode field from cpu state

CPUPPCState includes a variable 'power_mode' which is used nowhere. This
patch removes it. This includes saving a dummy zero in its place during
vmsave, to avoid breaking the save format.

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

2a7a47fc 06/24/2012 02:04 am Alexander Graf

PPC: BookE: Implement EPR SPR

On the e500 series, accessing SPR_EPR magically turns into an access at
that CPU's IACK register on the MPIC. Implement that logic to get kernels
that make use of that feature work.

Signed-off-by: Alexander Graf <>

96091698 06/24/2012 02:04 am Alexander Graf

PPC: BookE206: Bump MAS2 to 64bit

On 64bit capable systems, MAS2 can actually hold a 64bit virtual page
address. So increase the mask for its EPN.

Signed-off-by: Alexander Graf <>

84755ed5 06/24/2012 02:04 am Alexander Graf

PPC: Add some booke SPR defines

The number of SPRs avaiable in different PowerPC chip is still increasing. Add
definitions for the MAS7_MAS3 SPR and all currently known bits in EPCR.

Signed-off-by: Alexander Graf <>

e42a61f1 06/24/2012 02:04 am Alexander Graf

PPC: Add support for MSR_CM

The BookE variant of MSR_SF is MSR_CM. Implement everything it takes in TCG to
support running 64bit code with MSR_CM set.

Signed-off-by: Alexander Graf <>

4656e1f0 06/24/2012 02:04 am Benjamin Herrenschmidt

ppc64: Rudimentary Support for extra page sizes on server CPUs

More recent Power server chips (i.e. based on the 64 bit hash MMU)
support more than just the traditional 4k and 16M page sizes. This
can get quite complicated, because which page sizes are supported,...

9aa5b158 06/24/2012 02:04 am Blue Swirl

ppc: Cleanup MMU merge

Remove useless wrappers. In some cases 'int' parameters are
changed to uint32_t.

Make internal functions static.

Signed-off-by: Blue Swirl <>
[agraf: fix kvm compilation]
Signed-off-by: Alexander Graf <>...

c79c73f6 06/24/2012 02:04 am Blue Swirl

ppc: Move exception helpers from helper.c to excp_helper.c

Move exception helpers from helper.c to excp_helper.c and
make cpu_dump_rfi() static.

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

397b457d 06/05/2012 12:00 am Andreas Färber

target-ppc: Let cpu_ppc_init() return PowerPCCPU

Adapt e500 mpc8544ds machine accordingly.

Turn cpu_init() into a static inline function returning CPUPPCState for
backwards compatibility.

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

1d0cb67d 04/15/2012 06:10 pm Andreas Färber

target-ppc: QOM'ify CPU

Embed CPUPPCState as first member of PowerPCCPU.
Distinguish between "powerpc-cpu", "powerpc64-cpu" and
"embedded-powerpc-cpu".

Let CPUClass::reset() call cpu_state_reset() for now.

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

e2fbb432 04/15/2012 06:07 pm Andreas Färber

target-ppc: Drop cpu_ppc_close()

It is unused, so avoid QOM'ifying it unneededly.

Signed-off-by: Andreas Färber <>
Acked-by: David Gibson <>

5cbdb3a3 04/07/2012 05:00 pm Stefan Weil

Replace Qemu by QEMU in comments

The official spelling is QEMU.

Signed-off-by: Stefan Weil <>
Reviewed-by: Andreas Färber <>
[: fixed comment style in hw/sun4m.c]
Signed-off-by: Blue Swirl <>

cd6e9320 03/15/2012 02:12 pm Thomas Huth

PPC64: Add support for ldbrx and stdbrx instructions

These instructions for loading and storing byte-swapped 64-bit values have
been introduced in PowerISA 2.06.

Signed-off-by: Thomas Huth <>
Signed-off-by: David Gibson <>...

9349b4f9 03/14/2012 11:20 pm Andreas Färber

Rename CPUState -> CPUArchState

Scripted conversion:
for file in .[hc] hw/.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do
sed -i "s/CPUState/CPUArchState/g" $file
done...

1328c2bf 03/14/2012 11:20 pm Andreas Färber

target-ppc: Don't overuse CPUState

Scripted conversion:
sed -i "s/CPUState/CPUPPCState/g" target-ppc/*.[hc]
sed -i "s/#define CPUPPCState/#define CPUState/" target-ppc/cpu.h

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

fc0b2c0f 03/14/2012 11:20 pm Alexander Graf

PPC: 405: Use proper CPU reset

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 <>...

58e00a24 02/02/2012 03:47 am Alexander Graf

PPC: E500: Add doorbell defines

We're going to introduce doorbell instructions (called processor
control in the spec) soon. Add some defines for easier patch
readability later.

Signed-off-by: Alexander Graf <>

3f9f6a50 02/02/2012 03:47 am Alexander Graf

PPC: Add CPU feature for processor control

We're soon going to implement processor control features. Add the
feature flag, so we're well prepared.

Signed-off-by: Alexander Graf <>

a1ef618a 02/02/2012 03:47 am Alexander Graf

PPC: booke: add tlbnps handling

When using MAV 2.0 TLB registers, we have another range of TLB registers
available to read the supported page sizes from.

Add SPR definitions for those and add a helper function that we can use
to receive such a bitmap even when using MAV 1.0....

3f162d11 02/02/2012 03:47 am Alexander Graf

PPC: booke206: Check for TLB overrun

Our internal helpers to fetch TLB entries were not able to tell us
that an entry doesn't even exist. Pass an error out if we hit such
a case to not accidently pass beyond the TLB array.

Signed-off-by: Alexander Graf <>

0ef654e3 02/02/2012 03:47 am Alexander Graf

PPC: E500: Add some more excp vectors

Our EXCP list is getting outdated. By now, 3 new exception vectors have
been introduced. Update the list so we have everything at one place.

Signed-off-by: Alexander Graf <>

e9205258 02/02/2012 03:47 am Alexander Graf

PPC: Add IVOR 38-42

Our code only knows IVORs up to 37. Add the new ones defined in ISA 2.06
from 38 - 42.

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

4abf79a4 12/02/2011 12:50 pm Dong Xu Wang

fix spelling in target sub directory

Cc: Richard Henderson <>
Cc: Edgar E. Iglesias <>
Cc: Aurelien Jarno <>
Cc: Alexander Graf <>
Cc: Aurelien Jarno <>
Cc: Blue Swirl <>...

02d4eae4 10/31/2011 03:57 am David Gibson

ppc: Alter CPU state to mask out TCG unimplemented instructions as appropriate

The CPU state contains two bitmaps, initialized from the CPU spec
which describes which instructions are implemented on the CPU. A
couple of bits are defined which cover instructions (VSX and DFP)...

a7342588 10/30/2011 09:03 pm David Gibson

pseries: Correct vmx/dfp handling in both KVM and TCG cases

Currently, when KVM is enabled, the pseries machine checks if the host
CPU supports VMX, VSX and/or DFP instructions and advertises
accordingly in the guest device tree. It does this regardless of what...

8b242eba 10/30/2011 09:03 pm Alexander Graf

PPC: Bump qemu-system-ppc to 64-bit physical address space

Some 32-bit PPC CPUs can use up to 36 bit of physical address space.
Treat them accordingly in the qemu-system-ppc binary type.

Signed-off-by: Alexander Graf <>

a1e98583 10/30/2011 06:11 pm David Gibson

ppc: First cut implementation of -cpu host

For convenience with kvm, x86 allows the user to specify -cpu host on the
qemu command line, which means make the guest cpu the same as the host
cpu. This patch implements the same option for ppc targets.

For now, this just read the host PVR (Processor Version Register) and...

ddd1055b 10/06/2011 10:48 am Fabien Chouteau

PPC: booke timers

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)....

93dd5e85 10/06/2011 10:48 am Scott Wood

kvm: ppc: booke206: use MMU API

Share the TLB array with KVM. This allows us to set the initial TLB
both on initial boot and reset, is useful for debugging, and could
eventually be used to support migration.

Signed-off-by: Scott Wood <>...

bebabbc7 10/06/2011 10:48 am Scott Wood

ppc: booke206: add "info tlb" support

Signed-off-by: Scott Wood <>
Signed-off-by: Alexander Graf <>

2bd9543c 10/06/2011 10:48 am Scott Wood

ppc: booke206: use MAV=2.0 TSIZE definition, fix 4G pages

This definition is backward compatible with MAV=1.0 as long as
the guest does not set reserved bits in MAS1/MAS4.

Also, fix the shift in booke206_tlb_to_page_size -- it's the base
that should be able to hold a 4G page size, not the shift count....

697ab892 10/06/2011 10:48 am David Gibson

Implement POWER7's CFAR in TCG

This patch implements support for the CFAR SPR on POWER7 (Come From
Address Register), which snapshots the PC value at the time of a branch or
an rfid. The latest powerpc-next kernel also catches it and can show it in
xmon or in the signal frames....

542df9bf 08/23/2011 11:24 pm Alexander Graf

PPC: E500: Add ESR bit definitions

The BookE spec specifies a number of ESR bits. Add defines for them
so we can use them later on.

Reported-by: Jason Wessel <>
Signed-off-by: Alexander Graf <>
Signed-off-by: Edgar E. Iglesias <>

97b348e7 08/07/2011 12:32 pm Blue Swirl

Remove unused is_softmmu parameter from cpu_handle_mmu_fault

Parameter is_softmmu (and its evil mutant twin brother is_softmuu)
is not used in cpu_*_handle_mmu_fault() functions, remove them
and adjust callers.

Acked-by: Richard Henderson <>...

f5fc40bb 07/13/2011 12:01 am Peter Maydell

target-alpha, target-ppc: Remove unnecessary setjmp.h include

Remove the include of setjmp.h from the cpu.h of target-alpha
and target-ppc. This is unnecessary because cpu-defs.h already
includes this header; this change brings these two targets
into line with all the rest....

3b886706 07/02/2011 12:12 am Blue Swirl

Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf

  • 'ppc-next' of git://repo.or.cz/qemu/agraf:
    PPC: move TLBs to their own arrays
    PPC: 440: Use 440 style MMU as default, so Qemu knows the MMU type
    PPC: E500: Use MAS registers instead of internal TLB representation...
f081c76c 06/26/2011 09:25 pm Blue Swirl

Move cpu_has_work and cpu_pc_from_tb to cpu.h

Move functions cpu_has_work() and cpu_pc_from_tb() from exec.h to cpu.h. This is
needed by later patches.

Signed-off-by: Blue Swirl <>

1c53accc 06/17/2011 03:58 am Alexander Graf

PPC: move TLBs to their own arrays

Until now, we've created a union over multiple different TLB types and
allocated that union. While it's a waste of memory (and cache) to allocate
TLB information for a TLB type with much information when you only need
little, it also inflicts another issue....

d1e256fe 06/17/2011 03:58 am Alexander Graf

PPC: E500: Use MAS registers instead of internal TLB representation

The natural format for e500 cores to do TLB manipulation with are the MAS
registers. Instead of converting them into some internal representation
and back again when the guest reads them, we can just keep the data...

6d42fb31 05/20/2011 06:56 pm Stefan Weil

w32: Fix compilation and replace non-portable usage of ulong

ulong is undefined for w32 (and maybe other) compilations.
Replace it by uintptr_t (which also fixes compilation for w64
and is a better choice for pointer to integer conversions).

Cc: Aurelien Jarno <>...

091959de 05/14/2011 05:54 pm Aurelien Jarno

Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf

  • 'ppc-next' of git://repo.or.cz/qemu/agraf:
    PPC: Qdev'ify e500 pci
    PPC MPC7544DS: Use new TLB helper function
    PPC: Implement e500 (FSL) MMU
    PPC: Add another 64 bits to instruction feature mask...
71afeb61 05/12/2011 01:24 am Alexander Graf

PPC: Add GS MSR definition

The BookE specification defines MSR bit 28 as Guest State. Add it
to the list of MSR macros.

Signed-off-by: Alexander Graf <>

a5858d7a 05/12/2011 01:24 am Alexander Graf

PPC: Add another 64 bits to instruction feature mask

To enable quick runtime detection of instruction groups to the currently
selected CPU emulation, we have a feature mask of what exactly the respective
instruction supports.

This feature mask is 64 bits long and we just successfully exceeded those 64...

01662f3e 05/12/2011 01:24 am Alexander Graf

PPC: Implement e500 (FSL) MMU

Most of the code to support e500 style MMUs is already in place, but
we're missing on some of the special TLB0-TLB1 handling code and slightly
different TLB modification.

This patch adds support for the FSL style MMU.

Signed-off-by: Alexander Graf <>

90dc8812 05/09/2011 11:31 pm Scott Wood

monitor: add PPC BookE SPRs

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 <>
Signed-off-by: Alexander Graf <>

5b46d07d 05/08/2011 12:02 pm Stefan Weil

Fix typo in comment (embeded -> embedded)

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

ed120055 04/01/2011 07:34 pm David Gibson

Implement PAPR VPA functions for pSeries shared processor partitions

Shared-processor partitions are those where a CPU is time-sliced between
partitions, rather than being permanently dedicated to a single
partition. qemu emulated partitions, since they are just scheduled with...

bb593904 04/01/2011 07:34 pm David Gibson

Parse SDR1 on mtspr instead of at translate time

On ppc machines with hash table MMUs, the special purpose register SDR1
contains both the base address of the encoded size (hashed) page tables.

At present, we interpret the SDR1 value within the address translation...

fda6a0ec 04/01/2011 07:34 pm David Gibson

Use "hash" more consistently in ppc mmu code

Currently, get_segment() has a variable called hash. However it doesn't
(quite) get the hash value for the ppc hashed page table. Instead it
gets the hash shifted - effectively the offset of the hash bucket within...

256cebe5 04/01/2011 07:34 pm David Gibson

Better factor the ppc hash translation path

Currently the path handling hash page table translation in get_segment()
has a mix of common and 32 or 64 bit specific code. However the
division is not done terribly well which results in a lot of messy code
flipping between common and divided paths....

cdaee006 04/01/2011 07:34 pm David Gibson

Support 1T segments on ppc

Traditionally, the "segments" used for the two-stage translation used on
powerpc MMUs were 256MB in size. This was the only option on all hash
page table based 32-bit powerpc cpus, and on the earlier 64-bit hash page
table based cpus. However, newer 64-bit cpus also permit 1TB segments...

9d52e907 04/01/2011 07:34 pm David Gibson

Add POWER7 support for ppc

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....

f43e3525 04/01/2011 07:34 pm David Gibson

Virtual hash page table handling on pSeries machine

On pSeries logical partitions, excepting the old POWER4-style full system
partitions, the guest does not have direct access to the hardware page
table. Instead, the pagetable exists in hypervisor memory, and the guest...

81762d6d 04/01/2011 07:34 pm David Gibson

Clean up PowerPC SLB handling code

Currently the SLB information when emulating a PowerPC 970 is
storeed in a structure with the unhelpfully named fields 'tmp'
and 'tmp64'. While the layout in these fields does match the
description of the SLB in the architecture document, it is not...

d569956e 04/01/2011 07:34 pm David Gibson

Add a hook to allow hypercalls to be emulated on PowerPC

PowerPC and POWER chips since the POWER4 and 970 have a special
hypervisor mode, and a corresponding form of the system call
instruction which traps to the hypervisor.

qemu currently has stub implementations of hypervisor mode. That...

efdef95f 04/01/2011 07:34 pm David Gibson

Implement PowerPC slbmfee and slbmfev instructions

For a 64-bit PowerPC target, qemu correctly implements translation
through the segment lookaside buffer. Likewise it supports the
slbmte instruction which is used to load entries into the SLB.

However, it does not emulate the slbmfee and slbmfev instructions...

eaabeef2 04/01/2011 07:34 pm David Gibson

Correct ppc popcntb logic, implement popcntw and popcntd

qemu already includes support for the popcntb instruction introduced
in POWER5 (although it doesn't actually allow you to choose POWER5).

However, the logic is slightly incorrect: it will generate results...