From 249a5c789e0da5a2aaddbe77a7420352106b3e11 Mon Sep 17 00:00:00 2001 From: Daniel Henrique Barboza Date: Mon, 27 Apr 2020 09:14:28 -0300 Subject: [PATCH] qemu: Add capability for SBBC pSeries feature SBBC (Speculation Barrier Bounds Checking) is another capability related to Spectre mitigation efforts in Power processors. It was implemented in QEMU 2.12 by commit 09114fd81799. This patch introduces it as QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC to be implemented in the next patch. Like the case with the now implemented CFPC, exposing this feature in the XML allows for a cleaner way for users to tune the SBBC accordingly, given that not all hypervisor and guest setups supports this Spectre mitigation. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 4 ++++ src/qemu/qemu_capabilities.h | 3 +++ tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 + 8 files changed, 13 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 4838f3cfb5..2e2b9874a7 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -575,6 +575,9 @@ VIR_ENUM_IMPL(virQEMUCaps, "pcie-root-port.hotplug", "aio.io_uring", "machine.pseries.cap-cfpc", + + /* 365 */ + "machine.pseries.cap-sbbc", ); @@ -1619,6 +1622,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsPSeries[] = { { "cap-nested-hv", QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV }, { "cap-ccf-assist", QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST }, { "cap-cfpc", QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC }, + { "cap-sbbc", QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC }, }; static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsVirt[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 88cf44ed59..4040c50dc4 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -557,6 +557,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_AIO_IO_URING, /* -blockdev {...,"aio":"io_uring",...} */ QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, /* -machine pseries.cap-cfpc */ + /* 365 */ + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, /* -machine pseries.cap-sbbc */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml index cdd4f26993..2046f1097c 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -155,6 +155,7 @@ + 2011090 0 42900289 diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml index 84e9ad2dcc..9e71080152 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml @@ -157,6 +157,7 @@ + 2012050 0 42900239 diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml index 3d70a67dab..f13b384e91 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml @@ -162,6 +162,7 @@ + 3000091 0 42900240 diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml index ce2d470cb2..674e4b4944 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml @@ -176,6 +176,7 @@ + 4000000 0 42900240 diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml index a813776660..f89498171b 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml @@ -181,6 +181,7 @@ + 4001050 0 42900242 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml index c33786b0bf..ebc39130df 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml @@ -193,6 +193,7 @@ + 4002050 0 42900241 -- GitLab