[PATCH 2/16] add hypervisor support for SPU

Arnd Bergmann arnd at arndb.de
Thu Nov 16 02:47:14 EST 2006


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.

> @@ -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.

	Arnd <><



More information about the Linuxppc-dev mailing list