All of lore.kernel.org
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH resend 2/2] arm64: assembler: add macros to conditionally yield the NEON under PREEMPT
Date: Thu, 29 Mar 2018 13:36:44 +0200	[thread overview]
Message-ID: <978F38B1-BCAA-4E57-BFD4-3BB5D8AC0F19@linaro.org> (raw)
In-Reply-To: <20180329111227.GQ16308@e103592.cambridge.arm.com>


> On 29 Mar 2018, at 13:12, Dave Martin <Dave.Martin@arm.com> wrote:
> 
>> On Thu, Mar 29, 2018 at 10:59:28AM +0100, Ard Biesheuvel wrote:
>>> On 29 March 2018 at 10:36, Dave Martin <Dave.Martin@arm.com> wrote:
>>>> On Thu, Mar 29, 2018 at 10:02:18AM +0100, Ard Biesheuvel wrote:
>>>> On 28 March 2018 at 18:18, Dave Martin <Dave.Martin@arm.com> wrote:
> 
> [...]
> 
>>>> I should probably rephrase this to say that x0 .. x18 may be clobbered.
>>> 
>>> Sure, that would be simpler.  Or maybe just say that the set of clobbers
>>> is the same as for a function call -- this would cover NZCV for example.
>>> 
>> 
>> Even better.
> 
> [...]
> 
>>>>> Since the patchup sequences aren't likely to be many or large, it's
>>>>> not the end of the world if we don't do this discarding though.
>>>>> 
>>>> 
>>>> I chose not to bother. These are handcrafted assembly files that are
>>>> usually kept in modules, which means the .text footprint is a 4k
>>>> multiple anyway, and the code is complex enough as it is, so
>>>> discarding ~10 instructions that have been moved out of the hot path
>>>> already doesn't seem that useful to me.
>>> 
>>> Agreed.  Do you know who is building CONFIG_PREEMPT=n kernels these
>>> days?
>>> 
>> 
>> AFAIK most distro kernels use voluntary preemption, so they'd still
>> benefit from this.
> 
> OK, and given the size of the typical distro kernel, I doubt anyone will
> lose sleep over a couple of hundred extra bytes.
> 

My point was that this is /not/ dead code on typical distro kernels given that this approach should work equally under voluntary preemption.


> I might try to hack it up later just for fun, just to see whether it
> works.
> 
> [...]
> 
>>>>> Should you include
>>>>> 
>>>>>        .purgem do_cond_yield_neon
>>>>>        .purgem endif_yield_neon
>>>>> 
>>>>> here?
>>>>> 
>>>>> Otherwise, I think you would get macro redefinition errors if
>>>>> if_will_cond_yield_neon is used more than once in a given file.
>>>>> 
>>>> 
>>>> if_will_cond_yield_neon does not define any macros itself, so this
>>>> shouldn't be a problem.
>>> 
>>> You're right.  I skipped an .endm for some reason while reading and
>>> decided there were nested macros here.  But there aren't.
>>> 
>>> Protecting against misuse would be "nice", but people using them already
>>> need to know what they're doing, so it's low-priority and something that
>>> could be added in a later patch.  So I agree that there's no need to add
>>> that here.
>>> 
>> 
>> OK.
>> 
>> I will respin with the minor issues addressed and your R-b added, and
>> repost before the end of the day.
> 
> Sounds good to me.
> 
> Cheers
> ---Dave
> 
>> Will, hopefully you're still ok with picking this up for v4.17? I'd
>> hate to postpone the crypto pieces that depend on it to v4.19
> 
> [...]

  reply	other threads:[~2018-03-29 11:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 12:41 [PATCH resend 0/2] preparatory arm64 asm patches for yielding the NEON Ard Biesheuvel
2018-03-28 12:41 ` [PATCH resend 1/2] arm64: assembler: add utility macros to push/pop stack frames Ard Biesheuvel
2018-03-28 16:34   ` Dave Martin
2018-03-29  8:54     ` Ard Biesheuvel
2018-03-29  9:28       ` Dave Martin
2018-03-28 12:41 ` [PATCH resend 2/2] arm64: assembler: add macros to conditionally yield the NEON under PREEMPT Ard Biesheuvel
2018-03-28 17:18   ` Dave Martin
2018-03-29  9:02     ` Ard Biesheuvel
2018-03-29  9:36       ` Dave Martin
2018-03-29  9:59         ` Ard Biesheuvel
2018-03-29 11:12           ` Dave Martin
2018-03-29 11:36             ` Ard Biesheuvel [this message]
2018-03-29 12:42               ` Dave Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=978F38B1-BCAA-4E57-BFD4-3BB5D8AC0F19@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.