[PATCH 3/3] powerpc: Correctly context switch DSCR on POWER8

Michael Neuling mikey at neuling.org
Mon Aug 5 20:16:23 EST 2013


> > >  	};
> > > -	char *facility, *prefix;
> > > +	char *facility;
> > >  	u64 value;
> > > +	u8 status;
> > > +	bool hv;
> > >  
> > >  	if (regs->trap == 0xf60) {
> > >  		value = mfspr(SPRN_FSCR);
> > > -		prefix = "";
> > > +		hv = false;
> > >  	} else {
> > >  		value = mfspr(SPRN_HFSCR);
> > > -		prefix = "Hypervisor ";
> > > +		hv = true;
> > >  	}
> > 
> > Maybe:
> > 	hv = regs->trap == 0xf60;
> > 	if (hv)
> > 		value = mfspr(SPRN_HFSCR);
> > 	else
> > 		value = mfspr(SPRN_HFSCR);
> > or
> > 	value = mfspr(hv ? SPRN_HFSCR : SPRN_HFSCR);
> 
> ok.

So this doesn't work...  I forgot that mfspr is just a macro around the
mfspr instruction, so we can't dynamically pass in the SPR number,

So I have to use your first version. 

Mikey


More information about the Linuxppc-dev mailing list