qemu-e2k/target-ppc
David Gibson e5c0d3ce40 target-ppc: Add helpers for updating a CPU's SDR1 and external HPT
When a Power cpu with 64-bit hash MMU has it's hash page table (HPT)
pointer updated by a write to the SDR1 register we need to update some
derived variables.  Likewise, when the cpu is configured for an external
HPT (one not in the guest memory space) some derived variables need to be
updated.

Currently the logic for this is (partially) duplicated in ppc_store_sdr1()
and in spapr_cpu_reset().  In future we're going to need it in some other
places, so make some common helpers for this update.

In addition the new ppc_hash64_set_external_hpt() helper also updates
SDR1 in KVM - it's not updated by the normal runtime KVM <-> qemu CPU
synchronization.  In a sense this belongs logically in the
ppc_hash64_set_sdr1() helper, but that is called from
kvm_arch_get_registers() so can't itself call cpu_synchronize_state()
without infinite recursion.  In practice this doesn't matter because
the only other caller is TCG specific.

Currently there aren't situations where updating SDR1 at runtime in KVM
matters, but there are going to be in future.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
2016-03-16 09:55:06 +11:00
..
arch_dump.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
cpu-models.c target-ppc: Add PVR for POWER8NVL processor 2016-03-16 09:55:05 +11:00
cpu-models.h target-ppc: Add PVR for POWER8NVL processor 2016-03-16 09:55:05 +11:00
cpu-qom.h dump: qemunotes aren't commonly needed 2016-01-15 14:40:24 +00:00
cpu.h ppc: Add a few more P8 PMU SPRs 2016-03-16 09:55:05 +11:00
dfp_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
excp_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
fpu_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
gdbstub.c target-ppc: rename and export maybe_bswap_register() 2016-01-30 23:37:37 +11:00
helper_regs.h
helper.h target-ppc: Split 44x tlbiva from ppc_tlb_invalidate_one() 2016-01-30 23:49:26 +11:00
int_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
kvm_ppc.h target-ppc: Add helpers for updating a CPU's SDR1 and external HPT 2016-03-16 09:55:06 +11:00
kvm-stub.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
kvm.c target-ppc: Add helpers for updating a CPU's SDR1 and external HPT 2016-03-16 09:55:06 +11:00
machine.c target-ppc: Rework SLB page size lookup 2016-01-30 23:37:38 +11:00
Makefile.objs kvm_ppc: remove kvmppc_timer_hack 2015-09-20 22:48:38 +02:00
mem_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
mfrom_table_gen.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
mfrom_table.c
misc_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
mmu_helper.c target-ppc: Add helpers for updating a CPU's SDR1 and external HPT 2016-03-16 09:55:06 +11:00
mmu-hash32.c log: do not unnecessarily include qom/cpu.h 2016-02-03 09:19:10 +00:00
mmu-hash32.h target-ppc: Convert mmu-hash{32,64}.[ch] from CPUPPCState to PowerPCCPU 2016-01-30 23:37:38 +11:00
mmu-hash64.c target-ppc: Add helpers for updating a CPU's SDR1 and external HPT 2016-03-16 09:55:06 +11:00
mmu-hash64.h target-ppc: Add helpers for updating a CPU's SDR1 and external HPT 2016-03-16 09:55:06 +11:00
monitor.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
STATUS
timebase_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
translate_init.c target-ppc: Add PVR for POWER8NVL processor 2016-03-16 09:55:05 +11:00
translate.c tcg: Add type for vCPU pointers 2016-03-01 13:27:09 +00:00
user_only_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00