提交 a0a2c8ab 编写于 作者: D Daniel Henrique Barboza 提交者: Michal Privoznik

qemu: Add capability for CFPC pSeries feature

CFPC (Cache Flush on Privilege Change) is one of the capabilities
added to QEMU to mitigate Spectre vulnerabilities in Power chips.
It was implemented in QEMU 2.12 by commit 6898aed77f46.

This capability is still used today due to differences in how
the host setup (hardware and firmware/kernel) can handle this
mitigation. Its default value also varies with the pseries machine
version of the time. There's also certain OSes, like AIX, that
might not support the default value of the pseries machine the
guest uses.

Exposing this in the Libvirt XML as a feature will allow users to tune
CFPC values in a cleaner way, instead of hacking parameters in
<qemu:commandline> elements.
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 606fb397
......@@ -574,6 +574,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
"virtio.packed",
"pcie-root-port.hotplug",
"aio.io_uring",
"machine.pseries.cap-cfpc",
);
......@@ -1617,6 +1618,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsPSeries[] = {
{ "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 },
{ "cap-cfpc", QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC },
};
static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsVirt[] = {
......
......@@ -555,6 +555,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
QEMU_CAPS_VIRTIO_PACKED_QUEUES, /* virtio.packed */
QEMU_CAPS_PCIE_ROOT_PORT_HOTPLUG, /* pcie-root-port.hotplug */
QEMU_CAPS_AIO_IO_URING, /* -blockdev {...,"aio":"io_uring",...} */
QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, /* -machine pseries.cap-cfpc */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
......
......@@ -154,6 +154,7 @@
<flag name='memory-backend-file.align'/>
<flag name='drive-nvme'/>
<flag name='i8042'/>
<flag name='machine.pseries.cap-cfpc'/>
<version>2011090</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900289</microcodeVersion>
......
......@@ -156,6 +156,7 @@
<flag name='ramfb'/>
<flag name='drive-nvme'/>
<flag name='i8042'/>
<flag name='machine.pseries.cap-cfpc'/>
<version>2012050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900239</microcodeVersion>
......
......@@ -161,6 +161,7 @@
<flag name='drive-nvme'/>
<flag name='i8042'/>
<flag name='storage.werror'/>
<flag name='machine.pseries.cap-cfpc'/>
<version>3000091</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900240</microcodeVersion>
......
......@@ -175,6 +175,7 @@
<flag name='drive-nvme'/>
<flag name='i8042'/>
<flag name='storage.werror'/>
<flag name='machine.pseries.cap-cfpc'/>
<version>4000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900240</microcodeVersion>
......
......@@ -180,6 +180,7 @@
<flag name='i8042'/>
<flag name='rng-builtin'/>
<flag name='storage.werror'/>
<flag name='machine.pseries.cap-cfpc'/>
<version>4001050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900242</microcodeVersion>
......
......@@ -192,6 +192,7 @@
<flag name='storage.werror'/>
<flag name='fsdev.multidevs'/>
<flag name='virtio.packed'/>
<flag name='machine.pseries.cap-cfpc'/>
<version>4002050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900241</microcodeVersion>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册