[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 24/30] ppc/spapr-caps: Convert cap-sbbc to custom spapr
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 24/30] ppc/spapr-caps: Convert cap-sbbc to custom spapr-cap |
Date: |
Tue, 6 Mar 2018 15:01:48 +1100 |
From: Suraj Jitindar Singh <address@hidden>
Convert cap-sbbc (speculation barrier bounds checking) to a custom
spapr-cap type.
Signed-off-by: Suraj Jitindar Singh <address@hidden>
[dwg: Removed trailing whitespace]
[dwg: Don't explicitly list "?"/help option, trust convention]
[dwg: Fix some minor style problems]
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_caps.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
index b5a991f97a..8748692425 100644
--- a/hw/ppc/spapr_caps.c
+++ b/hw/ppc/spapr_caps.c
@@ -271,14 +271,26 @@ 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");
+ 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 > 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]);
}
}
@@ -339,9 +351,10 @@ sPAPRCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
.name = "sbbc",
.description = "Speculation Barrier Bounds Checking"
VALUE_DESC_TRISTATE,
.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.14.3
- [Qemu-ppc] [PULL 18/30] mac_newworld: use object link to pass OpenPIC object to macio, (continued)
- [Qemu-ppc] [PULL 18/30] mac_newworld: use object link to pass OpenPIC object to macio, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 16/30] openpic: move KVM-specific declarations into separate openpic_kvm.h file, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 13/30] heathrow: change heathrow_pic_init() to return the heathrow device, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 10/30] macio: move ESCC device within the macio device, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 21/30] target/ppc: Check mask when setting cap_ppc_safe_indirect_branch, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 20/30] macio: remove macio_init() function, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 19/30] macio: move setting of CUDA timebase frequency to macio_common_realize(), David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 22/30] ppc/spapr-caps: Add support for custom spapr_capabilities, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 30/30] PowerPC: Add TS bits into msr_mask, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 27/30] hw/ppc/spapr, e500: Use new property "stdout-path" for boot console, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 24/30] ppc/spapr-caps: Convert cap-sbbc to custom spapr-cap,
David Gibson <=
- [Qemu-ppc] [PULL 26/30] ppc/spapr-caps: Define the pseries-2.12-sxxm machine type, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 29/30] adb: add trace-events for monitoring keyboard/mouse during bus enumeration, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 25/30] ppc/spapr-caps: Convert cap-ibs to custom spapr-cap, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 14/30] macio: move macio related structures and defines into separate macio.h file, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 23/30] ppc/spapr-caps: Convert cap-cfpc to custom spapr-cap, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 11/30] heathrow: QOMify heathrow PIC, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 17/30] openpic: move OpenPIC state and related definitions to openpic.h, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 28/30] PPC: e500: Fix duplicate kernel load and device tree overlap, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 06/30] ppc: Add aCube Sam460ex board, David Gibson, 2018/03/05
- [Qemu-ppc] [PULL 05/30] pc-bios: Added u-boot-sam460 firmware binary, David Gibson, 2018/03/05