Statistics
| Branch: | Revision:

root / target-ppc / mmu_helper.c @ feature-archipelago

History | View | Annotate | Download (88.4 kB)

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

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

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

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

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

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

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

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

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

target-ppc: Use QOM method dispatch for MMU fault handling

After previous cleanups, the many scattered checks of env->mmu_model in
the ppc MMU implementation have, at least for "classic" hash MMUs been
reduced (almost) to a single switch at the top of
cpu_ppc_handle_mmu_fault()....

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

target-ppc: Disentangle hash mmu versions of cpu_get_phys_page_debug()

cpu_get_phys_page_debug() is a trivial wrapper around
get_physical_address(). But even the signature of
get_physical_address() has some things we'd like to clean up on a
per-mmu basis, so this patch moves the test on mmu model out to...

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

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

0480884f 03/22/2013 04:28 pm David Gibson

target-ppc: Disentangle get_segment()

The poorly named get_segment() function handles most of the address
translation logic for hash-based MMUs. It has many ugly conditionals on
whether the MMU is 32-bit or 64-bit.

This patch splits the function into 32 and 64-bit versions, using the...

44bc9107 03/22/2013 04:28 pm David Gibson

target-ppc: Rework get_physical_address()

Currently get_physical_address() first checks to see if translation is
enabled in the MSR, then in the translation on case switches on the mmu
type. Except that for BookE MMUs, translation is always on, and so it...

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

25de24ab 03/22/2013 04:28 pm David Gibson

target-ppc: Disentangle hash mmu paths for cpu_ppc_handle_mmu_fault

cpu_ppc_handle_mmu_fault() calls get_physical_address() (whose behaviour
depends on MMU type) then, if that fails, issues an appropriate exception
- which again has a number of dependencies on MMU type....

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

8152ceaf 03/22/2013 04:28 pm David Gibson

target-ppc: Remove address check for logging

One LOG_MMU statement in mmu_helper.c has an odd check on the effective
address being translated. I can see no reason for this; I suspect it was
a debugging hack from long ago. This patch removes it.

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

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

350ed2fc 02/01/2013 06:43 pm Andreas Färber

target-ppc: Fix target_ulong vs. hwaddr format mismatches

Since HWADDR_PRIx is always the same now, use %016 for TARGET_PPC64 and
%08 for common code. This may slightly change the ppc64 debug output.

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

cca48a93 02/01/2013 02:52 am Andreas Färber

target-ppc: Fix unused variable warning for FLUSH_ALL_TLBS

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

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

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

21b2f13a 10/29/2012 12:45 pm Peter Maydell

Drop unnecessary check of TARGET_PHYS_ADDR_SPACE_BITS

For all our PPC targets the physical address space is at least
36 bits, so drop an unnecessary preprocessor conditional check
on TARGET_PHYS_ADDR_SPACE_BITS (erroneously introduced as part
of the change from target_phys_addr_t to hwaddr). This brings...

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

4be403c8 10/05/2012 03:46 am Avi Kivity

Make target_phys_addr_t 64 bits unconditionally

The hassle and compile time overhead of maintaining both 32-bit and 64-bit
capable source isn't worth the tiny performance advantage which is seen on
a minority of configurations. Switch to compiling libhw only once, with...

77c2cf33 06/24/2012 02:04 am Fabien Chouteau

booke_206_tlbwe: Discard invalid bits in MAS2

The size of EPN field in MAS2 depends on page size. This patch adds a
mask to discard invalid bits in EPN field.

Definition of EPN field from e500v2 RM:
EPN Effective page number: Depending on page size, only the bits...

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

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

ppc: Avoid AREG0 for MMU etc. helpers

Add an explicit CPUPPCState parameter instead of relying on AREG0.

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

4cc2cc08 06/24/2012 02:04 am Blue Swirl

ppc: Avoid a warning with the next patch

When the code is moved together by the next patch, compiler
detects a possible uninitialized variable use. Avoid the warning
by initializing the variables.

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

8cbbe385 06/24/2012 02:04 am Blue Swirl

ppc: Move MMU helpers from helper.c to mmu_helper.c

Move more MMU helpers from helper.c to mmu_helper.c.

Signed-off-by: Blue Swirl <>
Signed-off-by: Alexander Graf <>
Signed-off-by: Andreas Färber <>
[update to current helper.c state]...

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

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

ppc: Split MMU etc. helpers from op_helper.c

Move MMU, TLB, SLB and BAT ops to mmu_helper.c.

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