lkml.org 
[lkml]   [2017]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/5] x86: Implement __WARN using UD0
On Tue, Mar 21, 2017 at 10:32:52AM -0500, Josh Poimboeuf wrote:
> On Tue, Mar 21, 2017 at 04:14:46PM +0100, Peter Zijlstra wrote:
> > > > +static int fixup_bug(struct pt_regs *regs, int trapnr)
> > > > +{
> > > > + if (trapnr != X86_TRAP_UD)
> > > > + return 0;
> > > > +
> > > > + switch (report_bug(regs->ip, regs)) {
> > > > + case BUG_TRAP_TYPE_NONE:
> > > > + case BUG_TRAP_TYPE_BUG:
> > > > + break;
> > > > +
> > > > + case BUG_TRAP_TYPE_WARN:
> > > > + regs->ip += 2;
> > > > + return 1;
> > >
> > > For self-documentation purposes, maybe use a define for the length of
> > > the ud0 instruction?
> >
> > Well, UD0 and UD2 really. LENGTH_UD0_OR_UD2 is a bit of a fail, name
> > wise.
>
> Why UD2? Warnings are UD0-only, no? What about UD0_LEN? Or at least a
> comment would be helpful I think.

Oh, right, we only resume on WARN,.. Doh.

\
 
 \ /
  Last update: 2017-03-21 16:43    [W:0.115 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site