target/ppc: Implement large decrementer support for KVM
commit7d050527e3f5cadbf9db3bce09409fb4e9259997
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>
Fri, 1 Mar 2019 02:43:16 +0000 (1 13:43 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 12 Mar 2019 01:07:49 +0000 (12 12:07 +1100)
tree04a611677693b7cc316124bf48f246add523d257
parenta8dafa525181e57405b7ef4bf7c212bf5f6d8ca1
target/ppc: Implement large decrementer support for KVM

Implement support to allow KVM guests to take advantage of the large
decrementer introduced on POWER9 cpus.

To determine if the host can support the requested large decrementer
size, we check it matches that specified in the ibm,dec-bits device-tree
property. We also need to enable it in KVM by setting the LPCR_LD bit in
the LPCR. Note that to do this we need to try and set the bit, then read
it back to check the host allowed us to set it, if so we can use it but
if we were unable to set it the host cannot support it and we must not
use the large decrementer.

Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20190301024317.22137-3-sjitindarsingh@gmail.com>
[dwg: Small style fixes]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_caps.c
target/ppc/kvm.c
target/ppc/kvm_ppc.h