target/ppc/spapr: Add workaround option to SPAPR_CAP_IBS
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>
Fri, 1 Mar 2019 03:19:11 +0000 (14:19 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 12 Mar 2019 01:07:49 +0000 (12:07 +1100)
commit399b2896d4948a1ec0278d896ea3a561df768d64
tree26e43bfa94cb2f4d70aef260897aaf5121d0f38b
parentedaa7995591eb51c9ae2c82267ca443f6921ff89
target/ppc/spapr: Add workaround option to SPAPR_CAP_IBS

The spapr_cap SPAPR_CAP_IBS is used to indicate the level of capability
for mitigations for indirect branch speculation. Currently the available
values are broken (default), fixed-ibs (fixed by serialising indirect
branches) and fixed-ccd (fixed by diabling the count cache).

Introduce a new value for this capability denoted workaround, meaning that
software can work around the issue by flushing the count cache on
context switch. This option is available if the hypervisor sets the
H_CPU_BEHAV_FLUSH_COUNT_CACHE flag in the cpu behaviours returned from
the KVM_PPC_GET_CPU_CHAR ioctl.

Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Message-Id: <20190301031912.28809-1-sjitindarsingh@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_caps.c
hw/ppc/spapr_hcall.c
include/hw/ppc/spapr.h
target/ppc/kvm.c