lkml.org 
[lkml]   [2020]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch part-III V2 05/23] x86/entry/32: Provide macro to emit IDT entry stubs
Date
Brian Gerst <brgerst@gmail.com> writes:
> On Sun, Mar 8, 2020 at 7:24 PM Thomas Gleixner <tglx@linutronix.de> wrote:
>> +#ifdef CONFIG_X86_INVD_BUG
>> +.macro idtentry_push_func vector cfunc
>> + .if \vector == X86_TRAP_XF
>> + /* AMD 486 bug: invd from userspace calls exception 19 instead of #GP */
>> + ALTERNATIVE "pushl $do_general_protection", \
>> + "pushl $do_simd_coprocessor_error", \
>> + X86_FEATURE_XMM
>> + .else
>> + pushl $\cfunc
>> + .endif
>> +.endm
>> +#else
>> +.macro idtentry_push_func vector cfunc
>> + pushl $\cfunc
>> +.endm
>> +#endif
>
> IMHO it would be better to push this to the C code and not make the
> asm more complicated. Something like:
>
> dotraplinkage void
> do_simd_coprocessor_error(struct pt_regs *regs, long error_code)
> {
> #ifdef CONFIG_X86_INVD_BUG
> /* AMD 486 bug: invd from userspace calls exception 19 instead of #GP */
> if (!static_cpu_has(X86_FEATURE_XMM)) {
> do_general_protection(regs, error_code);
> return;
> }
> #endif
> RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
> math_error(regs, error_code, X86_TRAP_XF);
> }

That's too obvious :)

Thanks for catching that!

tglx

\
 
 \ /
  Last update: 2020-03-09 08:02    [W:0.044 / U:0.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site