[PATCH] spufs-prevent-sdr1-access

Geoff Levand geoffrey.levand at am.sony.com
Thu Jan 26 09:54:16 EST 2006


Arnd Bergmann wrote:
> The definition of spu_mfc_sdr_set() already knows about wether it's
> running on hypervisor or not. Also, we know that we always pass the
> same value. I'd suggest changing this to 'spu_mfc_sdr1_setup();'
> 
> which is defined as
> 
> void spu_mfc_sdr1_setup(struct spu *spu)
> {
> 	if (!firmware_has_feature(FW_FEATURE_LPAR))
> 		out_be64(&spu->priv1->mfc_sdr_RW, mfspr(SPRN_SDR1));
> 	else
> 		do_whatever_is_necessary(spu);
> }
> 

I was thinking that would be a better way also...

>> 	/* Set storage description.  */
>>-	csa->priv1.mfc_sdr_RW = mfspr(SPRN_SDR1);
>>+	if (!platform_is_lpar())
>>+		csa->priv1.mfc_sdr_RW = mfspr(SPRN_SDR1);
>>
> 
> I don't think we need to read SPRN_SDR1 here at all, since the value
> should
> be constant over the lifetime of the kernel. Can you try ripping out
> mfc_sdr_RW from csa->priv1 completely?
> 

Ok, we have some other cleanups we're preparing, so I'll try to put it
in with those.  Maybe in a day or so.

Paul, please ignore this patch.

-Geoff



More information about the Linuxppc64-dev mailing list