[PATCH 0/7] target/ppc: Add support for Radix partition-scoped translation

Cédric Le Goater posted 7 patches 4 years ago
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test FreeBSD passed
Test checkpatch passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200330094946.24678-1-clg@kaod.org
Maintainers: David Gibson <david@gibson.dropbear.id.au>
target/ppc/cpu.h         |   3 +
target/ppc/excp_helper.c |   3 +-
target/ppc/mmu-radix64.c | 411 +++++++++++++++++++++++++++++----------
3 files changed, 308 insertions(+), 109 deletions(-)
[PATCH 0/7] target/ppc: Add support for Radix partition-scoped translation
Posted by Cédric Le Goater 4 years ago
Hello,

The Radix tree translation model currently supports process-scoped
translation for the PowerNV machine (Hypervisor mode) and for the
pSeries machine (Guest mode). Guests running under an emulated
Hypervisor (PowerNV machine) require a new type of Radix translation,
called partition-scoped, which is missing today.

The Radix tree translation is a 2 steps process. The first step,
process-scoped translation, converts an effective Address to a guest
real address, and the second step, partition-scoped translation,
converts a guest real address to a host real address.

There are difference cases to covers : 

* Hypervisor real mode access: no Radix translation.

* Hypervisor or host application access (quadrant 0 and 3) with
  relocation on: process-scoped translation.

* Guest OS real mode access: only partition-scoped translation.

* Guest OS real or guest application access (quadrant 0 and 3) with
  relocation on: both process-scoped translation and partition-scoped
  translations.

* Hypervisor access in quadrant 1 and 2 with relocation on: both
  process-scoped translation and partition-scoped translations.

The radix tree partition-scoped translation is performed using tables
pointed to by the first double-word of the Partition Table Entries and
process-scoped translation uses tables pointed to by the Process Table
Entries (second double-word of the Partition Table Entries).

Both partition-scoped and process-scoped translations process are
identical and thus the radix tree traversing code is largely reused.
However, errors in partition-scoped translations generate hypervisor
exceptions.

Based on work from Suraj Jitindar Singh <sjitindarsingh@gmail.com>

Thanks,

C.

Cédric Le Goater (6):
  target/ppc: Introduce a relocation bool in  ppc_radix64_handle_mmu_fault()
  target/ppc: Assert if HV mode is set when running under a pseries machine
  target/ppc: Introduce ppc_radix64_xlate() for Radix tree translation
  target/ppc: Rework ppc_radix64_walk_tree() for partition-scoped translation
  target/ppc: Extend ppc_radix64_check_prot() with a 'partition_scoped' bool
  target/ppc: Add support for Radix partition-scoped translation

Suraj Jitindar Singh (1):
  target/ppc: Enforce that the root page directory size must be at least
    5

 target/ppc/cpu.h         |   3 +
 target/ppc/excp_helper.c |   3 +-
 target/ppc/mmu-radix64.c | 411 +++++++++++++++++++++++++++++----------
 3 files changed, 308 insertions(+), 109 deletions(-)

-- 
2.21.1