[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a2f2fc-972d-ab9b-a29d-72f02d94e60e@amd.com>
Date: Thu, 9 Apr 2020 20:15:57 +0200
From: Christian König <christian.koenig@....com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Jann Horn <jannh@...gle.com>,
Harry Wentland <harry.wentland@....com>,
Leo Li <sunpeng.li@....com>, amd-gfx@...ts.freedesktop.org,
Alex Deucher <alexander.deucher@....com>,
"David (ChunMing) Zhou" <David1.Zhou@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
the arch/x86 maintainers <x86@...nel.org>,
kernel list <linux-kernel@...r.kernel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Andy Lutomirski <luto@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
mhiramat@...nel.org
Subject: Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2
without any visible FPU state protection
Am 09.04.20 um 19:09 schrieb Peter Zijlstra:
> On Thu, Apr 09, 2020 at 05:59:56PM +0200, Peter Zijlstra wrote:
> [SNIP]
>> I'll need another approach, let me consider.
> Christian; it says these files are generated, does that generator know
> which functions are wholly in FPU context and which are not?
Well that "generator" is still a human being :)
It's just that the formulae for the calculation come from the hardware
team and we are not able to easily transcript them to fixed point
calculations.
> My current thinking is that if I annotate all functions that are wholly
> inside kernel_fpu_start() with an __fpu function attribute, then I can
> verify that any call from regular text to fpu text only happens inside
> kernel_fpu_begin()/end(). And I can ensure that all !__fpu annotation
> fuctions only contain !fpu instructions.
Yeah, that sounds like a good idea to me and should be easily doable.
> Can that generator add the __fpu function attribute or is that something
> that would need to be done manually (which seems like it would be
> painful, since it is quite a bit of code) ?
We are currently in the process of moving all the stuff which requires
floating point into a single C file(s) and then make sure that we only
call those within kernel_fpu_begin()/end() blocks.
Annotating those function with __fpu or even saying to gcc that all code
of those files should go into a special text.fpu segment shouldn't be
much of a problem.
Regards,
Christian.
Powered by blists - more mailing lists