This is another hcall that is part of the Partition Energy Management (PEM) option. As with h_get_em_parms(), we do not support it.
Signed-off-by: Daniel Henrique Barboza <danielhb...@gmail.com> --- hw/ppc/spapr_hcall.c | 27 +++++++++++++++++++++++++++ include/hw/ppc/spapr.h | 1 + 2 files changed, 28 insertions(+) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index b572ef50bb..db6cb6bb89 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1564,6 +1564,31 @@ static target_ulong h_get_em_parms(PowerPCCPU *cpu, return H_FUNCTION; } +static target_ulong h_best_energy(PowerPCCPU *cpu, + SpaprMachineState *spapr, + target_ulong opcode, + target_ulong *args) +{ + /* + * This HCALL is described as follows in PAPR+ V2.8 section 14.14.2.1: + * + * "This hcall() returns a hint to the caller as to the probable impact + * toward the goal of minimal platform energy consumption for a given + * level of computing capacity that would result from releasing or + * activating various computing resources." + * + * In short, this HCALL provides a hint about what would happen with + * the energy consumption if the OS tries to increase/decrease + * the performance of a given device/CPU/mem. + * + * This is also part of the PEM option and, as with h_get_em_parms, is + * not supported. + */ + qemu_log_mask(LOG_UNSUPP, "Unsupported SPAPR hcall 0x"TARGET_FMT_lx"%s\n", + opcode, " (H_BEST_ENERGY)"); + return H_FUNCTION; +} + /* * When this handler returns, the environment is switched to the L2 guest * and TCG begins running that. spapr_exit_nested() performs the switch from @@ -1903,7 +1928,9 @@ static void hypercall_register_types(void) spapr_register_hypercall(KVMPPC_H_TLB_INVALIDATE, h_tlb_invalidate); spapr_register_hypercall(KVMPPC_H_COPY_TOFROM_GUEST, h_copy_tofrom_guest); + /* Unsupported PEM option h-calls */ spapr_register_hypercall(H_GET_EM_PARMS, h_get_em_parms); + spapr_register_hypercall(H_BEST_ENERGY, h_best_energy); } type_init(hypercall_register_types) diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index f5c33dcc86..7995bc0cb6 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -535,6 +535,7 @@ struct SpaprMachineState { #define H_SET_MPP 0x2D0 #define H_GET_MPP 0x2D4 #define H_HOME_NODE_ASSOCIATIVITY 0x2EC +#define H_BEST_ENERGY 0x2F4 #define H_XIRR_X 0x2FC #define H_RANDOM 0x300 #define H_SET_MODE 0x31C -- 2.35.1