]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Add capability for the ccf-assist pSeries feature
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Tue, 8 Oct 2019 20:06:23 +0000 (17:06 -0300)
committerCole Robinson <crobinso@redhat.com>
Wed, 9 Oct 2019 21:45:09 +0000 (17:45 -0400)
Linux kernel 5.1 added a new PPC KVM capability named
KVM_PPC_CPU_CHAR_BCCTR_FLUSH_ASSIST, which is exposed to the QEMU guest
since QEMU commit 8ff43ee404d under a new sPAPR capability called
SPAPR_CAP_CCF_ASSIST. This cap indicates whether the processor supports
hardware acceleration for the count cache flush workaround, which
is a software workaround that flushes the count cache on context
switch. If the processor has this hardware acceleration, the software
flush can be shortened, resulting in performance gain.

This hardware acceleration is defaulted to 'off' in QEMU. The reason
is that earlier versions of the Power 9 processor didn't support
it (it is available on Power 9 DD2.3 and newer), and defaulting this
option to 'on' would break migration compatibility between the Power 9
processor class.

However, the user running a P9 DD2.3+ hypervisor might want to create
guests with ccf-assist=on, accepting the downside of only being able
to migrate them only between other P9 DD2.3+ hosts running upstream
kernel 5.1+, to get a performance boost.

This patch adds this new capability to Libvirt, with the name of
QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml

index 4a3e739a4877b678b6ef983021b113bb6d54d719..091e48c7e16242566b4cdf499d432c0d21bd60ff 100644 (file)
@@ -546,6 +546,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
               "query-cpu-model-baseline",
               "query-cpu-model-comparison",
               "ramfb",
+              "machine.pseries.cap-ccf-assist",
     );
 
 
@@ -1442,6 +1443,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsPSeries[] = {
     { "cap-hpt-max-page-size", QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE },
     { "cap-htm", QEMU_CAPS_MACHINE_PSERIES_CAP_HTM },
     { "cap-nested-hv", QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV },
+    { "cap-ccf-assist", QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST },
 };
 
 static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsVirt[] = {
index bdabb2ddb56dde3b9e4cf827ab239cec14e07d4a..ea45edb9a4659555f4e835b2e668b118ce7ffc62 100644 (file)
@@ -527,6 +527,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
     QEMU_CAPS_QUERY_CPU_MODEL_BASELINE, /* qmp query-cpu-model-baseline */
     QEMU_CAPS_QUERY_CPU_MODEL_COMPARISON, /* qmp query-cpu-model-comparison */
     QEMU_CAPS_DEVICE_RAMFB, /* -device ramfb */
+    QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, /* -machine pseries.cap-ccf-assist */
 
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
index 86e146effc840ad41aa5a2b8ab77155144973f8f..b99abd69de44f9885a165180c183978e3415bb6b 100644 (file)
   <flag name='nbd-bitmap'/>
   <flag name='bochs-display'/>
   <flag name='migration-file-drop-cache'/>
+  <flag name='machine.pseries.cap-ccf-assist'/>
   <version>4000000</version>
   <kvmVersion>0</kvmVersion>
   <microcodeVersion>42900758</microcodeVersion>