lkml.org 
[lkml]   [2024]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 1/2] x86/fpu: Extend kernel_fpu_begin_mask() to initialize AMX state
From
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.

\
 
 \ /
  Last update: 2024-05-27 18:22    [W:0.604 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site