Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1587880

Re: [PATCH v4 15/17] x86/traps: Fixup general protection faults caused by UMIP

From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject Re: [PATCH v4 15/17] x86/traps: Fixup general protection faults caused by UMIP
Date 2017-02-24 20:30 +0100
Message-ID <tetIZ-4Gt-5@gated-at.bofh.it> (permalink)
References <tdVei-5Qz-5@gated-at.bofh.it> <tdVnY-5XM-27@gated-at.bofh.it> <tdXSP-7Pd-29@gated-at.bofh.it> <te9TX-7sz-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Feb 23, 2017 at 2:15 PM, Ricardo Neri
<ricardo.neri-calderon@linux.intel.com> wrote:
> On Thu, 2017-02-23 at 10:27 +0100, Peter Zijlstra wrote:
>> On Wed, Feb 22, 2017 at 10:37:04PM -0800, Ricardo Neri wrote:
>> > @@ -492,6 +493,9 @@ do_general_protection(struct pt_regs *regs, long error_code)
>> >     RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
>> >     cond_local_irq_enable(regs);
>> >
>> > +   if (user_mode(regs) && (fixup_umip_exception(regs) == true))
>> > +           return;
>>
>> I'm thinking
>>
>>       if (user_mode(regs) && fixup_umip_exception(regs))
>>               return;
>>
>> is actually easier to read.
>
> In a previous version Andy Lutomirsky suggested that
>         if (user_mode(regs) && (fixup_umip_exception(regs) == 0))
>
> was easier to read :). Although at the time fixup_umip_exception
> returned a numeric value. Now it only returns true/false for
> successful/failed emulation. If with true/false not comparing to true
> makes it easier to read, I will make the change.

I think == true is silly :)

--Andy

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 15/17] x86/traps: Fixup general protection faults caused by UMIP Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-02-23 07:50 +0100
  Re: [PATCH v4 15/17] x86/traps: Fixup general protection faults  caused by UMIP Peter Zijlstra <peterz@infradead.org> - 2017-02-23 10:30 +0100
    Re: [PATCH v4 15/17] x86/traps: Fixup general protection faults  caused by UMIP Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-02-23 23:20 +0100
      Re: [PATCH v4 15/17] x86/traps: Fixup general protection faults  caused by UMIP Andy Lutomirski <luto@amacapital.net> - 2017-02-24 20:30 +0100
        Re: [PATCH v4 15/17] x86/traps: Fixup general protection faults  caused by UMIP Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-02-24 20:40 +0100
          Re: [PATCH v4 15/17] x86/traps: Fixup general protection faults caused by UMIP "H. Peter Anvin" <hpa@zytor.com> - 2017-02-24 20:50 +0100

csiph-web