[PATCH v3 11/20] arm64: assembler: add macros to conditionally yield the NEON under PREEMPT
Dave Martin
Dave.Martin at arm.com
Thu Dec 7 08:15:02 PST 2017
On Thu, Dec 07, 2017 at 03:47:43PM +0000, Ard Biesheuvel wrote:
> On 7 December 2017 at 14:50, Ard Biesheuvel <ard.biesheuvel at linaro.org> wrote:
> > On 7 December 2017 at 14:39, Dave Martin <Dave.Martin at arm.com> wrote:
> >> On Wed, Dec 06, 2017 at 07:43:37PM +0000, Ard Biesheuvel wrote:
[...]
> >>> + .macro if_will_cond_yield_neon
> >>> +#ifdef CONFIG_PREEMPT
> >>> + get_thread_info x0
> >>> + ldr w1, [x0, #TSK_TI_PREEMPT]
> >>> + ldr x0, [x0, #TSK_TI_FLAGS]
> >>> + cmp w1, #1 // == PREEMPT_OFFSET
> >>
> >> Can we at least drop a BUILD_BUG_ON() somewhere to check this?
> >>
> >> Maybe in kernel_neon_begin() since this is intimately kernel-mode NEON
> >> related.
> >>
> >
> > Sure.
> >
>
> I only just understood your asm-offsets remark earlier. I wasn't aware
> that it allows exposing random constants as well (although it is
> fairly obvious now that I do). So I will expose PREEMPT_OFFSET rather
> than open code it
[...]
OK, yes, this works for any C expression that is compiletime-constant
but requires evaluation that the assembler doesn't understand.
Cheers
---Dave
More information about the linux-arm-kernel
mailing list