[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [QEMU-PPC] [PATCH V2 7/7] ppc/spapr-caps: Define the pseries-
From: |
Suraj Jitindar Singh |
Subject: |
[Qemu-ppc] [QEMU-PPC] [PATCH V2 7/7] ppc/spapr-caps: Define the pseries-2.12-sxxm machine type |
Date: |
Thu, 1 Mar 2018 17:38:04 +1100 |
The sxxm (speculative execution exploit mitigation) machine type is a
variant of the 2.12 machine type with workarounds for speculative
execution vulnerabilities enabled by default.
Signed-off-by: Suraj Jitindar Singh <address@hidden>
---
V1 -> V2:
- Use macro instead of magic number for cap-ibs default
---
hw/ppc/spapr.c | 17 +++++++++++++++++
hw/ppc/spapr_caps.c | 11 +++++++++++
2 files changed, 28 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 83c9d66dd5..3bff9212c9 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3983,6 +3983,23 @@ static void
spapr_machine_2_12_class_options(MachineClass *mc)
DEFINE_SPAPR_MACHINE(2_12, "2.12", true);
+static void spapr_machine_2_12_sxxm_instance_options(MachineState *machine)
+{
+ spapr_machine_2_12_instance_options(machine);
+}
+
+static void spapr_machine_2_12_sxxm_class_options(MachineClass *mc)
+{
+ sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_machine_2_12_class_options(mc);
+ smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND;
+ smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND;
+ smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD;
+}
+
+DEFINE_SPAPR_MACHINE(2_12_sxxm, "2.12-sxxm", false);
+
/*
* pseries-2.11
*/
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
index 298915c81d..77ad975fad 100644
--- a/hw/ppc/spapr_caps.c
+++ b/hw/ppc/spapr_caps.c
@@ -317,15 +317,26 @@ static sPAPRCapabilities
default_caps_with_cpu(sPAPRMachineState *spapr,
caps = smc->default_caps;
+ if (!ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_3_00,
+ 0, spapr->max_compat_pvr)) {
+ caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_BROKEN;
+ }
+
if (!ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_2_07,
0, spapr->max_compat_pvr)) {
caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_OFF;
}
+ if (!ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_2_06_PLUS,
+ 0, spapr->max_compat_pvr)) {
+ caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_BROKEN;
+ }
+
if (!ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_2_06,
0, spapr->max_compat_pvr)) {
caps.caps[SPAPR_CAP_VSX] = SPAPR_CAP_OFF;
caps.caps[SPAPR_CAP_DFP] = SPAPR_CAP_OFF;
+ caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_BROKEN;
}
return caps;
--
2.13.6
- [Qemu-ppc] [QEMU-PPC] [PATCH V2 1/7] target/ppc: Check mask when setting cap_ppc_safe_indirect_branch, Suraj Jitindar Singh, 2018/03/01
- [Qemu-ppc] [QEMU-PPC] [PATCH V2 2/7] ppc/spapr-caps: Add support for custom spapr_capabilities, Suraj Jitindar Singh, 2018/03/01
- [Qemu-ppc] [QEMU-PPC] [PATCH V2 3/7] ppc/spapr-caps: Convert cap-cfpc to custom spapr-cap, Suraj Jitindar Singh, 2018/03/01
- [Qemu-ppc] [QEMU-PPC] [PATCH V2 4/7] ppc/spapr-caps: Convert cap-sbbc to custom spapr-cap, Suraj Jitindar Singh, 2018/03/01
- [Qemu-ppc] [QEMU-PPC] [PATCH V2 6/7] ppc/spapr-caps: Remove tristate spapr-caps support, Suraj Jitindar Singh, 2018/03/01
- [Qemu-ppc] [QEMU-PPC] [PATCH V2 5/7] ppc/spapr-caps: Convert cap-ibs to custom spapr-cap, Suraj Jitindar Singh, 2018/03/01
- [Qemu-ppc] [QEMU-PPC] [PATCH V2 7/7] ppc/spapr-caps: Define the pseries-2.12-sxxm machine type,
Suraj Jitindar Singh <=
- Re: [Qemu-ppc] [QEMU-PPC] [PATCH V2 1/7] target/ppc: Check mask when setting cap_ppc_safe_indirect_branch, David Gibson, 2018/03/01