spapr: nested: Add Power11 capability support for Nested PAPR guests in TCG L0
PATCH 1/1 spapr: nested: Add Power11 capability support for Nested PAPR guests in TCG L0
The Power11 architected and raw mode support in Linux was merged via [1] and the corresponding support in QEMU is waiting to be added by [2] which in V6 currently.
Add the Power11 capabilities and the required handling in TCG L0 implementation of the "Nested PAPR API".
Note: This patch is based on [2].
[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
Signed-off-by Amit Machhiwal <[email protected]>
--- hw/ppc/spapr_nested.c | 12 +++++++++++- include/hw/ppc/spapr_nested.h | 5 ++++- 2 files changed, 15 insertions(+), 2 deletions(-)
hw/ppc/spapr_nested.c +11 -1
@@ -771,6 +771,7 @@ static void copy_logical_pvr(void *a, void *b, bool set)if (*pvr_logical_ptr) {switch (*pvr_logical_ptr) { +case CPU_POWERPC_LOGICAL_3_10_P11 :case CPU_POWERPC_LOGICAL_3_10 : pcr =PCR_COMPAT_3_10 |PCR_COMPAT_3_00 ;break ;
@@ -1184,6 +1185,12 @@ static target_ulong h_guest_get_capabilities(PowerPCCPU *cpu,return H_PARAMETER ; } +/* P11 capabilities */ +if (ppc_check_compat (cpu,CPU_POWERPC_LOGICAL_3_10_P11 ,0 , + spapr->max_compat_pvr)) { + env->gpr[4 ] |=H_GUEST_CAPABILITIES_P11_MODE ; + } +/* P10 capabilities */ if (ppc_check_compat (cpu,CPU_POWERPC_LOGICAL_3_10 ,0 , spapr->max_compat_pvr)) {
@@ -1226,7 +1233,10 @@ static target_ulong h_guest_set_capabilities(PowerPCCPU *cpu, env->gpr[4 ] =1 ;/* set R5 to the first supported Power Processor Mode */ -if (ppc_check_compat (cpu,CPU_POWERPC_LOGICAL_3_10 ,0 , +if (ppc_check_compat (cpu,CPU_POWERPC_LOGICAL_3_10_P11 ,0 , + spapr->max_compat_pvr)) { + env->gpr[5 ] =H_GUEST_CAP_P11_MODE_BMAP ; + }else if (ppc_check_compat (cpu,CPU_POWERPC_LOGICAL_3_10 ,0 , spapr->max_compat_pvr)) { env->gpr[5 ] =H_GUEST_CAP_P10_MODE_BMAP ; } else if (ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_3_00, 0,
include/hw/ppc/spapr_nested.h +4 -1
@@ -210,11 +210,14 @@ typedef struct SpaprMachineStateNestedGuest {#define H_GUEST_CAPABILITIES_COPY_MEM 0x8000000000000000#define H_GUEST_CAPABILITIES_P9_MODE 0x4000000000000000#define H_GUEST_CAPABILITIES_P10_MODE 0x2000000000000000 -#define H_GUEST_CAP_VALID_MASK (H_GUEST_CAPABILITIES_P10_MODE | \ +#define H_GUEST_CAPABILITIES_P11_MODE 0x1000000000000000 +#define H_GUEST_CAP_VALID_MASK (H_GUEST_CAPABILITIES_P11_MODE | \ + H_GUEST_CAPABILITIES_P10_MODE | \ H_GUEST_CAPABILITIES_P9_MODE)#define H_GUEST_CAP_COPY_MEM_BMAP 0#define H_GUEST_CAP_P9_MODE_BMAP 1#define H_GUEST_CAP_P10_MODE_BMAP 2 +#define H_GUEST_CAP_P11_MODE_BMAP 3#define PAPR_NESTED_GUEST_MAX 4096#define H_GUEST_DELETE_ALL_FLAG 0x8000000000000000ULL#define PAPR_NESTED_GUEST_VCPU_MAX 2048
Signature · 1 line
2.47.0