[PATCH 4/6 v2] KVM: PPC: Book3E: Add AltiVec support

Scott Wood scottwood at freescale.com
Fri Jul 4 09:07:42 EST 2014

On Mon, 2014-06-30 at 18:34 +0300, Mihai Caraman wrote:
> Add KVM Book3E AltiVec support. KVM Book3E FPU support gracefully reuse host
> infrastructure so follow the same approach for AltiVec.
> Signed-off-by: Mihai Caraman <mihai.caraman at freescale.com>
> ---
> v2:
>  - integrate Paul's FP/VMX/VSX changes
>  arch/powerpc/kvm/booke.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 65 insertions(+), 2 deletions(-)

I had to apply the whole patchset to get proper context for reviewing
this, and found some nits:

>                 if (kvmppc_supports_spe() || kvmppc_supports_altivec()) {
>                         kvmppc_booke_queue_irqprio(vcpu,
>                                 BOOKE_IRQPRIO_SPE_FP_DATA_ALTIVEC_ASSIST);
>                         r = RESUME_GUEST;
>                 } else { 
>                         /*
>                          * These really should never happen without CONFIG_SPE,
>                          * as we should never enable the real MSR[SPE] in the
>                          * guest.
>                          */

Besides the comment not being updated for Altivec, it's not true on HV,
where the guest can enable MSR[VEC] all by itself.  For HV, the reason
we shouldn't be able to get here is that we disable KVM on e6500 if
CONFIG_ALTIVEC is not enabled, and no other HV core supports either SPE
or Altivec.

>                         pr_crit("%s: unexpected SPE interrupt %u at %08lx\n",
>                                 __func__, exit_nr, vcpu->arch.pc);

Error string will say SPE regardless of what sort of chip you're on.
Given that this is explicitly on the "no support for Altivec or SPE"
path, "SPE/Altivec" phrasing seems appropriate.  Of course we have
bigger problems than that if we ever reach this code. :-)


More information about the Linuxppc-dev mailing list