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

Andy Lutomirski <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.msdos.general,gmane.comp.emulators.wine.devel
Message-ID <CALCETrX-b1Pjz=bFfj+YFk=Fgy5FKTpAYig__zF=GTn4VXNf4w@mail.gmail.com>
On Thu, Feb 23, 2017 at 2:15 PM, Ricardo Neri
<[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.