[RFC PATCH 2/6] KVM: PPC: Book3E: Refactor SPE_FP exit handling

Caraman Mihai Claudiu-B02008 B02008 at freescale.com
Wed Jun 5 17:29:47 EST 2013


> > +		/*
> > +		 * The interrupt is shared, KVM support for the
> > featured unit
> > +		 * is detected at run-time.
> > +		 */
> 
> This is a decent comment for the changelog, but for the code itself it
> seems fairly obvious if you look at the definition of
> kvmppc_supports_spe().

I will move it to change log.

> 
> > +		bool handled = false;
> > +
> > +		if (kvmppc_supports_spe()) {
> > +#ifdef CONFIG_SPE
> > +			if (cpu_has_feature(CPU_FTR_SPE))
> 
> Didn't you already check this using kvmppc_supports_spe()?

It makes sense with the next patch. It handles the improbable case of having
CONFIG_ALTIVEC and CONFIG_SPE defined:

	if (kvmppc_supports_altivec() || kvmppc_supports_spe()).

> 
> >  	case BOOKE_INTERRUPT_SPE_FP_ROUND:
> > +#ifdef CONFIG_SPE
> >  		kvmppc_booke_queue_irqprio(vcpu,
> > BOOKE_IRQPRIO_SPE_FP_ROUND);
> >  		r = RESUME_GUEST;
> >  		break;
> 
> Why not use kvmppc_supports_spe() here, for consistency?

I added cpu_has_feature(CPU_FTR_SPE) for the case specified above, but here
SPE_FP_ROUND is not shared with ALTIVEC. CONFIG_SPE is used in other places
in KVM without this check, shouldn't be all or nothing?

-Mike






More information about the Linuxppc-dev mailing list