lkml.org 
[lkml]   [2018]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 02/16] x86/split_lock: Handle #AC exception for split lock in kernel mode
On Fri, Jun 22, 2018 at 01:59:44PM +0200, Thomas Gleixner wrote:
> On Fri, 22 Jun 2018, Thomas Gleixner wrote:
> > The whole thing is simply:
> >
> > handle_ac()
> > {
> > if (user_mode(regs)) {
> > do_trap(AC, SIGBUS, ...);
> > } else {
> > disable_ac_on_local_cpu();
> > WARN_ONCE(1);
> > }
> > }
> >
> > That wants #AC enabled as early as possible so the kernel gets as much
> > coverage as it can. If it trips in the kernel it's a bug and needs to be
> > fixed and we can them fix ONE by ONE.
>
> That said, #AC is just yet another badly defined and hastily bolted on
> (mis)feature. This should have been:
>
> Bit A: Enable #AC if CPL < 3
> Bit B: Enable #AC if CPL == 3
>
> But that would have been too useful and would allow sensible use of #AC
> without creating software trainwrecks.
>

The two bits would be ideal.

So I will do SIGBUG for user and WARN/disable for kernel in the next version.

Thanks.

-Fenghua

\
 
 \ /
  Last update: 2018-06-23 01:19    [W:0.146 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site