[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [QEMU-PPC] [PATCH V2 4/7] ppc/spapr-caps: Convert cap-sbbc to
From: |
Suraj Jitindar Singh |
Subject: |
[Qemu-ppc] [QEMU-PPC] [PATCH V2 4/7] ppc/spapr-caps: Convert cap-sbbc to custom spapr-cap |
Date: |
Thu, 1 Mar 2018 17:38:01 +1100 |
Convert cap-sbbc (speculation barrier bounds checking) to a custom
spapr-cap type.
Signed-off-by: Suraj Jitindar Singh <address@hidden>
---
V1 -> V2:
- Patch added to series
---
hw/ppc/spapr_caps.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
index 41a9799ea8..547eded520 100644
--- a/hw/ppc/spapr_caps.c
+++ b/hw/ppc/spapr_caps.c
@@ -267,14 +267,22 @@ static void cap_safe_cache_apply(sPAPRMachineState
*spapr, uint8_t val,
}
}
+sPAPRCapPossible cap_sbbc_possible = {
+ .num = 3,
+ .vals = {"broken", "workaround", "fixed"},
+ .help = "broken - no protection, workaround - workaround available, fixed
- fixed in hardware",
+};
+
static void cap_safe_bounds_check_apply(sPAPRMachineState *spapr, uint8_t val,
Error **errp)
{
+ uint8_t kvm_val = kvmppc_get_cap_safe_bounds_check();
+
if (tcg_enabled() && val) {
/* TODO - for now only allow broken for TCG */
error_setg(errp, "Requested safe bounds check capability level not
supported by tcg, try a different value for cap-sbbc");
- } else if (kvm_enabled() && (val > kvmppc_get_cap_safe_bounds_check())) {
- error_setg(errp, "Requested safe bounds check capability level not
supported by kvm, try a different value for cap-sbbc");
+ } else if (kvm_enabled() && (val > kvm_val)) {
+ error_setg(errp, "Requested safe bounds check capability level not
supported by kvm, try cap-sbbc=%s", cap_sbbc_possible.vals[kvm_val]);
}
}
@@ -331,11 +339,12 @@ sPAPRCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
},
[SPAPR_CAP_SBBC] = {
.name = "sbbc",
- .description = "Speculation Barrier Bounds Checking"
VALUE_DESC_TRISTATE,
+ .description = "Speculation Barrier Bounds Checking (help, broken,
workaround, fixed)",
.index = SPAPR_CAP_SBBC,
- .get = spapr_cap_get_tristate,
- .set = spapr_cap_set_tristate,
+ .get = spapr_cap_get_string,
+ .set = spapr_cap_set_string,
.type = "string",
+ .possible = &cap_sbbc_possible,
.apply = cap_safe_bounds_check_apply,
},
[SPAPR_CAP_IBS] = {
--
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 <=
- [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, 2018/03/01
- 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