mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Dave Martin <Dave.Martin@arm.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, ard.biesheuvel@linaro.org,
	julien.thierry@arm.com, marc.zyngier@arm.com,
	catalin.marinas@arm.com, suzuki.poulose@arm.com,
	will.deacon@arm.com, christoffer.dall@arm.com,
	james.morse@arm.com
Subject: Re: [PATCH v3 2/3] arch/arm64: fpsimd: Introduce fpsimd_save_and_flush_cpu_state() and use it
Date: Thu, 25 Apr 2019 13:37:40 +0100	[thread overview]
Message-ID: <97a49fad-380b-4494-9722-03857441ffe5@arm.com> (raw)
In-Reply-To: <20190424131719.GS3567@e103592.cambridge.arm.com>

Hi Dave,

On 24/04/2019 14:17, Dave Martin wrote:
> On Tue, Apr 23, 2019 at 02:57:18PM +0100, Julien Grall wrote:
>> tent-Length: 4295
>> Lines: 128
>>
>> The only external user of fpsimd_save() and fpsimd_flush_cpu_state() is
>> the KVM FPSIMD code.
>>
>> A following patch will introduce a mechanism to acquire owernship of the
>> FPSIMD/SVE context for performing context management operations. Rather
>> than having to export the new helpers to get/put the context, we can just
>> introduce a new function to combine fpsimd_save() and
>> fpsimd_flush_cpu_state().
>>
>> This has also the advantage to remove any external call of fpsimd_save()
>> and fpsimd_flush_cpu_state(), so they can be turned static.
>>
>> Lastly, the new function can also be used in the PM notifier.
>>
>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>>
>> ---
>>      kernel_neon_begin() does not use fpsimd_save_and_flush_cpu_state()
>>      because the next patch will modify the function to also grab the
>>      FPSIMD/SVE context.
>>
>>      Changes in v3:
>>          - Rework the commit message
>>          - Move the prototype of fpsimd_save_and_flush_cpu_state()
>>          further down in the header
>>          - Remove comment in kvm_arch_vcpu_put_fp()
>>
>>      Changes in v2:
>>          - Patch added
>> ---
>>   arch/arm64/include/asm/fpsimd.h |  5 ++---
>>   arch/arm64/kernel/fpsimd.c      | 17 +++++++++++++----
>>   arch/arm64/kvm/fpsimd.c         |  4 +---
>>   3 files changed, 16 insertions(+), 10 deletions(-)
>>
>> diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h
>> index b73d12fcc7f9..c311d36ecffe 100644
>> --- a/arch/arm64/include/asm/fpsimd.h
>> +++ b/arch/arm64/include/asm/fpsimd.h
>> @@ -48,8 +48,6 @@ struct task_struct;
>>   extern void fpsimd_save_state(struct user_fpsimd_state *state);
>>   extern void fpsimd_load_state(struct user_fpsimd_state *state);
>>   
>> -extern void fpsimd_save(void);
>> -
>>   extern void fpsimd_thread_switch(struct task_struct *next);
>>   extern void fpsimd_flush_thread(void);
>>   
>> @@ -63,7 +61,8 @@ extern void fpsimd_bind_state_to_cpu(struct user_fpsimd_state *state,
>>   				     void *sve_state, unsigned int sve_vl);
>>   
>>   extern void fpsimd_flush_task_state(struct task_struct *target);
>> -extern void fpsimd_flush_cpu_state(void);
>> +
>> +extern void fpsimd_save_and_flush_cpu_state(void);
> 
> Nit: You could drop this blank line: these are all "state maintenance"
> operations, roughly speaking.
> 
> But don't bother unless you respin for some other reason.

It looks like I will need to make some changes in patch #3. So I will remove the 
line at the same time.

> 
> [...]
> 
> With or without that,
> 
> Reviewed-by: Dave Martin <Dave.Martin@arm.com>

Thank you!

Cheers,

-- 
Julien Grall

  reply	other threads:[~2019-04-25 12:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23 13:57 [PATCH v3 0/3] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state Julien Grall
2019-04-23 13:57 ` [PATCH v3 1/3] arm64/fpsimd: Remove the prototype for sve_flush_cpu_state() Julien Grall
2019-04-23 13:57 ` [PATCH v3 2/3] arch/arm64: fpsimd: Introduce fpsimd_save_and_flush_cpu_state() and use it Julien Grall
2019-04-24 13:17   ` Dave Martin
2019-04-25 12:37     ` Julien Grall [this message]
2019-04-25 14:12       ` Dave Martin
2019-04-23 13:57 ` [PATCH v3 3/3] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state Julien Grall
2019-04-24 13:17   ` Dave Martin
2019-04-25 15:57     ` Julien Grall
2019-04-25 16:39       ` Dave Martin
2019-04-25 17:12         ` Julien Grall
2019-04-26 10:48           ` 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=97a49fad-380b-4494-9722-03857441ffe5@arm.com \
    --to=julien.grall@arm.com \
    --cc=Dave.Martin@arm.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@arm.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will.deacon@arm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®