Skip to content

Commit

Permalink
KVM: PPC: Book3S HV: XIVE: Add a comment regarding VP numbering
Browse files Browse the repository at this point in the history
When the XIVE resources are allocated at the HW level, the VP
structures describing the vCPUs of a guest are distributed among
the chips to optimize the PowerBUS usage. For best performance, the
guest vCPUs can be pinned to match the VP structure distribution.

Currently, the VP identifiers are deduced from the vCPU id using
the kvmppc_pack_vcpu_id() routine which is not incorrect but not
optimal either. It VSMT is used, the result is not continuous and
the constraints on HW resources described above can not be met.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201210171450.1933725-14-clg@kaod.org
  • Loading branch information
Cédric Le Goater authored and Michael Ellerman committed Dec 10, 2020
1 parent 07efbca commit dddc4ef
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions arch/powerpc/kvm/book3s_xive.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,17 @@ static inline struct kvmppc_xive_src_block *kvmppc_xive_find_source(struct kvmpp
return xive->src_blocks[bid];
}

/*
* When the XIVE resources are allocated at the HW level, the VP
* structures describing the vCPUs of a guest are distributed among
* the chips to optimize the PowerBUS usage. For best performance, the
* guest vCPUs can be pinned to match the VP structure distribution.
*
* Currently, the VP identifiers are deduced from the vCPU id using
* the kvmppc_pack_vcpu_id() routine which is not incorrect but not
* optimal either. It VSMT is used, the result is not continuous and
* the constraints on HW resources described above can not be met.
*/
static inline u32 kvmppc_xive_vp(struct kvmppc_xive *xive, u32 server)
{
return xive->vp_base + kvmppc_pack_vcpu_id(xive->kvm, server);
Expand Down

0 comments on commit dddc4ef

Please sign in to comment.