[PATCH 2/16] add hypervisor support for SPU

Ishizaki Kou kou.ishizaki at toshiba.co.jp
Fri Nov 17 21:33:31 EST 2006


Hi Arnd-san,

> On Wednesday 15 November 2006 10:28, Ishizaki Kou wrote:
> 
> > +static int __init find_spu_unit_number(struct device_node *spe)
> > +{
> > +       const unsigned int *reg;
> > +       reg = get_property(spe, "reg", NULL);
> > +       return reg ? *reg : 0;
> > +}
> > +
> 
> The unit number shold not be in the 'reg' property any more. With
> the device tree layout we want to migrate to for better OFW compatibility,
> 'reg' should contain the addresses of local store, problem state and priv2
> mappings, in that order.
> 
> Having the function is fine, but your interface needs to be a different
> property.

We don't think that standard binding for SPE exists. Do you have any
proposal? If you have, please send us your binding.

On our device tree, property "reg" has unit number. Addresses are in
property "priv2", "problem" and "local-store". Because of LPAR
environment, property "priv1" does not exist.


> > @@ -805,7 +816,11 @@
> >         if (ret)
> >                 goto out_unmap;
> >         spin_lock_init(&spu->register_lock);
> > -       spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1));
> > +#ifdef CONFIG_SPU_NEED_SHADOW_INT_MASK
> > +       spin_lock_init(&spu->int_mask_lock);
> > +#endif
> > +       if (!(firmware_has_feature(FW_FEATURE_LPAR)))
> > +               spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1));
> >         spu_mfc_sr1_set(spu, 0x33);
> > ...
> >         u32 node;
> > +       u32 unit_number;
> >         u64 flags;
> >         u64 dar;
> >         u64 dsisr;
> > +#ifdef CONFIG_SPU_NEED_SHADOW_INT_MASK
> > +       spinlock_t int_mask_lock;
> > +       u64 shadow_int_mask_RW[3];
> > +#endif
> >         size_t ls_size;
> >         unsigned int slb_replace;
> >         struct mm_struct *mm;
> 
> Not sure what others think about this, but I'd prefer not to have the
> #ifdef here at all. This part is not a fast path, so we can spend the
> few extra bytes and cycles on keeping it in the kernel always.
> 
> The place where it is used should still have a run-time check for whether
> it's running on BEAT.

When Geoff-san's "abstract spu management routines" patch is accepted,
we have to rewrite this code to meet with that patch.
These data and initializer will be moved to platform-dependent files.

Thank you,
Kou Ishizaki
Toshiba



More information about the Linuxppc-dev mailing list