]> git.proxmox.com Git - mirror_qemu.git/commit
target/ppc: Use class fields to simplify LPCR masking
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 6 Jan 2020 05:35:10 +0000 (16:35 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 16 Mar 2020 22:41:15 +0000 (09:41 +1100)
commite232eccc754b7c61110a21fb029f2946cc968799
treed2c0a1ee0cf49cc5622be3ded2a0e505020ef170
parent5167100975e7888de397456adc1678f65a3dbd59
target/ppc: Use class fields to simplify LPCR masking

When we store the Logical Partitioning Control Register (LPCR) we have a
big switch statement to work out which are valid bits for the cpu model
we're emulating.

As well as being ugly, this isn't really conceptually correct, since it is
based on the mmu_model variable, whereas the LPCR isn't (only) about the
MMU, so mmu_model is basically just acting as a proxy for the cpu model.

Handle this in a simpler way, by adding a suitable lpcr_mask to the QOM
class.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
target/ppc/cpu-qom.h
target/ppc/mmu-hash64.c
target/ppc/translate_init.inc.c