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:   Mon, 09 Mar 2020 08:01:11 +0100
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Brian Gerst <brgerst@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        the arch/x86 maintainers <x86@...nel.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Juergen Gross <jgross@...e.com>,
        Frederic Weisbecker <frederic@...nel.org>,
        Alexandre Chartre <alexandre.chartre@...cle.com>
Subject: Re: [patch part-III V2 05/23] x86/entry/32: Provide macro to emit IDT entry stubs

Brian Gerst <brgerst@...il.com> writes:
> On Sun, Mar 8, 2020 at 7:24 PM Thomas Gleixner <tglx@...utronix.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ