]> Git Repo - qemu.git/commit
spapr: Move PAPR mode cpu setup fully to spapr code
authorDavid Gibson <[email protected]>
Thu, 5 Apr 2018 06:02:51 +0000 (16:02 +1000)
committerDavid Gibson <[email protected]>
Fri, 4 May 2018 05:00:37 +0000 (15:00 +1000)
commitda20aed12a983dcaa6ccef80c0175f438e2780e7
tree5b1d3705225de09f378c013b793025f69c6f48ad
parentf00bed9521cee4d67c4937b51de692e0bcf9efef
spapr: Move PAPR mode cpu setup fully to spapr code

cpu_ppc_set_papr() does several things:
    1) it sets up the virtual hypervisor interface
    2) it prevents the cpu from ever entering hypervisor mode
    3) it tells KVM that we're emulating a cpu in PAPR mode
and 4) it configures the LPCR and AMOR (hypervisor privileged registers)
       so that TCG will behave correctly for PAPR guests, without
       attempting to emulate the cpu in hypervisor mode

(1) & (2) make sense for any virtual hypervisor (if another one ever
exists).

(3) belongs more properly in the machine type specific to a PAPR guest, so
move it to spapr_cpu_init().  While we're at it, remove an ugly test on
kvm_enabled() by making kvmppc_set_papr() a safe no-op on non-KVM.

(4) also belongs more properly in the machine type specific code.  (4) is
done by mangling the default values of the SPRs, so that they will be set
correctly at reset time.  Manipulating usually-static parameters of the cpu
model like this is kind of ugly, especially since the values used really
have more to do with the platform than the cpu.

The spapr code already has places for PAPR specific initializations of
register state in spapr_cpu_reset(), so move this handling there.

Signed-off-by: David Gibson <[email protected]>
Reviewed-by: Cédric Le Goater <[email protected]>
Tested-by: Cédric Le Goater <[email protected]>
hw/ppc/spapr_cpu_core.c
target/ppc/cpu.h
target/ppc/kvm.c
target/ppc/translate_init.c
This page took 0.025415 seconds and 4 git commands to generate.