From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Michael Neuling To: Paul Mackerras Subject: Re: [PATCH 2/4] powerpc: Add new save_tar() register function. In-reply-to: <20130807080744.GA12112@iris.ozlabs.ibm.com> References: <1375855918-3625-1-git-send-email-mikey@neuling.org> <1375855918-3625-2-git-send-email-mikey@neuling.org> <20130807080744.GA12112@iris.ozlabs.ibm.com> Date: Wed, 07 Aug 2013 20:55:55 +1000 Message-ID: <25550.1375872955@ale.ozlabs.ibm.com> Cc: linuxppc-dev@lists.ozlabs.org, Matt Evans List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , > > +#ifdef CONFIG_PPC_BOOK3S_64 > > +_GLOBAL(_save_tar) > > + /* > > + * Back up the TAR across context switches. Note that the TAR is not > > + * available for use in the kernel. (To provide this, the TAR should > > + * be backed up/restored on exception entry/exit instead, and be in > > + * pt_regs. FIXME, this should be in pt_regs anyway (for debug).) > > + */ > > + mfspr r0,SPRN_TAR > > + std r0,THREAD_TAR(r3) > > + blr > > +#endif > > Why not do this in C, as in prev->tar = mfspr(SPRN_TAR); ? Good point! I'd just copied the original code which was inline asm in _switch(). Thanks, Mikey