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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 9 May 2024 11:50:33 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: "Chang S. Bae" <chang.seok.bae@...el.com>, linux-kernel@...r.kernel.org
Cc: x86@...nel.org, platform-driver-x86@...r.kernel.org, tglx@...utronix.de,
 mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
 hdegoede@...hat.com, ilpo.jarvinen@...ux.intel.com, tony.luck@...el.com,
 ashok.raj@...el.com, jithu.joseph@...el.com
Subject: Re: [PATCH v2 1/2] x86/fpu: Extend kernel_fpu_begin_mask() to
 initialize AMX state

On 5/9/24 11:41, Chang S. Bae wrote:
> On 5/9/2024 10:36 AM, Dave Hansen wrote:
>>
>> I'd probably just do this:
>>
>> +    kernel_fpu_begin();
>> +    // AMX *MUST* be in the init state for the wrmsr() to work.
>> +    // But, the more in the init state, the less state the test
>> +    // has to save and restore.  Just zap everything.
>> +    restore_fpregs_from_fpstate(&init_fpstate,   
>> +                    fpu_user_cfg.max_features);
>> +
> 
> I assume that this snippet goes to the IFS driver side. Then, we need
> to introduce and export a new wrapper for this. 
> restore_fpregs_from_fpstate() and its arguments are not accessible as
> of now.

Yes, a new wrapper to initialize all the user FPU state is fine.

> Also, I think we should encapsulate them. If we follow this style, we
> could have invoked tilerelease() directly from the idle driver, right?

You could have...  But I think the point there truly was to do a minimal
amount of work because you're going idle and need to race to get there.
The path to idle is super hot and you don't want to do _any_ additional
work.  It's worth writing highly AMX-specific code because generic code
would be slow there.

The IFS path is a super duper slow one.  It takes *FOREVER*.  I like the
idea of being simple, dumb and slow.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ