AW: SPE & Interrupt context (was how to make use of SPE instructions)
Markus Stockhausen
stockhausen at collogia.de
Wed Jan 28 16:00:44 AEDT 2015
> > Von: Scott Wood [scottwood at freescale.com]
> > Gesendet: Mittwoch, 28. Januar 2015 05:21
> > An: Markus Stockhausen
> > Cc: Michael Ellerman; linuxppc-dev at lists.ozlabs.org; Herbert Xu
> > Betreff: Re: SPE & Interrupt context (was how to make use of SPE instructions)
> >
> > Hi Scott,
> >
> > thanks for your helpful feedback. As you might have seen I sent a first
> > patch for the sha256 kernel module that takes care about preemption.
> >
> > Herbert Xu noticed that my module won't run in for IPsec as all
> > work will be done from interrupt context. Do you have a tip how I can
> > mitigate the check I implemented:
> >
> > static bool spe_usable(void)
> > {
> > return !in_interrupt();
> > }
> >
> > Intel guys have something like that
> >
> > bool irq_fpu_usable(void)
> > {
> > return !in_interrupt() ||
> > interrupted_user_mode() ||
> > interrupted_kernel_fpu_idle();
> > }
> >
> > But I have no idea how to transfer it to the PPC/SPE case.
>
> I'm not sure what sort of tip you're looking for, other than
> implementing it myself. :-)
Hi Scott,
maybe I did not explain it correctly. interrupted_kernel_fpu_idle()
is x86 specific. The same applies to interrupted_user_mode().
I'm just searching for a similar feature in the PPC/SPE world.
I can see that enable_kernel_spe() does something with the
MSR_SPE flag, but I have no idea how to determine if I'm allowed
to enable SPE although I'm inside an interrupt context.
I'm asking because from the previous posts I conclude that
running SPE instructions inside an interrupt might be critical.
Because of registers not being saved?
Or can I just save the register contents myself and interrupt
context is no longer a showstopper?
Markus
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: InterScan_Disclaimer.txt
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20150128/d545c9fd/attachment.txt>
More information about the Linuxppc-dev
mailing list