lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97a49fad-380b-4494-9722-03857441ffe5@arm.com>
Date:   Thu, 25 Apr 2019 13:37:40 +0100
From:   Julien Grall <julien.grall@....com>
To:     Dave Martin <Dave.Martin@....com>
Cc:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        ard.biesheuvel@...aro.org, julien.thierry@....com,
        marc.zyngier@....com, catalin.marinas@....com,
        suzuki.poulose@....com, will.deacon@....com,
        christoffer.dall@....com, james.morse@....com
Subject: Re: [PATCH v3 2/3] arch/arm64: fpsimd: Introduce
 fpsimd_save_and_flush_cpu_state() and use it

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

Thank you!

Cheers,

-- 
Julien Grall

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ